Fix remaining acceptance tests to be V3-compatible

This commit is contained in:
KtorZ
2024-08-27 18:58:50 +02:00
parent d615b4f889
commit 48535636ed
59 changed files with 357 additions and 277 deletions

View File

@@ -3,14 +3,14 @@
[[requirements]]
name = "aiken-lang/stdlib"
version = "main"
version = "v2"
source = "github"
[[packages]]
name = "aiken-lang/stdlib"
version = "main"
version = "v2"
requirements = []
source = "github"
[etags]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723158435, nanos_since_epoch = 59914000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]
"aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1724776958, nanos_since_epoch = 450634000 }, "cdbbce58b61deb385e7ea787a2e0fc2dc8fe94db9999e0e6275bc9c70e5796be"]

View File

@@ -5,12 +5,12 @@
"plutusVersion": "v2",
"compiler": {
"name": "Aiken",
"version": "v1.0.31-alpha+6e4a16d"
"version": "v1.0.31-alpha+4003343"
}
},
"validators": [
{
"title": "spend.gift_card",
"title": "spend.foo.mint",
"redeemer": {
"title": "rdmr",
"schema": {
@@ -27,15 +27,34 @@
{
"title": "utxo_ref",
"schema": {
"$ref": "#/definitions/aiken~1transaction~1OutputReference"
"$ref": "#/definitions/cardano~1transaction~1OutputReference"
}
}
],
"compiledCode": "5901ce010000323232323232322322232323232533300930040011533300c300b375400a2a0042c2a66601260060022a66601860166ea8014540085858c024dd50020929998041919192999805980318061baa00113232323253330123015002132325333011300c3012375401a2a666022646600200200c44a66602c00229404c94ccc050cdd7980c980b1baa301900201114a226600600600260320022a6660226016002266e3c00803c5280b0b1bad3012002375c60200022c602600264a66601c6010601e6ea800452f5bded8c026eacc04cc040dd500099191980080099198008009bab3015301630163016301600522533301400114bd6f7b630099191919299980a99b9148900002153330153371e91010000210031005133019337606ea4008dd3000998030030019bab3016003375c60280046030004602c00244a666026002298103d87a800013232323253330143372200e0042a66602866e3c01c0084cdd2a4000660306e980052f5c02980103d87a80001330060060033756602a0066eb8c04c008c05c008c054004dd7180918079baa00337586022002601a6ea800858c03cc040008c038004c028dd50008a4c26cac6e1d2002370e90001bae0015734aae7555cf2ab9f5740ae855d11",
"hash": "4ef9bf69c108d6abd0a5af057a519df56d7fb333de428563810495a0"
"compiledCode": "59018501000032323232323232232225333005323232323253323300b3001300c3754004264646464a66601e600a0022a66602460226ea801c540085854ccc03cc00c00454ccc048c044dd50038a8010b0b18079baa006132323232533301430170021323253330133009301437540162a666026646600200200c44a66603000229404c94ccc058cdd7980d980c1baa301b00201314a226600600600260360022a666026600e002266e3c0080445280b0b1bad3014002375c60240022c602a00264a666020600860226ea800452f5bded8c026eacc054c048dd500099198008009bab3015301630163016301600322533301400114c103d87a80001323232325333015337220140042a66602a66e3c0280084cdd2a4000660326e980052f5c02980103d87a80001330060060033756602c0066eb8c050008c060008c058004dd6180980098079baa007370e90011bae3010300d37540046e1d200016300e300f002300d001300d002300b0013007375400229309b2b1bae0015734aae7555cf2ab9f5740ae855d11",
"hash": "784b2caa5e99b3d37361e3c3d51e7fd39f616025037eee525b73c5da"
},
{
"title": "spend2.backtrace",
"title": "spend.foo.else",
"parameters": [
{
"title": "token_name",
"schema": {
"$ref": "#/definitions/ByteArray"
}
},
{
"title": "utxo_ref",
"schema": {
"$ref": "#/definitions/cardano~1transaction~1OutputReference"
}
}
],
"compiledCode": "59018501000032323232323232232225333005323232323253323300b3001300c3754004264646464a66601e600a0022a66602460226ea801c540085854ccc03cc00c00454ccc048c044dd50038a8010b0b18079baa006132323232533301430170021323253330133009301437540162a666026646600200200c44a66603000229404c94ccc058cdd7980d980c1baa301b00201314a226600600600260360022a666026600e002266e3c0080445280b0b1bad3014002375c60240022c602a00264a666020600860226ea800452f5bded8c026eacc054c048dd500099198008009bab3015301630163016301600322533301400114c103d87a80001323232325333015337220140042a66602a66e3c0280084cdd2a4000660326e980052f5c02980103d87a80001330060060033756602c0066eb8c050008c060008c058004dd6180980098079baa007370e90011bae3010300d37540046e1d200016300e300f002300d001300d002300b0013007375400229309b2b1bae0015734aae7555cf2ab9f5740ae855d11",
"hash": "784b2caa5e99b3d37361e3c3d51e7fd39f616025037eee525b73c5da"
},
{
"title": "spend2.foo.spend",
"datum": {
"title": "_datum",
"schema": {
@@ -48,8 +67,13 @@
"$ref": "#/definitions/Void"
}
},
"compiledCode": "58ac010000323232323232322323223225333007533300730053008375464660020026eb0c034c038c038c028dd5180698051baa00222533300c00114c0103d87a800013232533300b4a2266e9520003300f0024bd70099802002000980800118070008a511614984d9594ccc014c00cc018dd50008a99980418039baa001149858594ccc00cc004c010dd50010a99980318029baa00214985858dc3a4000ae6955ceaab9e5573eae815d0aba201",
"hash": "c58d31e63ad2d807c2188dfb1deafc433fe0f6a867e5cf8df68f068f"
"compiledCode": "58c70100003232323232323225333002323232323253330073370e900118041baa001132323232533300b3370e900018061baa32330010013758602260246024601c6ea8024894ccc0400045300103d87a800013232533300f4a2266e952000330130024bd70099802002000980a00118090008a5116533300a3370e900018059baa0051533300d300c375400a2930b0b18071807801180680098049baa00116300b300c002300a001300a00230080013004375400229309b2b2b9a5573aaae7955cfaba05742ae881",
"hash": "c4700bfdb383c890d2a4c4505d3fc6d4b51e1998c3f33dd83e12ba44"
},
{
"title": "spend2.foo.else",
"compiledCode": "58c70100003232323232323225333002323232323253330073370e900118041baa001132323232533300b3370e900018061baa32330010013758602260246024601c6ea8024894ccc0400045300103d87a800013232533300f4a2266e952000330130024bd70099802002000980a00118090008a5116533300a3370e900018059baa0051533300d300c375400a2930b0b18071807801180680098049baa00116300b300c002300a001300a00230080013004375400229309b2b2b9a5573aaae7955cfaba05742ae881",
"hash": "c4700bfdb383c890d2a4c4505d3fc6d4b51e1998c3f33dd83e12ba44"
}
],
"definitions": {
@@ -70,7 +94,7 @@
}
]
},
"aiken/transaction/OutputReference": {
"cardano/transaction/OutputReference": {
"title": "OutputReference",
"description": "An `OutputReference` is a unique reference to an output on-chain. The `output_index`\n corresponds to the position in the output list of the transaction (identified by its id)\n that produced that output",
"anyOf": [
@@ -81,7 +105,7 @@
"fields": [
{
"title": "transaction_id",
"$ref": "#/definitions/aiken~1transaction~1TransactionId"
"$ref": "#/definitions/ByteArray"
},
{
"title": "output_index",
@@ -91,23 +115,6 @@
}
]
},
"aiken/transaction/TransactionId": {
"title": "TransactionId",
"description": "A unique transaction identifier, as the hash of a transaction body. Note that the transaction id\n isn't a direct hash of the `Transaction` as visible on-chain. Rather, they correspond to hash\n digests of transaction body as they are serialized on the network.",
"anyOf": [
{
"title": "TransactionId",
"dataType": "constructor",
"index": 0,
"fields": [
{
"title": "hash",
"$ref": "#/definitions/ByteArray"
}
]
}
]
},
"spend/Action": {
"title": "Action",
"anyOf": [

View File

@@ -1,15 +1,15 @@
use aiken/collection/dict
use aiken/collection/list.{find, foldr}
use cardano/assets.{PolicyId, add, zero}
use cardano/transaction.{Input, OutputReference, Transaction} as tx
use cardano/transaction/assets.{add, zero}
type Action {
pub type Action {
Mint
Burn
}
validator foo(token_name: ByteArray, utxo_ref: OutputReference) {
mint(rdmr: Action, policy_id: PolicyId, transaction: Transaction) -> Bool {
mint(rdmr: Action, policy_id: PolicyId, transaction: Transaction) {
let Transaction { inputs, mint, .. } = transaction
expect [Pair(asset_name, amount)] =
mint
@@ -24,4 +24,8 @@ validator foo(token_name: ByteArray, utxo_ref: OutputReference) {
Burn -> todo @"burn"
}
}
else(_) {
fail
}
}

View File

@@ -3,15 +3,19 @@ use cardano/transaction.{Output, Transaction}
validator foo {
spend(
_datum: Void,
_datum: Option<Void>,
_redeemer: Void,
_ref: Data,
transaction: Transaction,
) -> Bool {
) {
expect Some(_) = list.find(transaction.outputs, fn(_) { True })
let _ = find_stuff(transaction)
True
}
else(_) {
fail
}
}
fn find_stuff(transaction: Transaction) -> Output {