feat: compile deps

This commit is contained in:
rvcas
2022-12-20 15:32:37 -05:00
committed by Lucas
parent b06bf610b7
commit e34cbc8e7e
11 changed files with 112 additions and 214 deletions

View File

@@ -1,18 +1,24 @@
use sample
// Stuff
/// Spend validator
pub fn spend(datum: sample.Datum, rdmr: sample.Redeemer, _ctx: Nil) -> Bool {
let x = #(datum, rdmr, #[244])
let y = [#(#[222], #[222]), #(#[233], #[52])]
let [z, f, ..g] = y
let #(a, b, _) = x
z == #(#[222], #[222])
use aiken/list
use aiken/string
use aiken/hash.{Blake2b_224, Hash}
use aiken/transaction.{ScriptContext}
use aiken/transaction/credential.{VerificationKey}
pub type Datum {
owner: Hash<Blake2b_224, VerificationKey>,
}
pub type Redeemer {
msg: ByteArray,
}
pub fn spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool {
let must_say_hello = string.from_bytearray(redeemer.msg) == "Hello, World!"
let must_be_signed =
context.transaction.extra_signatories
|> list.any(fn(vk) { vk == datum.owner })
must_say_hello && must_be_signed
}
test foo() {