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:
@@ -2,8 +2,8 @@ use aiken/list.{find, foldr}
|
||||
use aiken/transaction.{Input, ScriptContext, Spend}
|
||||
use aiken/transaction/value.{add, zero}
|
||||
|
||||
validator staking {
|
||||
fn(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
|
||||
validator {
|
||||
fn staking(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
|
||||
expect Spend(ref) =
|
||||
context.purpose
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use aiken/list
|
||||
use aiken/transaction.{Output, ScriptContext}
|
||||
|
||||
validator backtrace {
|
||||
fn(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
|
||||
validator {
|
||||
fn backtrace(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
|
||||
expect Some(_) =
|
||||
list.find(context.transaction.outputs, fn(_) { True })
|
||||
let _ =
|
||||
|
||||
Reference in New Issue
Block a user