test: fix acceptance tests
This commit is contained in:
@@ -5,8 +5,7 @@
|
||||
},
|
||||
"validators": [
|
||||
{
|
||||
"title": "spend",
|
||||
"purpose": "spend",
|
||||
"title": "spend.spend",
|
||||
"datum": {
|
||||
"title": "Data",
|
||||
"description": "Any Plutus data."
|
||||
@@ -19,8 +18,7 @@
|
||||
"hash": "3f46b921ead33594e1da4afa1f1ba31807c0d8deca029f96fe9fe394"
|
||||
},
|
||||
{
|
||||
"title": "spend",
|
||||
"purpose": "mint",
|
||||
"title": "spend.mint",
|
||||
"redeemer": {
|
||||
"title": "Unit",
|
||||
"description": "The nullary constructor.",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user