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

@@ -12,23 +12,23 @@ pub fn has_policy_id(self: Output, policy_id: PolicyId) -> Bool {
|> not
}
pub fn spend(_datum: Data, _redeemer: Data, ctx: ScriptContext) -> Bool {
ctx.transaction.outputs
|> list.any(has_policy_id(_, my_policy_id))
}
fn mint(
output_reference: OutputReference,
_redeemer: Void,
ctx: ScriptContext,
) -> Bool {
when
list.find(
ctx.transaction.inputs,
fn(input) { input.output_reference == output_reference },
)
is {
Some(_) -> True
None -> False
validator spend {
fn(_datum: Data, _redeemer: Data, ctx: ScriptContext) -> Bool {
ctx.transaction.outputs
|> list.any(has_policy_id(_, my_policy_id))
}
}
validator mint(output_reference: OutputReference) {
fn(_redeemer: Void, ctx: ScriptContext) -> Bool {
when
list.find(
ctx.transaction.inputs,
fn(input) { input.output_reference == output_reference },
)
is {
Some(_) -> True
None -> False
}
}
}