diff --git a/examples/hello_world/aiken.lock b/examples/hello_world/aiken.lock index 21fbf8f4..0f958098 100644 --- a/examples/hello_world/aiken.lock +++ b/examples/hello_world/aiken.lock @@ -13,4 +13,4 @@ requirements = [] source = "github" [etags] -"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1716400776, nanos_since_epoch = 210636000 }, "6b89f2c51314a7bc2cc377d37c9eade9a4239086fe636ac6030c6979182f1247"] +"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723580005, nanos_since_epoch = 641136000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"] diff --git a/examples/hello_world/validators/hello_world.ak b/examples/hello_world/validators/hello_world.ak index 334aa194..ef3006c9 100644 --- a/examples/hello_world/validators/hello_world.ak +++ b/examples/hello_world/validators/hello_world.ak @@ -3,16 +3,16 @@ use aiken/list use aiken/transaction.{ScriptContext} use aiken/transaction/credential.{VerificationKey} -type Datum { +pub type Datum { owner: Hash, } -type Redeemer { +pub type Redeemer { msg: ByteArray, } -validator { - fn spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool { +validator hello_world { + spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool { let must_say_hello = redeemer.msg == "Hello, World!" let must_be_signed = @@ -20,4 +20,8 @@ validator { must_say_hello && must_be_signed } + + else(_ctx) { + fail + } }