chore: use fmt to update examples
This commit is contained in:
parent
1ab1ff9a1f
commit
0be09cd9e5
|
@ -28,7 +28,7 @@ fn assert_purpose(purpose) {
|
||||||
ref.transaction_id == TransactionId(
|
ref.transaction_id == TransactionId(
|
||||||
#"0000000000000000000000000000000000000000000000000000000000000000",
|
#"0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
) && ref.output_index == 0
|
) && ref.output_index == 0
|
||||||
_ -> error @"script purpose isn't 'Spend'"
|
_ -> fail @"script purpose isn't 'Spend'"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,6 @@ fn assert_outputs(transaction) {
|
||||||
output.reference_script == None,
|
output.reference_script == None,
|
||||||
]
|
]
|
||||||
|> list.and
|
|> list.and
|
||||||
_ -> error @"unexpected number of outputs"
|
_ -> fail @"unexpected number of outputs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ fn assert_outputs(outputs) {
|
||||||
when outputs is {
|
when outputs is {
|
||||||
[output_1, output_2, ..] ->
|
[output_1, output_2, ..] ->
|
||||||
assert_first_output(output_1) && assert_second_output(output_2)
|
assert_first_output(output_1) && assert_second_output(output_2)
|
||||||
_ -> error @"expected transaction to have (at least) 2 outputs"
|
_ -> fail @"expected transaction to have (at least) 2 outputs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ fn assert_second_output(output) {
|
||||||
),
|
),
|
||||||
when output.datum is {
|
when output.datum is {
|
||||||
InlineDatum(_) -> True
|
InlineDatum(_) -> True
|
||||||
_ -> error @"expected inline datum"
|
_ -> fail @"expected inline datum"
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|> list.and
|
|> list.and
|
||||||
|
|
|
@ -29,7 +29,7 @@ fn assert_mint(purpose, transaction) {
|
||||||
let tokens = value.tokens(transaction.mint, policy_id)
|
let tokens = value.tokens(transaction.mint, policy_id)
|
||||||
|
|
||||||
when dict.get(tokens, #"666f6f") is {
|
when dict.get(tokens, #"666f6f") is {
|
||||||
None -> error @"token not found"
|
None -> fail @"token not found"
|
||||||
Some(quantity) -> quantity == 1337
|
Some(quantity) -> quantity == 1337
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,11 @@ validator {
|
||||||
|
|
||||||
[
|
[
|
||||||
when dict.get(ctx.transaction.withdrawals, alice) is {
|
when dict.get(ctx.transaction.withdrawals, alice) is {
|
||||||
None -> error @"alice's withdrawal not found"
|
None -> fail @"alice's withdrawal not found"
|
||||||
Some(value) -> value == 42
|
Some(value) -> value == 42
|
||||||
},
|
},
|
||||||
when dict.get(ctx.transaction.withdrawals, bob) is {
|
when dict.get(ctx.transaction.withdrawals, bob) is {
|
||||||
None -> error @"bob's withdrawal not found"
|
None -> fail @"bob's withdrawal not found"
|
||||||
Some(value) -> value == 14
|
Some(value) -> value == 14
|
||||||
},
|
},
|
||||||
dict.keys(ctx.transaction.withdrawals) == [alice, bob],
|
dict.keys(ctx.transaction.withdrawals) == [alice, bob],
|
||||||
|
|
Loading…
Reference in New Issue