chore: convert hello_world to v3
This commit is contained in:
parent
90d75d4a13
commit
03a348040b
|
@ -13,4 +13,4 @@ requirements = []
|
||||||
source = "github"
|
source = "github"
|
||||||
|
|
||||||
[etags]
|
[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"]
|
||||||
|
|
|
@ -3,16 +3,16 @@ use aiken/list
|
||||||
use aiken/transaction.{ScriptContext}
|
use aiken/transaction.{ScriptContext}
|
||||||
use aiken/transaction/credential.{VerificationKey}
|
use aiken/transaction/credential.{VerificationKey}
|
||||||
|
|
||||||
type Datum {
|
pub type Datum {
|
||||||
owner: Hash<Blake2b_224, VerificationKey>,
|
owner: Hash<Blake2b_224, VerificationKey>,
|
||||||
}
|
}
|
||||||
|
|
||||||
type Redeemer {
|
pub type Redeemer {
|
||||||
msg: ByteArray,
|
msg: ByteArray,
|
||||||
}
|
}
|
||||||
|
|
||||||
validator {
|
validator hello_world {
|
||||||
fn spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool {
|
spend(datum: Datum, redeemer: Redeemer, context: ScriptContext) -> Bool {
|
||||||
let must_say_hello = redeemer.msg == "Hello, World!"
|
let must_say_hello = redeemer.msg == "Hello, World!"
|
||||||
|
|
||||||
let must_be_signed =
|
let must_be_signed =
|
||||||
|
@ -20,4 +20,8 @@ validator {
|
||||||
|
|
||||||
must_say_hello && must_be_signed
|
must_say_hello && must_be_signed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else(_ctx) {
|
||||||
|
fail
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue