fix: fixing tests to account for the new stdlib main. Also added test 75 but commented out for now until a fix is merged

This commit is contained in:
microproofs
2024-05-04 14:26:06 -04:00
parent a44ed4c1a8
commit b3d0c3ec04
43 changed files with 150 additions and 87 deletions

View File

@@ -13,4 +13,4 @@ requirements = []
source = "github"
[etags]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1714678411, nanos_since_epoch = 533080000 }, "2a710731e0127ec3e21c6c3962a0254c98602e7428b33fc4fcaa67ab368ce1b1"]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1714846140, nanos_since_epoch = 960222000 }, "5ee55dc5ccf269bb493f4cacb32096f0191a6adb2ef39d62a1f79b8c5a8fcc7f"]

View File

@@ -5,7 +5,7 @@
"plutusVersion": "v2",
"compiler": {
"name": "Aiken",
"version": "v1.0.26-alpha+cdd7f67"
"version": "v1.0.26-alpha+a44ed4c"
}
},
"validators": [
@@ -31,8 +31,25 @@
}
}
],
"compiledCode": "5901bc010000323232323232322322232323225333009323232533300c3007300d3754002264646464a666026602c00426464a666024601a60266ea803854ccc048c8cc004004018894ccc05c004528099299980a99baf301a30173754603400402429444cc00c00c004c06800454ccc048c0300044cdc78010080a501616375a602c602e0046eb8c05400458dd6180a0009991192999808980598091baa00114bd7009bac301630133754002646600200200644a66602a002298103d87a8000132323253330153371e00c6eb8c06800c4cdd2a4000660326e9c0052f5c026600a00a0046eb0c064c068008c064008dd6180b80099198008009bac3014301530153015301500322533301300114bd70099191919299980a19b8f4881000021003133018374e660306ea4008cc060dd3800a5eb80cc01801800cdd6180c180c8019bae301700230170023758602a0026eb8c04cc040dd50019bac3012001300e37540042c60206022004601e00260166ea80045261365632533300830030011533300b300a37540082930b0a99980418010008a99980598051baa00414985858c020dd50019b8748008dc3a40006eb80055cd2ab9d5573caae7d5d02ba15745",
"hash": "3dea1be2920aef692e0bcb894a17a984541682359c8c2b04679fca75"
"compiledCode": "5901cc010000323232323232322322232323225333009323232533300c3007300d3754002264646464a666026602c00426464a666024601a60266ea803854ccc048c8cc004004018894ccc05c004528099299980a99baf301a30173754603400402429444cc00c00c004c06800454ccc048c0300044cdc78010080a501616375a60260046eb8c04400458c050004c94ccc03cc024c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100132330010013756602c602e602e602e602e00a44a66602a002297adef6c6013232323253330163372291100002153330163371e9101000021003100513301a337606ea4008dd3000998030030019bab3017003375c602a0046032004602e00244a666028002298103d87a800013232323253330153372200e0042a66602a66e3c01c0084cdd2a4000660326e980052f5c02980103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00337586024002601c6ea800858c040c044008c03c004c02cdd50008a4c26cac64a66601060060022a66601660146ea8010526161533300830020011533300b300a37540082930b0b18041baa003370e90011b8748000dd7000ab9a5573aaae7955cfaba05742ae89",
"hash": "df50e06b40d42b2c399ebcec4c2a8e51a6b28ef99790d950cc251caa"
},
{
"title": "spend2.backtrace",
"datum": {
"title": "_datum",
"schema": {
"$ref": "#/definitions/Void"
}
},
"redeemer": {
"title": "_redeemer",
"schema": {
"$ref": "#/definitions/Void"
}
},
"compiledCode": "58ad010000323232323232322323223225333007533300730053008375464660020026eb0c034c038c038c028dd5180698051baa00222533300c00114c0103d87a800013232533300b4a2266e9520003300f0024bd70099802002000980800118070008a511614984d958c94ccc018c010c01c00454ccc024c0200045261616375400264a6660086004600a0022a66600e600c0022930b0b1baa002370e90002b9a5573aaae7955cfaba05742ae881",
"hash": "aae5a1fcf239d541c67a7efb006436be41c5ee7f6f4a8fd7b39b97a8"
}
],
"definitions": {
@@ -42,6 +59,17 @@
"Int": {
"dataType": "integer"
},
"Void": {
"title": "Unit",
"description": "The nullary constructor.",
"anyOf": [
{
"dataType": "constructor",
"index": 0,
"fields": []
}
]
},
"aiken/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",

View File

@@ -14,11 +14,11 @@ validator(token_name: ByteArray, utxo_ref: OutputReference) {
let ScriptContext { transaction, purpose } = ctx
expect tx.Mint(policy_id) = purpose
let Transaction { inputs, mint, .. } = transaction
expect [(asset_name, amount)] =
expect [Pair(asset_name, amount)] =
mint
|> value.from_minted_value
|> value.tokens(policy_id)
|> dict.to_list()
|> dict.to_alist()
when rdmr is {
Mint -> {
expect

View File

@@ -1,18 +1,15 @@
// use aiken/list
// use aiken/transaction.{Output, ScriptContext}
use aiken/list
use aiken/transaction.{Output, ScriptContext}
// validator {
// fn backtrace(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
// expect Some(_) =
// list.find(context.transaction.outputs, fn(_) { True })
// let _ =
// find_stuff(context)
// True
// }
// }
validator {
fn backtrace(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
expect Some(_) = list.find(context.transaction.outputs, fn(_) { True })
let _ = find_stuff(context)
True
}
}
// fn find_stuff(context) -> Output {
// expect Some(stuff) =
// list.find(context.transaction.outputs, fn(_) { True })
// stuff
// }
fn find_stuff(context) -> Output {
expect Some(stuff) = list.find(context.transaction.outputs, fn(_) { True })
stuff
}