Fix script context translations for withdrawals and validity intervals.
This commit is contained in:
@@ -8,23 +8,22 @@ for lang in $(ls script_context); do
|
||||
title=$(basename $interaction)
|
||||
title="${title%.*}"
|
||||
cd script_context/$lang
|
||||
./test.sh $title "$AIKEN" &
|
||||
TESTS+=("$title,$lang,$!")
|
||||
echo "running $lang/$title..."
|
||||
./test.sh $title "$AIKEN"
|
||||
TESTS+=("$title,$lang,$?")
|
||||
cd - 1>/dev/null
|
||||
done
|
||||
done
|
||||
|
||||
for args in ${TESTS[@]}; do
|
||||
IFS=',' read title lang pid <<< "${args}"
|
||||
wait $pid
|
||||
code=("$?")
|
||||
IFS=',' read title lang code <<< "${args}"
|
||||
log="script_context/$lang/$title.log"
|
||||
if [ $code -ne 0 ]; then
|
||||
echo "=== $title ❌ (code=$code)"
|
||||
echo "=== $lang/$title ❌ (code=$code)"
|
||||
cat $log && rm -f $log
|
||||
exit $code
|
||||
else
|
||||
echo "=== $title ✅"
|
||||
echo "=== $lang/$title ✅"
|
||||
cat $log && rm -f $log
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -13,4 +13,4 @@ requirements = []
|
||||
source = "github"
|
||||
|
||||
[etags]
|
||||
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723324201, nanos_since_epoch = 743234000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]
|
||||
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723583483, nanos_since_epoch = 18378000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]
|
||||
|
||||
@@ -1 +1 @@
|
||||
84A80081825820000000000000000000000000000000000000000000000000000000000000000000018182581D60111111111111111111111111111111111111111111111111111111111A3B9ACA0002182A05A2581DE022222222222222222222222222222222222222222222222222222222182A581DF0AFDDC16C18E7D8DE379FB9AAD39B3D1B5AFD27603E5EBAC818432A720E0B5820FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D818258200000000000000000000000000000000000000000000000000000000000000000001082581D60000000000000000000000000000000000000000000000000000000001A3B9ACA001101A20582840000D87980821A000F42401A05F5E100840301D87980821A000F42401A05F5E1000682{{ VALIDATOR }}583D583B010000323232323232322253330054A22930B180080091129998030010A4C26600A6002600E0046660060066010004002AE695CDAAB9F5742AE881F5F6
|
||||
84A80081825820000000000000000000000000000000000000000000000000000000000000000000018182581D60111111111111111111111111111111111111111111111111111111111A3B9ACA0002182A05A2581DE022222222222222222222222222222222222222222222222222222222182A581DF0AFDDC16C18E7D8DE379FB9AAD39B3D1B5AFD27603E5EBAC818432A720E0B5820FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D818258200000000000000000000000000000000000000000000000000000000000000000001082581D60000000000000000000000000000000000000000000000000000000001A3B9ACA001101A20582840000D87980821A000F42401A05F5E100840300D87980821A000F42401A05F5E1000682{{ VALIDATOR }}583D583B010000323232323232322253330054A22930B180080091129998030010A4C26600A6002600E0046660060066010004002AE695CDAAB9F5742AE881F5F6
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
{ 5:
|
||||
[ [0, 0, 121([]), [1000000, 100000000]]
|
||||
, [3, 1, 121([]), [1000000, 100000000]]
|
||||
, [3, 0, 121([]), [1000000, 100000000]]
|
||||
]
|
||||
|
||||
, 6: [ {{ VALIDATOR }}, h'583b010000323232323232322253330054a22930b180080091129998030010a4c26600a6002600e0046660060066010004002ae695cdaab9f5742ae881' ]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"plutusVersion": "v2",
|
||||
"compiler": {
|
||||
"name": "Aiken",
|
||||
"version": "v1.0.31-alpha+81c0152"
|
||||
"version": "v1.0.31-alpha+fe5c565"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
@@ -25,8 +25,8 @@
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5903280100003232323232323223232232253330073253330083330083375e601a601c601c601c601c601c601c601c601c601c601c601c60146ea8c004c028dd5001260126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460166ea80044c94ccc02ccdd7980218069baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013009375a6006601a6ea8004528180798061baa001163001300b375400626464a6660166464a6660200022c2a6660206026002264a66601c66ebcc018c040dd50009ba6300448202a35ae41c54ccc038cdd7980398081baa30073010375400298122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300c300f3754600c60206ea8c01cc040dd50008a5014a22a66601c66ebcc00cc040dd5000a60103d879800013375e600a60206ea800530103d87a800014a029405280a5030120011637586002601c6ea8c014c038dd50031180898091809000899baf3002300d37546008601a6ea8014dd31800a40a8294094ccc02cc02400452f5bded8c0264646600200297adef6c6022533301100113301233760981014000374c00697adef6c60132323232533301233720910100002133016337609801014000374c00e00a2a66602466e3d22100002133016337609801014000374c00e00626602c66ec0dd48011ba600133006006003375660260066eb8c044008c054008c04c004c8cc0040052f5bded8c044a66602000226602266ec13001014000375000697adef6c60132323232533301133720910100002133015337609801014000375000e00a2a66602266e3d22100002133015337609801014000375000e00626602a66ec0dd48011ba800133006006003375a60240066eb8c040008c050008c0480048c03cc040c040c0400045281180718078008a502300d00114984d9594ccc014c00cc018dd50008a99980418039baa001149858594ccc00cc004c010dd50010a99980318029baa00214985858dc3a4000ae6955ceaab9e5573eae815d0aba201",
|
||||
"hash": "759c4c40f04fe27a816fbe04c522ac00c710762e979ebe09ed276362"
|
||||
"compiledCode": "5903fb01000032323232323232323232322533333300c00115332330053001300737540042a66601260106ea8008494cccccc03800454ccc018c008c020dd50008a99980518049baa0011253330073253330083330083375e601c601e601e601e601e601e601e601e601e601e601e601e60166ea8c004c02cdd500126126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460186ea80044c94ccc02ccdd7980218071baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013007375a6006601c6ea8004528180818069baa001153300b4911c73637269707420707572706f73652069736e277420275370656e642700163001300c375400626464a6660166464a6660220022a6601c92011c756e6578706563746564206e756d626572206f66206f7574707574730016153330113014001132533300e3375e600c60226ea8004dd318022410151ad720e2a66601c66ebcc01cc044dd5180398089baa0014c0122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300a30103754600c60226ea8c01cc044dd50008a5014a22a66601c66ebcc00cc044dd5000a60103d879800013375e600a60226ea800530103d87a800014a029405280a503013001153300e4911c756e6578706563746564206e756d626572206f66206f757470757473001637586002601e6ea8c014c03cdd50031180918099809800899baf3002300e37546008601c6ea8014dd31800a40a8294094ccc02cc01c00452f5bded8c0264646600200297adef6c6022533301200113301333760981014000374c00697adef6c60132323232533301233720910100002133017337609801014000374c00e00a2a66602466e3d22100002133017337609801014000374c00e00626602e66ec0dd48011ba600133006006003375660280066eb8c048008c058008c050004c8cc0040052f5bded8c044a66602200226602466ec13001014000375000697adef6c60132323232533301133720910100002133016337609801014000375000e00a2a66602266e3d22100002133016337609801014000375000e00626602c66ec0dd48011ba800133006006003375a60260066eb8c044008c054008c04c0048c040c044c044c0440045281180798080008a502300e001149854cc0212411856616c696461746f722072657475726e65642066616c73650013656004004004004004004004370e90000018018018018018a99801a4810f5f72656465656d65723a20566f6964001615330024910c5f646174756d3a20566f696400165734ae7155ceaab9e5573eae815d0aba257481",
|
||||
"hash": "1c6c13a9a56cbcb9ed18c312c9e9e9996b0545b7230b7cf81cbe012d"
|
||||
},
|
||||
{
|
||||
"title": "deploy.spend",
|
||||
@@ -42,8 +42,8 @@
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5902520100003232323232323232222533300453330043375e00698103d879800013253330053323223253330093370e900018051baa001132533300a3370e900018059baa001132533300e001161325333333013001161616132533301030130031533300d3375e980106d8799f182aff0000413370e600e00c90020a5016375a0022c602000260186ea800458c038c02cdd50008b1919198008008019129998070008a6103d87a8000132323232533300f3372200e0042a66601e66e3c01c0084cdd2a40006602600297ae014c0103d87a80001330060060033010003375c601c004602400460200026e50dd9a6106d8799f182aff00300100122533300a0011480004cdc02400466004004601a0026eacc028c02cc02cc02cc02cc02cc02cc02cc02cc02cc02cc01cdd5180098039baa00213232533300a00116132533300b00116132533300932533300a3375e600a60186ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e601e60206020602060186ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a0601c0062a66601266ebcc038c03cc02cdd5180298059baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff00153330093370e900218051baa3004300b37540022944585280a50300d001300d0013758600260106ea8c008c020dd500191805980618060008a502300a00114a029309b2b2b9a5573aaae7955cfaba05742ae895d201",
|
||||
"hash": "d593ff2c1db29ce9a9a392280895f03d00705203dc4a0ea15870a0b1"
|
||||
"compiledCode": "59039801000032323232323232323232222533300553330053375e00698103d8798000132533300633232232533300a3370e900018061baa00113253333330130011533300b3370e900018069baa001132533301000100b132533333301500100c00c00c132533301230150031533300e3375e980106d8799f182aff0000413370e600e00c90020a5000d375a0020186024002601c6ea8004028028028028028c040c034dd50008a99805a495865787065637420536f6d6528646174756d29203d0a20202020646963742e67657428646174756d732c20626c616b6532625f323536286275696c74696e2e73657269616c6973655f64617461286d795f646174756d292929001632323300100100322533301000114c0103d87a800013232323253330103372200e0042a66602066e3c01c0084cdd2a40006602a00297ae014c0103d87a80001330060060033012003375c6020004602800460240026e50dd9a6106d8799f182aff00300100122533300c0011480004cdc02400466004004601e0026eacc030c034c034c034c034c034c034c034c034c034c034c024dd5180098049baa00213232533300c00115330094901316578706563746564207472616e73616374696f6e20746f206861766520286174206c65617374292032206f7574707574730016132533300d001153300a4901316578706563746564207472616e73616374696f6e20746f206861766520286174206c65617374292032206f7574707574730016132533300a32533300b3375e600a601c6ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e6022602460246024601c6ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a060200062a66601466ebcc040c044c034dd5180298069baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff001533300a3370e900218061baa3004300d3754002294454cc02d24115657870656374656420696e6c696e6520646174756d001614a02940c03c004c03c004dd6180098051baa3002300a37540064601a601c601c00229408c0300045280a4c2a6600c92011856616c696461746f722072657475726e65642066616c73650013656153300249011d65787065637420646174756d3a204d79446174756d203d20646174756d00165734ae7155ceaab9e5573eae815d0aba257481",
|
||||
"hash": "66a5272eb58aed0097083185588ef1e8b3888a3bc2e03c061f09c898"
|
||||
},
|
||||
{
|
||||
"title": "mint.mint",
|
||||
@@ -53,8 +53,8 @@
|
||||
"$ref": "#/definitions/Data"
|
||||
}
|
||||
},
|
||||
"compiledCode": "590300010000323232323232322253330033232323232533233009323232533300f3012002132533300d3005300e3754002266e3c008dd7180918079baa001163008300e37540142c6eb8c040004cc004004cc010c00cdd5980298061baa3007300c37540109110022533300e00114bd70099807980618080009980100118088008a999191980599912999806980298071baa002132533300e3005300f37540022c266e1cdd6980998081baa001483c850c8cc004004c94ccc03cc018c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100130093756601660246ea8010894ccc0500045300103d87a800013232323253330153372200e0042a66602a66e3c01c0084c02ccc064dd3000a5eb80530103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00322533301200114c103d87a800013232323253330133372291103666f6f00002153330133371e910103666f6f000021300933017375000297ae014c0103d87a8000133006006003375a60280066eb8c048008c058008c05000458c01cc034dd5004980418069baa009132323232533300f3007301037540022a66601e66ebc038c044c8cdd8180a800980a980b0009bac3014301137540022600c60046eacc010c044dd5180618089baa00d14a02c64660020026eacc010c044dd5180618089baa00d22533301300114c103d87a80001323253330123375e6026004601c60286ea80404c020cc058dd39980b18098011980b180a00125eb812f5c0266008008002602e004602a002600200244a66602200229000099b8048008cc008008c0500048c044c048c048c048c048c048c048c048c048c048004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300d00114bd6f7b630099191919299980719b910070021533300e3371e00e0042006200a26602466ec0dd48011ba6001330060060033756601e0066eb8c034008c044008c03c0048c02cc030c030c030c0300048c028c02c0048c024004526136565734aae7555cf2ab9f5740ae855d101",
|
||||
"hash": "f557530d177449d0609a60cbe4f48b221c04a6ca7f9f235fcdc8c741"
|
||||
"compiledCode": "590496010000323232323232323232225333004323232323253323300a3232533301000100b13253330113014002132533300e300530103754002266e3c008dd7180a18089baa001153300f49124657870656374204d696e7428706f6c6963795f696429203d206374782e707572706f736500163008301037540140186eb8c048004cc004004cc010c00cdd5980298071baa3007300e375401091010022533301000114bd70099808980718090009980100118098008a999191980619912999807180298081baa002132533300f3005301137540022a6602092010f746f6b656e206e6f7420666f756e64001613370e6eb4c054c048dd5000a41e428646600200264a666020600c60246ea800452f5bded8c026eacc058c04cdd500099191980080098049bab300b3014375400844a66602c002298103d87a800013232323253330163372200e0042a66602c66e3c01c0084c02ccc06cdd3000a5eb80530103d87a8000133006006003375660300066eb8c058008c068008c060004dd7180a98091baa00322533301400114c103d87a800013232323253330143372291103666f6f00002153330143371e910103666f6f000021300933019375000297ae014c0103d87a8000133006006003375a602c0066eb8c050008c060008c05800454cc03d24120657870656374204d696e7428706f6c6963795f696429203d20707572706f736500163007300f37540126010601e6ea80244c8c8c8c94ccc040c01cc048dd50008a99980819baf00e30133233760602e002602e60300026eb0c058c04cdd50008980318011bab300430133754601860266ea80345280a99808a496b65787065637420536f6d652850616972285f2c2072656465656d65722929203d0a202020206c6973742e66696e64286374782e7472616e73616374696f6e2e72656465656d6572732c20666e286b7629207b206b762e317374203d3d206374782e707572706f7365207d29001632330010013756600860266ea8c030c04cdd500691299980a8008a6103d87a80001323253330133375e602a004601c602c6ea80404c020cc060dd39980c180a8011980c180b00125eb812f5c02660080080026032004602e002600200244a66602600229000099b8048008cc008008c0580048c04cc050c050c050c050c050c050c050c050c050004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300f00114bd6f7b630099191919299980799b910070021533300f3371e00e0042006200a26602866ec0dd48011ba600133006006003375660220066eb8c03c008c04c008c0440048c034c038c038c038c0380048c030c0340048c02c00452615330054911856616c696461746f722072657475726e65642066616c736500136561533002490189657870656374205b6d795f706f6c6963795f69645d203d0a202020206374782e7472616e73616374696f6e2e6d696e740a2020202020207c3e2076616c75652e66726f6d5f6d696e7465645f76616c75650a2020202020207c3e2076616c75652e776974686f75745f6c6f76656c6163650a2020202020207c3e2076616c75652e706f6c696369657300165734ae7155ceaab9e5573eae815d0aba21",
|
||||
"hash": "8372367de2b0391b1bec0489dc72cb65de1a791f4e9712b9149d6392"
|
||||
},
|
||||
{
|
||||
"title": "withdrawals.spend",
|
||||
@@ -70,8 +70,8 @@
|
||||
"$ref": "#/definitions/Void"
|
||||
}
|
||||
},
|
||||
"compiledCode": "5902300100003232323232323223223225333006323232533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002902a198009bab3002300b3754600660166ea80108cdd79805800a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002900e198009bab3002300b3754600660166ea80108cdd79805800a60126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198061baa3004300c375400a44a66601c002297ae013300f300c3010001330020023011001374e6601a98126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff003300d4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd700a5014a044646600200200644a66601e002298103d87a800013232533300e300500213374a9000198091ba733012300f0023301230100024bd7025eb804cc010010004c04c008c0440048c034c038c038c038c038c038c0380048c0300045261365653330043370e900018029baa00115333007300637540022930b0b299980119b8748000c00cdd50008a99980298021baa001149858595cd2ab9d5573caae7d5d02ba157441",
|
||||
"hash": "06f1f9df4be68a65cd55a921e3e7ec1eb4104906c53e0e564c726faa"
|
||||
"compiledCode": "5902de01000032323232323232323232322533333300c001153330043370e900018031baa001153330083007375400224a66666601a0022a66600a66e1d2000300737540022a66601260106ea8004494ccc018c8c8c94ccc024c94ccc028cdc3a400460186ea800454cc02d2411c616c6963652773207769746864726177616c206e6f7420666f756e64001613370e6eb4c034c8cdd81808800980898090009bac3010300d3754002902a198009bab3002300c3754600660186ea80108cdd79806000a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118061baa001153300b49011a626f622773207769746864726177616c206e6f7420666f756e64001613370e6eb4c034c8cdd81808800980898090009bac3010300d3754002900e198009bab3002300c3754600660186ea80108cdd79806000a6126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198069baa3004300d375400a44a66601e002297ae0133010300d3011001330020023012001374e6601c98126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff003300e4c126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff004bd700a5014a044646600200200644a666020002298103d87a800013232533300e300500213374a9000198099ba73301330100023301330110024bd7025eb804cc010010004c050008c0480048c038c03cc03cc03cc03cc03cc03c0048c03400452615330074911856616c696461746f722072657475726e65642066616c73650013656003003003003003003003003003003003003153300349010f5f72656465656d65723a20566f6964001615330024910c5f646174756d3a20566f696400165734ae7155ceaab9e5573eae815d0aba257481",
|
||||
"hash": "4f44caf93e36ee884b6d03b1e1c93bf8cda516fd39f7113823508571"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
|
||||
@@ -26,7 +26,7 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$AIKEN build 2>/dev/null
|
||||
$AIKEN build --filter-traces all -t verbose
|
||||
if [ $? -ne 0 ]; then
|
||||
exit $?
|
||||
fi
|
||||
@@ -41,4 +41,7 @@ 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
|
||||
|
||||
$AIKEN tx simulate 1>$TITLE.log 2>&1 ctx/$TITLE/tx.cbor ctx/$TITLE/inputs.cbor ctx/$TITLE/outputs.cbor
|
||||
$AIKEN tx simulate 1>$TITLE.log 2>&1 \
|
||||
ctx/$TITLE/tx.cbor \
|
||||
ctx/$TITLE/inputs.cbor \
|
||||
ctx/$TITLE/outputs.cbor
|
||||
|
||||
@@ -31,7 +31,7 @@ validator {
|
||||
None -> fail @"bob's withdrawal not found"
|
||||
Some(value) -> value.2nd == 14
|
||||
},
|
||||
list.map(ctx.transaction.withdrawals, fn(kv) { kv.1st }) == [alice, bob],
|
||||
list.map(ctx.transaction.withdrawals, fn(kv) { kv.1st }) == [bob, alice],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ for convenience. The test still assumes a few things. For any
|
||||
- Purpose
|
||||
- [x] spend
|
||||
- [x] mint
|
||||
- [ ] withdraw
|
||||
- [x] withdraw
|
||||
- [x] publish
|
||||
- [x] voting
|
||||
- [x] proposing
|
||||
@@ -79,11 +79,11 @@ for convenience. The test still assumes a few things. For any
|
||||
- [x] Retire CC
|
||||
- withdrawals
|
||||
- [x] none
|
||||
- [ ] some
|
||||
- [ ] validity range
|
||||
- [x] some
|
||||
- [x] validity range
|
||||
- extra signatories
|
||||
- [x] none
|
||||
- [ ] some
|
||||
- [x] some
|
||||
- [x] redeemers
|
||||
- [x] datums
|
||||
- votes
|
||||
@@ -102,10 +102,10 @@ for convenience. The test still assumes a few things. For any
|
||||
- Address
|
||||
- [x] type-0 (key | key)
|
||||
- [x] type-1 (script | key)
|
||||
- [ ] type-2 (key | script)
|
||||
- [ ] type-3 (script | script)
|
||||
- [ ] type-4 (key | ptr)
|
||||
- [ ] type-5 (script | ptr)
|
||||
- [x] type-2 (key | script)
|
||||
- [x] type-3 (script | script)
|
||||
- [x] type-4 (key | ptr)
|
||||
- [x] type-5 (script | ptr)
|
||||
- [x] type-6 (key | ø)
|
||||
- [x] type-7 (key | ø)
|
||||
|
||||
@@ -205,5 +205,5 @@ for convenience. The test still assumes a few things. For any
|
||||
- [x] no confidence
|
||||
|
||||
- Boundary
|
||||
- [ ] closed
|
||||
- [ ] open
|
||||
- [x] closed
|
||||
- [x] open
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
# You typically do not need to edit this file
|
||||
|
||||
[[requirements]]
|
||||
name = "logicalmechanism/stdlib"
|
||||
version = "plutus-v3"
|
||||
name = "aiken-lang/stdlib"
|
||||
version = "v2"
|
||||
source = "github"
|
||||
|
||||
[[packages]]
|
||||
name = "logicalmechanism/stdlib"
|
||||
version = "plutus-v3"
|
||||
name = "aiken-lang/stdlib"
|
||||
version = "v2"
|
||||
requirements = []
|
||||
source = "github"
|
||||
|
||||
[etags]
|
||||
"logicalmechanism/stdlib@plutus-v3" = [{ secs_since_epoch = 1723394635, nanos_since_epoch = 36770000 }, "097396ab7dedd5e38c558f35b2fb34a2d0f058bb0da0635949f5fcbb36f1310e"]
|
||||
"aiken-lang/stdlib@v2" = [{ secs_since_epoch = 1723583491, nanos_since_epoch = 208977000 }, "cdbbce58b61deb385e7ea787a2e0fc2dc8fe94db9999e0e6275bc9c70e5796be"]
|
||||
|
||||
@@ -3,9 +3,9 @@ version = "0.0.0"
|
||||
compiler = "v1.0.31-alpha"
|
||||
plutus = "v3"
|
||||
license = "Apache-2.0"
|
||||
description = "Aiken contracts for project 'script_context/v3'"
|
||||
description = "End-to-end testing of standard lib script context, for Plutus v3"
|
||||
|
||||
[[dependencies]]
|
||||
name = "logicalmechanism/stdlib"
|
||||
version = "plutus-v3"
|
||||
name = "aiken-lang/stdlib"
|
||||
version = "v2"
|
||||
source = "github"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{ 0: h'30{{ withdraw.spend.hash }}{{ withdraw.spend.hash }}'
|
||||
, 1: 1000000
|
||||
, 2: [1, 24(h'd87980')]
|
||||
, 3: 24(h'8203{{ withdraw.spend.cbor }}')
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{ 0:
|
||||
[ [h'0000000000000000000000000000000000000000000000000000000000000000', 0]
|
||||
]
|
||||
|
||||
, 1:
|
||||
[ { 0: h'200000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111'
|
||||
, 1: 1000000
|
||||
}
|
||||
|
||||
, { 0: h'40000000000000000000000000000000000000000000000000000000008198bd431b03'
|
||||
, 1: 1000000
|
||||
}
|
||||
|
||||
, { 0: h'50111111111111111111111111111111111111111111111111111111118198bd431b03'
|
||||
, 1: 1000000
|
||||
}
|
||||
]
|
||||
|
||||
, 2: 42
|
||||
|
||||
, 3: 4492801
|
||||
|
||||
, 5:
|
||||
{ h'E000000000000000000000000000000000000000000000000000000000': 14
|
||||
, h'F0{{ withdraw.withdraw.hash }}': 0
|
||||
}
|
||||
|
||||
, 14:
|
||||
[ h'00000000000000000000000000000000000000000000000000000000'
|
||||
]
|
||||
},
|
||||
|
||||
{ 5: [ [0, 0, 122([121([])]), [1000000, 100000000]]
|
||||
, [3, 0, 121([]), [1000000, 100000000]]
|
||||
]
|
||||
},
|
||||
|
||||
true,
|
||||
|
||||
null
|
||||
]
|
||||
File diff suppressed because one or more lines are too long
@@ -45,9 +45,10 @@ for ITEM in ${VALIDATORS[@]}; do
|
||||
VALIDATOR_NAME=$(echo $ITEM | jq -r .title)
|
||||
VALIDATOR_HASH=$(echo $ITEM | jq -r .hash)
|
||||
VALIDATOR=$(echo $ITEM | jq -r .compiledCode)
|
||||
VALIDATOR_CBOR=$(echo "h'$VALIDATOR'" | cbor-diag --to hex --from diag)
|
||||
|
||||
RESOLVED_INPUTS=$(echo $RESOLVED_INPUTS \
|
||||
| sed "s/{{ $VALIDATOR_NAME.cbor }}/$VALIDATOR/g" \
|
||||
| sed "s/{{ $VALIDATOR_NAME.cbor }}/$VALIDATOR_CBOR/g" \
|
||||
| sed "s/{{ $VALIDATOR_NAME.hash }}/$VALIDATOR_HASH/g")
|
||||
|
||||
TRANSACTION=$(echo $TRANSACTION \
|
||||
@@ -59,9 +60,7 @@ echo $RESOLVED_INPUTS | cbor-diag --to hex --from diag > ctx/$TITLE/resolved_inp
|
||||
|
||||
echo $TRANSACTION | cbor-diag --to hex --from diag > ctx/$TITLE/tx.cbor
|
||||
|
||||
# ogmios inspect transaction $(cat ctx/$TITLE/tx.cbor) | jq ".votes"
|
||||
|
||||
$AIKEN tx simulate \
|
||||
$AIKEN tx simulate 1>$TITLE.log 2>&1 \
|
||||
ctx/$TITLE/tx.cbor \
|
||||
ctx/inputs.cbor \
|
||||
ctx/$TITLE/resolved_inputs.cbor
|
||||
|
||||
@@ -16,7 +16,7 @@ const void_hash =
|
||||
#"923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"
|
||||
|
||||
validator {
|
||||
fn mint_1(_tmp2: Void, ctx: ScriptContext) {
|
||||
fn mint_1(_tmp2: Data, ctx: ScriptContext) {
|
||||
let our_policy_id = assert_script_info(ctx.info)
|
||||
let other_policy_id = assert_redeemers(ctx.transaction.redeemers)
|
||||
assert_outputs(ctx.transaction.outputs, our_policy_id, other_policy_id)
|
||||
|
||||
@@ -22,7 +22,7 @@ const only9s =
|
||||
#"9999999999999999999999999999999999999999999999999999999999999999"
|
||||
|
||||
validator {
|
||||
fn script(_tmp0: Void, ctx: ScriptContext) {
|
||||
fn script(_tmp0: Data, ctx: ScriptContext) {
|
||||
assert_redeemer(ctx.redeemer)
|
||||
|
||||
let votes = ctx.transaction.votes
|
||||
@@ -35,18 +35,14 @@ validator {
|
||||
|
||||
expect
|
||||
Some(
|
||||
Pair(
|
||||
ConstitutionalCommitteeMember(VerificationKey(only0s)),
|
||||
[
|
||||
Pair(
|
||||
GovernanceActionId {
|
||||
transaction: only9s,
|
||||
proposal_procedure: 152,
|
||||
},
|
||||
No,
|
||||
),
|
||||
],
|
||||
),
|
||||
Pair(ConstitutionalCommitteeMember(VerificationKey(only0s)),
|
||||
[
|
||||
Pair(GovernanceActionId {
|
||||
transaction: only9s,
|
||||
proposal_procedure: 152,
|
||||
},
|
||||
No),
|
||||
]),
|
||||
) == list.at(votes, 1)
|
||||
|
||||
expect Some(Pair(DelegateRepresentative(Script(..)), [_, ..])) =
|
||||
@@ -54,23 +50,15 @@ validator {
|
||||
|
||||
expect
|
||||
Some(
|
||||
Pair(
|
||||
DelegateRepresentative(VerificationKey(only0s)),
|
||||
[
|
||||
Pair(
|
||||
GovernanceActionId { transaction: only7s, proposal_procedure: 2 },
|
||||
Abstain,
|
||||
),
|
||||
Pair(
|
||||
GovernanceActionId { transaction: only8s, proposal_procedure: 1 },
|
||||
Abstain,
|
||||
),
|
||||
Pair(
|
||||
GovernanceActionId { transaction: only9s, proposal_procedure: 0 },
|
||||
Abstain,
|
||||
),
|
||||
],
|
||||
),
|
||||
Pair(DelegateRepresentative(VerificationKey(only0s)),
|
||||
[
|
||||
Pair(GovernanceActionId { transaction: only7s, proposal_procedure: 2 },
|
||||
Abstain),
|
||||
Pair(GovernanceActionId { transaction: only8s, proposal_procedure: 1 },
|
||||
Abstain),
|
||||
Pair(GovernanceActionId { transaction: only9s, proposal_procedure: 0 },
|
||||
Abstain),
|
||||
]),
|
||||
) == list.at(votes, 3)
|
||||
|
||||
expect Some(Pair(StakePool(pool_id), [_, ..])) = list.at(votes, 4)
|
||||
@@ -83,8 +71,10 @@ validator {
|
||||
fn assert_redeemer(data: Data) {
|
||||
let is_valid =
|
||||
if data is Foo(42): Foo {
|
||||
trace data
|
||||
True
|
||||
} else if data is Void {
|
||||
trace data
|
||||
True
|
||||
} else {
|
||||
False
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
use aiken/collection/list
|
||||
use aiken/interval
|
||||
use cardano/credential.{Address, Inline, Pointer, Script, VerificationKey}
|
||||
use cardano/transaction.{ScriptContext, Withdrawing}
|
||||
|
||||
const only0s = #"00000000000000000000000000000000000000000000000000000000"
|
||||
|
||||
const only1s = #"11111111111111111111111111111111111111111111111111111111"
|
||||
|
||||
validator {
|
||||
fn spend(_tmp0: Void, _tmp1: Void, _ctx: Data) {
|
||||
True
|
||||
}
|
||||
|
||||
fn withdraw(_tmp0: Void, ctx: ScriptContext) {
|
||||
expect Withdrawing(Script(my_script_hash)) = ctx.info
|
||||
|
||||
expect
|
||||
interval.entirely_before(1596059092000) == ctx.transaction.validity_range
|
||||
|
||||
let addresses = list.map(ctx.transaction.outputs, fn(out) { out.address })
|
||||
|
||||
expect
|
||||
Some(
|
||||
Address {
|
||||
payment_credential: VerificationKey(only0s),
|
||||
stake_credential: Some(Inline(Script(only1s))),
|
||||
},
|
||||
) == list.at(addresses, 0)
|
||||
|
||||
expect
|
||||
Some(
|
||||
Address {
|
||||
payment_credential: VerificationKey(only0s),
|
||||
stake_credential: Some(Pointer(2498243, 27, 3)),
|
||||
},
|
||||
) == list.at(addresses, 1)
|
||||
|
||||
expect
|
||||
Some(
|
||||
Address {
|
||||
payment_credential: Script(only1s),
|
||||
stake_credential: Some(Pointer(2498243, 27, 3)),
|
||||
},
|
||||
) == list.at(addresses, 2)
|
||||
|
||||
expect
|
||||
[Pair(Script(my_script_hash), 0), Pair(VerificationKey(only0s), 14)] == ctx.transaction.withdrawals
|
||||
|
||||
True
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user