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:
@@ -4,8 +4,8 @@ use aiken/transaction.{NoDatum, ScriptContext, Spend, TransactionId}
|
||||
use aiken/transaction/credential.{VerificationKeyCredential}
|
||||
use aiken/transaction/value
|
||||
|
||||
validator spend {
|
||||
fn(_datum: Void, _redeemer: Void, ctx: ScriptContext) {
|
||||
validator {
|
||||
fn spend(_datum: Void, _redeemer: Void, ctx: ScriptContext) {
|
||||
[
|
||||
assert_id(ctx.transaction),
|
||||
assert_purpose(ctx.purpose),
|
||||
|
||||
@@ -5,8 +5,8 @@ use aiken/list
|
||||
use aiken/transaction.{DatumHash, InlineDatum, ScriptContext}
|
||||
use aiken/transaction/credential.{Inline, VerificationKeyCredential}
|
||||
|
||||
validator spend {
|
||||
fn(datum: Data, _redeemer: Data, ctx: ScriptContext) {
|
||||
validator {
|
||||
fn spend(datum: Data, _redeemer: Data, ctx: ScriptContext) {
|
||||
[
|
||||
assert_datum(datum),
|
||||
assert_datums(ctx.transaction.datums),
|
||||
|
||||
@@ -3,8 +3,8 @@ use aiken/list
|
||||
use aiken/transaction.{Mint, ScriptContext}
|
||||
use aiken/transaction/value
|
||||
|
||||
validator mint {
|
||||
fn(redeemer: Data, ctx: ScriptContext) {
|
||||
validator {
|
||||
fn mint(redeemer: Data, ctx: ScriptContext) {
|
||||
[
|
||||
assert_purpose(ctx),
|
||||
assert_mint(ctx.purpose, ctx.transaction),
|
||||
|
||||
@@ -5,8 +5,8 @@ use aiken/transaction/credential.{
|
||||
Inline, ScriptCredential, VerificationKeyCredential,
|
||||
}
|
||||
|
||||
validator spend {
|
||||
fn(_datum: Void, _redeemer: Void, ctx: ScriptContext) {
|
||||
validator {
|
||||
fn spend(_datum: Void, _redeemer: Void, ctx: ScriptContext) {
|
||||
let alice =
|
||||
Inline(
|
||||
VerificationKeyCredential(
|
||||
|
||||
Reference in New Issue
Block a user