test: fix acceptance tests

This commit is contained in:
rvcas
2023-02-15 22:46:16 -05:00
committed by Lucas
parent 7b0faa7c1c
commit d41e6942c6
12 changed files with 109 additions and 105 deletions

View File

@@ -3,13 +3,15 @@ use aiken/list
use aiken/transaction.{Mint, ScriptContext}
use aiken/transaction/value
fn mint(redeemer: Data, ctx: ScriptContext) {
[
assert_purpose(ctx),
assert_mint(ctx.purpose, ctx.transaction),
assert_redeemers(ctx, redeemer),
]
|> list.and
validator mint {
fn(redeemer: Data, ctx: ScriptContext) {
[
assert_purpose(ctx),
assert_mint(ctx.purpose, ctx.transaction),
assert_redeemers(ctx, redeemer),
]
|> list.and
}
}
fn assert_purpose(ctx) {
@@ -27,7 +29,7 @@ fn assert_mint(purpose, transaction) {
let tokens = value.tokens(transaction.mint, policy_id)
when dict.get(tokens, #"666f6f") is {
None -> error("token not found")
None -> error "token not found"
Some(quantity) -> quantity == 1337
}
}