feat(codegen): support multi-validators
* rename force_wrap to force * add a bunch of builder methods to Term<Name> * refactor one tiny location to show off builder methods * split generate into `generate` and `generate_test` * create wrap_as_multi_validator function Co-authored-by: Kasey White <kwhitemsg@gmail.com>
This commit is contained in:
@@ -13,15 +13,15 @@ pub fn has_policy_id(self: Output, policy_id: PolicyId) -> Bool {
|
||||
|> not
|
||||
}
|
||||
|
||||
validator spend {
|
||||
fn(_datum: Data, _redeemer: Data, ctx: ScriptContext) -> Bool {
|
||||
validator {
|
||||
fn spend(_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 {
|
||||
validator (output_reference: OutputReference) {
|
||||
fn mint(_redeemer: Void, ctx: ScriptContext) -> Bool {
|
||||
when
|
||||
list.find(
|
||||
ctx.transaction.inputs,
|
||||
|
||||
Reference in New Issue
Block a user