Fix acceptance tests to use new syntax.

This commit is contained in:
KtorZ
2023-02-18 09:48:05 +01:00
parent 53fb821b62
commit 5132110d4b
17 changed files with 37 additions and 36 deletions

View File

@@ -28,7 +28,7 @@ fn assert_purpose(purpose) {
ref.transaction_id == TransactionId(
#"0000000000000000000000000000000000000000000000000000000000000000",
) && ref.output_index == 0
_ -> error "script purpose isn't 'Spend'"
_ -> error @"script purpose isn't 'Spend'"
}
}
@@ -49,6 +49,6 @@ fn assert_outputs(transaction) {
output.reference_script == None,
]
|> list.and
_ -> error "unexpected number of outputs"
_ -> error @"unexpected number of outputs"
}
}

View File

@@ -40,7 +40,7 @@ fn assert_outputs(outputs) {
when outputs is {
[output_1, output_2, ..] ->
assert_first_output(output_1) && assert_second_output(output_2)
_ -> error "expected transaction to have (at least) 2 outputs"
_ -> error @"expected transaction to have (at least) 2 outputs"
}
}
@@ -67,7 +67,7 @@ fn assert_second_output(output) {
),
when output.datum is {
InlineDatum(_) -> True
_ -> error "expected inline datum"
_ -> error @"expected inline datum"
},
]
|> list.and

View File

@@ -29,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
}
}

View File

@@ -23,11 +23,11 @@ validator spend {
[
when dict.get(ctx.transaction.withdrawals, alice) is {
None -> error "alice's withdrawal not found"
None -> error @"alice's withdrawal not found"
Some(value) -> value == 42
},
when dict.get(ctx.transaction.withdrawals, bob) is {
None -> error "bob's withdrawal not found"
None -> error @"bob's withdrawal not found"
Some(value) -> value == 14
},
dict.keys(ctx.transaction.withdrawals) == [alice, bob],