Move script context e2e tests under a nested 'v2' directory.
And rework scripts to run them in anticipation of new v3 contexts.
This commit is contained in:
parent
cab58e5aab
commit
0dec4dc533
|
@ -13,13 +13,14 @@ for p in ${TESTS[@]}; do
|
|||
exit_codes+=("$?")
|
||||
done
|
||||
|
||||
|
||||
for interaction in $(find script_context/validators -type f); do
|
||||
title=$(basename $interaction)
|
||||
title="${title%.*}"
|
||||
cd script_context && ./test.sh $title
|
||||
exit_codes+=("$?")
|
||||
cd -
|
||||
for lang in $(ls script_context); do
|
||||
for interaction in $(find script_context/$lang/validators -type f); do
|
||||
title=$(basename $interaction)
|
||||
title="${title%.*}"
|
||||
cd script_context/$lang && ./test.sh $title
|
||||
exit_codes+=("$?")
|
||||
cd -
|
||||
done
|
||||
done
|
||||
|
||||
for code in ${exit_codes[@]}; do
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
TESTS=()
|
||||
for lang in $(ls script_context); do
|
||||
for interaction in $(find script_context/$lang/validators -type f); do
|
||||
title=$(basename $interaction)
|
||||
title="${title%.*}"
|
||||
cd script_context/$lang
|
||||
./test.sh $title &
|
||||
TESTS+=("$title,$lang,$!")
|
||||
cd - 1>/dev/null
|
||||
done
|
||||
done
|
||||
|
||||
for args in ${TESTS[@]}; do
|
||||
IFS=',' read title lang pid <<< "${args}"
|
||||
wait $pid
|
||||
code=("$?")
|
||||
log="script_context/$lang/$title.log"
|
||||
if [ $code -ne 0 ]; then
|
||||
echo "=== $title ❌ (code=$code)"
|
||||
cat $log && rm -f $log
|
||||
exit $code
|
||||
else
|
||||
echo "=== $title ✅"
|
||||
cat $log && rm -f $log
|
||||
fi
|
||||
echo ""
|
||||
done
|
|
@ -1,8 +0,0 @@
|
|||
name = 'aiken-lang/acceptance_test_script_context'
|
||||
version = '0.0.0'
|
||||
description = ''
|
||||
|
||||
[[dependencies]]
|
||||
name = 'aiken-lang/stdlib'
|
||||
version = 'main'
|
||||
source = 'github'
|
|
@ -1,92 +0,0 @@
|
|||
{
|
||||
"preamble": {
|
||||
"title": "aiken-lang/acceptance_test_script_context",
|
||||
"version": "0.0.0",
|
||||
"plutusVersion": "v2",
|
||||
"compiler": {
|
||||
"name": "Aiken",
|
||||
"version": "v1.0.31-alpha+6e4a16d"
|
||||
}
|
||||
},
|
||||
"validators": [
|
||||
{
|
||||
"title": "basic.spend",
|
||||
"datum": {
|
||||
"title": "_datum",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "_redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5903280100003232323232323223232232253330073253330083330083375e601a601c601c601c601c601c601c601c601c601c601c601c60146ea8c004c028dd5001260126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460166ea80044c94ccc02ccdd7980218069baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013009375a6006601a6ea8004528180798061baa001163001300b375400626464a6660166464a6660200022c2a6660206026002264a66601c66ebcc018c040dd50009ba6300448202a35ae41c54ccc038cdd7980398081baa30073010375400298122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300c300f3754600c60206ea8c01cc040dd50008a5014a22a66601c66ebcc00cc040dd5000a60103d879800013375e600a60206ea800530103d87a800014a029405280a5030120011637586002601c6ea8c014c038dd50031180898091809000899baf3002300d37546008601a6ea8014dd31800a40a8294094ccc02cc02400452f5bded8c0264646600200297adef6c6022533301100113301233760981014000374c00697adef6c60132323232533301233720910100002133016337609801014000374c00e00a2a66602466e3d22100002133016337609801014000374c00e00626602c66ec0dd48011ba600133006006003375660260066eb8c044008c054008c04c004c8cc0040052f5bded8c044a66602000226602266ec13001014000375000697adef6c60132323232533301133720910100002133015337609801014000375000e00a2a66602266e3d22100002133015337609801014000375000e00626602a66ec0dd48011ba800133006006003375a60240066eb8c040008c050008c0480048c03cc040c040c0400045281180718078008a502300d00114984d9594ccc014c00cc018dd50008a99980418039baa001149858594ccc00cc004c010dd50010a99980318029baa00214985858dc3a4000ae6955ceaab9e5573eae815d0aba201",
|
||||
"hash": "759c4c40f04fe27a816fbe04c522ac00c710762e979ebe09ed276362"
|
||||
},
|
||||
{
|
||||
"title": "deploy.spend",
|
||||
"datum": {
|
||||
"title": "datum",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "_redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5902520100003232323232323232222533300453330043375e00698103d879800013253330053323223253330093370e900018051baa001132533300a3370e900018059baa001132533300e001161325333333013001161616132533301030130031533300d3375e980106d8799f182aff0000413370e600e00c90020a5016375a0022c602000260186ea800458c038c02cdd50008b1919198008008019129998070008a6103d87a8000132323232533300f3372200e0042a66601e66e3c01c0084cdd2a40006602600297ae014c0103d87a80001330060060033010003375c601c004602400460200026e50dd9a6106d8799f182aff00300100122533300a0011480004cdc02400466004004601a0026eacc028c02cc02cc02cc02cc02cc02cc02cc02cc02cc02cc01cdd5180098039baa00213232533300a00116132533300b00116132533300932533300a3375e600a60186ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e601e60206020602060186ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a0601c0062a66601266ebcc038c03cc02cdd5180298059baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff00153330093370e900218051baa3004300b37540022944585280a50300d001300d0013758600260106ea8c008c020dd500191805980618060008a502300a00114a029309b2b2b9a5573aaae7955cfaba05742ae895d201",
|
||||
"hash": "d593ff2c1db29ce9a9a392280895f03d00705203dc4a0ea15870a0b1"
|
||||
},
|
||||
{
|
||||
"title": "mint.mint",
|
||||
"redeemer": {
|
||||
"title": "redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "590300010000323232323232322253330033232323232533233009323232533300f3012002132533300d3005300e3754002266e3c008dd7180918079baa001163008300e37540142c6eb8c040004cc004004cc010c00cdd5980298061baa3007300c37540109110022533300e00114bd70099807980618080009980100118088008a999191980599912999806980298071baa002132533300e3005300f37540022c266e1cdd6980998081baa001483c850c8cc004004c94ccc03cc018c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100130093756601660246ea8010894ccc0500045300103d87a800013232323253330153372200e0042a66602a66e3c01c0084c02ccc064dd3000a5eb80530103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00322533301200114c103d87a800013232323253330133372291103666f6f00002153330133371e910103666f6f000021300933017375000297ae014c0103d87a8000133006006003375a60280066eb8c048008c058008c05000458c01cc034dd5004980418069baa009132323232533300f3007301037540022a66601e66ebc038c044c8cdd8180a800980a980b0009bac3014301137540022600c60046eacc010c044dd5180618089baa00d14a02c64660020026eacc010c044dd5180618089baa00d22533301300114c103d87a80001323253330123375e6026004601c60286ea80404c020cc058dd39980b18098011980b180a00125eb812f5c0266008008002602e004602a002600200244a66602200229000099b8048008cc008008c0500048c044c048c048c048c048c048c048c048c048c048004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300d00114bd6f7b630099191919299980719b910070021533300e3371e00e0042006200a26602466ec0dd48011ba6001330060060033756601e0066eb8c034008c044008c03c0048c02cc030c030c030c0300048c028c02c0048c024004526136565734aae7555cf2ab9f5740ae855d101",
|
||||
"hash": "f557530d177449d0609a60cbe4f48b221c04a6ca7f9f235fcdc8c741"
|
||||
},
|
||||
{
|
||||
"title": "withdrawals.spend",
|
||||
"datum": {
|
||||
"title": "_datum",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "_redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5902300100003232323232323223223225333006323232533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002902a198009bab3002300b3754600660166ea80108cdd79805800a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002900e198009bab3002300b3754600660166ea80108cdd79805800a60126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198061baa3004300c375400a44a66601c002297ae013300f300c3010001330020023011001374e6601a98126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff003300d4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd700a5014a044646600200200644a66601e002298103d87a800013232533300e300500213374a9000198091ba733012300f0023301230100024bd7025eb804cc010010004c04c008c0440048c034c038c038c038c038c038c0380048c0300045261365653330043370e900018029baa00115333007300637540022930b0b299980119b8748000c00cdd50008a99980298021baa001149858595cd2ab9d5573caae7d5d02ba157441",
|
||||
"hash": "06f1f9df4be68a65cd55a921e3e7ec1eb4104906c53e0e564c726faa"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"Data": {
|
||||
"title": "Data",
|
||||
"description": "Any Plutus data."
|
||||
},
|
||||
"Void": {
|
||||
"title": "Unit",
|
||||
"description": "The nullary constructor.",
|
||||
"anyOf": [
|
||||
{
|
||||
"dataType": "constructor",
|
||||
"index": 0,
|
||||
"fields": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
# Script Context Tests
|
||||
# V2 Script Context Tests
|
||||
|
||||
This project contains a few handcrafted validators and transactions whose sole
|
||||
purpose is to test the interpretation of the `ScriptContext` from within an
|
||||
Aiken's validators.
|
||||
This project contains a few handcrafted Plutus V2 validators and transactions
|
||||
whose sole purpose is to test the interpretation of the `ScriptContext` from
|
||||
within an Aiken's validators.
|
||||
|
||||
So validators are meant to work hand-in-hand with an associated context.
|
||||
Because we can't have fully static context (since they contain the validator
|
|
@ -13,4 +13,4 @@ requirements = []
|
|||
source = "github"
|
||||
|
||||
[etags]
|
||||
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723158439, nanos_since_epoch = 196168000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]
|
||||
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723298787, nanos_since_epoch = 494542000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]
|
|
@ -0,0 +1,10 @@
|
|||
name = "script_context/v2"
|
||||
version = "0.0.0"
|
||||
plutus = "v2"
|
||||
license = "Apache-2.0"
|
||||
description = "Aiken contracts for project 'script_context/v2'"
|
||||
|
||||
[[dependencies]]
|
||||
name = "aiken-lang/stdlib"
|
||||
version = "main"
|
||||
source = "github"
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
"preamble": {
|
||||
"title": "script_context/v2",
|
||||
"description": "Aiken contracts for project 'script_context/v2'",
|
||||
"version": "0.0.0",
|
||||
"plutusVersion": "v2",
|
||||
"compiler": {
|
||||
"name": "Aiken",
|
||||
"version": "v1.0.31-alpha+4645fd3"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"validators": [
|
||||
{
|
||||
"title": "basic.spend",
|
||||
"datum": {
|
||||
"title": "_datum",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "_redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"compiledCode": "590340010000323232323232323223232232253330073253330083330083375e601a601c601c601c601c601c601c601c601c601c601c601c60146ea8c004c028dd5001260126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460166ea80044c94ccc02ccdd7980218069baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013009375a6006601a6ea8004528180798061baa001163001300b375400626464a6660166464a6660200022c2a6660206026002264a66601c66ebcc018c040dd50009ba6300448202a35ae41c54ccc038cdd7980398081baa30073010375400298122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300c300f3754600c60206ea8c01cc040dd50008a5014a22a66601c66ebcc00cc040dd5000a60103d879800013375e600a60206ea800530103d87a800014a029405280a5030120011637586002601c6ea8c014c038dd50031180898091809000899baf3002300d37546008601a6ea8014dd31800a40a8294094ccc02cc02400452f5bded8c0264646600200297adef6c6022533301100113301233760981014000374c00697adef6c60132323232533301233720910100002133016337609801014000374c00e00a2a66602466e3d22100002133016337609801014000374c00e00626602c66ec0dd48011ba600133006006003375660260066eb8c044008c054008c04c004c8cc0040052f5bded8c044a66602000226602266ec13001014000375000697adef6c60132323232533301133720910100002133015337609801014000375000e00a2a66602266e3d22100002133015337609801014000375000e00626602a66ec0dd48011ba800133006006003375a60240066eb8c040008c050008c0480048c03cc040c040c0400045281180718078008a502300d00114984d9594cccccc03000454ccc014c00cc018dd50008a99980418039baa00114985858585858594cccccc02800854ccc00cc004c010dd50010a99980318029baa0021498585858585858dc3a4000ae6955ceaab9e5573eae815d0aba25749",
|
||||
"hash": "b4722fea910f2527073750f2d145f259ef3d8fec59b726abfd36a0b1"
|
||||
},
|
||||
{
|
||||
"title": "deploy.spend",
|
||||
"datum": {
|
||||
"title": "datum",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "_redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5902620100003232323232323232222533300453330043375e00698103d879800013253330053323223253330093370e900018051baa0011323232533300c3375e980106d8799f182aff0000213370e600c00a90020a50533300b3370e900018061baa001132533300f0011613253330103013002149858c94cccccc0500045858584dd68008b180880098069baa001165333333011001100116161616300e300b37540022c64646600200200644a66601c002298103d87a8000132323232533300f3372200e0042a66601e66e3c01c0084cdd2a40006602600297ae014c0103d87a80001330060060033010003375c601c004602400460200026e50dd9a6106d8799f182aff00300100122533300a0011480004cdc02400466004004601a0026eacc028c02cc02cc02cc02cc02cc02cc02cc02cc02cc02cc01cdd5180098039baa00213232533300a00116132533300b00116132533300932533300a3375e600a60186ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e601e60206020602060186ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a0601c0062a66601266ebcc038c03cc02cdd5180298059baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff00153330093370e900218051baa3004300b37540022944585280a50300d001300d0013758600260106ea8c008c020dd500191805980618060008a502300a00114a029309b2b2b9a5573aaae7955cfaba05742ae895d201",
|
||||
"hash": "afe28fb3a5ca0c66aa19eb0ea419c60e20ea6e3c82875f74db76d32e"
|
||||
},
|
||||
{
|
||||
"title": "mint.mint",
|
||||
"redeemer": {
|
||||
"title": "redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5903070100003232323232323222533300332323232325332330093232533300e00116132533300f3012002132533300d3005300e3754002266e3c008dd7180918079baa001163008300e37540142c6eb8c040004cc004004cc010c00cdd5980298061baa3007300c375401091010022533300e00114bd70099807980618080009980100118088008a999191980599912999806980298071baa002132533300e3005300f37540022c266e1cdd6980998081baa001483c850c8cc004004c94ccc03cc018c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100130093756601660246ea8010894ccc0500045300103d87a800013232323253330153372200e0042a66602a66e3c01c0084c02ccc064dd3000a5eb80530103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00322533301200114c103d87a800013232323253330133372291103666f6f00002153330133371e910103666f6f000021300933017375000297ae014c0103d87a8000133006006003375a60280066eb8c048008c058008c05000458c01cc034dd5004980418069baa009132323232533300f3007301037540022a66601e66ebc038c044c8cdd8180a800980a980b0009bac3014301137540022600c60046eacc010c044dd5180618089baa00d14a02c64660020026eacc010c044dd5180618089baa00d22533301300114c103d87a80001323253330123375e6026004601c60286ea80404c020cc058dd39980b18098011980b180a00125eb812f5c0266008008002602e004602a002600200244a66602200229000099b8048008cc008008c0500048c044c048c048c048c048c048c048c048c048c048004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300d00114bd6f7b630099191919299980719b910070021533300e3371e00e0042006200a26602466ec0dd48011ba6001330060060033756601e0066eb8c034008c044008c03c0048c02cc030c030c030c0300048c028c02c0048c024004526136565734aae7555cf2ab9f5740ae855d101",
|
||||
"hash": "cae7d307b37aaa4d2500641c8c6e823ea313aa43fb6dbc9ed72b7228"
|
||||
},
|
||||
{
|
||||
"title": "withdrawals.spend",
|
||||
"datum": {
|
||||
"title": "_datum",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"redeemer": {
|
||||
"title": "_redeemer",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"compiledCode": "590249010000323232323232323223223225333006323232533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002902a198009bab3002300b3754600660166ea80108cdd79805800a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002900e198009bab3002300b3754600660166ea80108cdd79805800a60126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198061baa3004300c375400a44a66601c002297ae013300f300c3010001330020023011001374e6601a98126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff003300d4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd700a5014a044646600200200644a66601e002298103d87a800013232533300e300500213374a9000198091ba733012300f0023301230100024bd7025eb804cc010010004c04c008c0440048c034c038c038c038c038c038c0380048c03000452613656533333300b001153330043370e900018029baa00115333007300637540022930b0b0b0b0b0b29999998048008a99980119b8748000c00cdd50008a99980298021baa00114985858585858595cd2ab9d5573caae7d5d02ba15744ae901",
|
||||
"hash": "45d4f36c2dcf9831e37995edb428bed6928a55b39b401c1dd5ab7886"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"Data": {
|
||||
"title": "Data",
|
||||
"description": "Any Plutus data."
|
||||
},
|
||||
"Void": {
|
||||
"title": "Unit",
|
||||
"description": "The nullary constructor.",
|
||||
"anyOf": [
|
||||
{
|
||||
"dataType": "constructor",
|
||||
"index": 0,
|
||||
"fields": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
cargo run -r --quiet -- build
|
||||
cargo run -r --quiet -- build 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
exit $?
|
||||
fi
|
||||
|
@ -39,4 +39,4 @@ cp ctx/$TITLE/inputs.cbor.template ctx/$TITLE/inputs.cbor
|
|||
sed "s/{{ VALIDATOR_HASH }}/$VALIDATOR_HASH/" ctx/$TITLE/outputs.cbor.template > ctx/$TITLE/outputs.cbor
|
||||
sed "s/{{ VALIDATOR }}/$VALIDATOR/" ctx/$TITLE/tx.cbor.template | sed "s/{{ VALIDATOR_HASH }}/$VALIDATOR_HASH/" > ctx/$TITLE/tx.cbor
|
||||
|
||||
cargo run -r --quiet -- tx simulate ctx/$TITLE/tx.cbor ctx/$TITLE/inputs.cbor ctx/$TITLE/outputs.cbor
|
||||
cargo run -r --quiet -- tx simulate 1>$TITLE.log 2>&1 ctx/$TITLE/tx.cbor ctx/$TITLE/inputs.cbor ctx/$TITLE/outputs.cbor
|
Loading…
Reference in New Issue