Test proposal procedures through Aiken.

This commit is contained in:
KtorZ 2024-08-11 00:53:19 +02:00
parent cfca0da4e9
commit 50dad1fdfe
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
14 changed files with 364 additions and 72 deletions

10
Cargo.lock generated vendored
View File

@ -1942,7 +1942,7 @@ checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f"
[[package]]
name = "pallas-addresses"
version = "0.29.0"
source = "git+https://github.com/KtorZ/pallas.git?rev=0cdd6393bb3fbceb3b5209ad248877b381822e90#0cdd6393bb3fbceb3b5209ad248877b381822e90"
source = "git+https://github.com/KtorZ/pallas.git?rev=7e5c90694c760e91fc7ac4d553db0f649b6a53a2#7e5c90694c760e91fc7ac4d553db0f649b6a53a2"
dependencies = [
"base58",
"bech32",
@ -1957,7 +1957,7 @@ dependencies = [
[[package]]
name = "pallas-codec"
version = "0.29.0"
source = "git+https://github.com/KtorZ/pallas.git?rev=0cdd6393bb3fbceb3b5209ad248877b381822e90#0cdd6393bb3fbceb3b5209ad248877b381822e90"
source = "git+https://github.com/KtorZ/pallas.git?rev=7e5c90694c760e91fc7ac4d553db0f649b6a53a2#7e5c90694c760e91fc7ac4d553db0f649b6a53a2"
dependencies = [
"hex",
"minicbor",
@ -1969,7 +1969,7 @@ dependencies = [
[[package]]
name = "pallas-crypto"
version = "0.29.0"
source = "git+https://github.com/KtorZ/pallas.git?rev=0cdd6393bb3fbceb3b5209ad248877b381822e90#0cdd6393bb3fbceb3b5209ad248877b381822e90"
source = "git+https://github.com/KtorZ/pallas.git?rev=7e5c90694c760e91fc7ac4d553db0f649b6a53a2#7e5c90694c760e91fc7ac4d553db0f649b6a53a2"
dependencies = [
"cryptoxide",
"hex",
@ -1982,7 +1982,7 @@ dependencies = [
[[package]]
name = "pallas-primitives"
version = "0.29.0"
source = "git+https://github.com/KtorZ/pallas.git?rev=0cdd6393bb3fbceb3b5209ad248877b381822e90#0cdd6393bb3fbceb3b5209ad248877b381822e90"
source = "git+https://github.com/KtorZ/pallas.git?rev=7e5c90694c760e91fc7ac4d553db0f649b6a53a2#7e5c90694c760e91fc7ac4d553db0f649b6a53a2"
dependencies = [
"base58",
"bech32",
@ -1997,7 +1997,7 @@ dependencies = [
[[package]]
name = "pallas-traverse"
version = "0.29.0"
source = "git+https://github.com/KtorZ/pallas.git?rev=0cdd6393bb3fbceb3b5209ad248877b381822e90#0cdd6393bb3fbceb3b5209ad248877b381822e90"
source = "git+https://github.com/KtorZ/pallas.git?rev=7e5c90694c760e91fc7ac4d553db0f649b6a53a2#7e5c90694c760e91fc7ac4d553db0f649b6a53a2"
dependencies = [
"hex",
"itertools 0.13.0",

View File

@ -49,11 +49,11 @@ x86_64-unknown-linux-gnu = "ubuntu-22.04"
walkdir = "2.3.2"
insta = { version = "1.30.0", features = ["yaml", "json", "redactions"] }
miette = { version = "7.2.0", features = ["fancy"] }
pallas-addresses = { git = "https://github.com/KtorZ/pallas.git", rev = "0cdd6393bb3fbceb3b5209ad248877b381822e90" }
pallas-codec = { git = "https://github.com/KtorZ/pallas.git", rev = "0cdd6393bb3fbceb3b5209ad248877b381822e90", features = ["num-bigint"] }
pallas-crypto = { git = "https://github.com/KtorZ/pallas.git", rev = "0cdd6393bb3fbceb3b5209ad248877b381822e90" }
pallas-primitives = { git = "https://github.com/KtorZ/pallas.git", rev = "0cdd6393bb3fbceb3b5209ad248877b381822e90" }
pallas-traverse = { git = "https://github.com/KtorZ/pallas.git", rev = "0cdd6393bb3fbceb3b5209ad248877b381822e90" }
pallas-addresses = { git = "https://github.com/KtorZ/pallas.git", rev = "7e5c90694c760e91fc7ac4d553db0f649b6a53a2" }
pallas-codec = { git = "https://github.com/KtorZ/pallas.git", rev = "7e5c90694c760e91fc7ac4d553db0f649b6a53a2", features = ["num-bigint"] }
pallas-crypto = { git = "https://github.com/KtorZ/pallas.git", rev = "7e5c90694c760e91fc7ac4d553db0f649b6a53a2" }
pallas-primitives = { git = "https://github.com/KtorZ/pallas.git", rev = "7e5c90694c760e91fc7ac4d553db0f649b6a53a2" }
pallas-traverse = { git = "https://github.com/KtorZ/pallas.git", rev = "7e5c90694c760e91fc7ac4d553db0f649b6a53a2" }
[profile.dev.package.insta]
opt-level = 3

View File

@ -1 +1,2 @@
ctx/**/*.cbor
*.cbor
*.log

View File

@ -13,4 +13,4 @@ requirements = []
source = "github"
[etags]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723298816, nanos_since_epoch = 935691000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1723324201, nanos_since_epoch = 743234000 }, "5e58899446492a704d0927a43299139856bef746e697b55895ba34206fa28452"]

View File

@ -6,7 +6,7 @@
"plutusVersion": "v2",
"compiler": {
"name": "Aiken",
"version": "v1.0.31-alpha+4645fd3"
"version": "v1.0.31-alpha+81c0152"
},
"license": "Apache-2.0"
},
@ -25,8 +25,8 @@
"$ref": "#/definitions/Void"
}
},
"compiledCode": "590340010000323232323232323223232232253330073253330083330083375e601a601c601c601c601c601c601c601c601c601c601c601c60146ea8c004c028dd5001260126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460166ea80044c94ccc02ccdd7980218069baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013009375a6006601a6ea8004528180798061baa001163001300b375400626464a6660166464a6660200022c2a6660206026002264a66601c66ebcc018c040dd50009ba6300448202a35ae41c54ccc038cdd7980398081baa30073010375400298122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300c300f3754600c60206ea8c01cc040dd50008a5014a22a66601c66ebcc00cc040dd5000a60103d879800013375e600a60206ea800530103d87a800014a029405280a5030120011637586002601c6ea8c014c038dd50031180898091809000899baf3002300d37546008601a6ea8014dd31800a40a8294094ccc02cc02400452f5bded8c0264646600200297adef6c6022533301100113301233760981014000374c00697adef6c60132323232533301233720910100002133016337609801014000374c00e00a2a66602466e3d22100002133016337609801014000374c00e00626602c66ec0dd48011ba600133006006003375660260066eb8c044008c054008c04c004c8cc0040052f5bded8c044a66602000226602266ec13001014000375000697adef6c60132323232533301133720910100002133015337609801014000375000e00a2a66602266e3d22100002133015337609801014000375000e00626602a66ec0dd48011ba800133006006003375a60240066eb8c040008c050008c0480048c03cc040c040c0400045281180718078008a502300d00114984d9594cccccc03000454ccc014c00cc018dd50008a99980418039baa00114985858585858594cccccc02800854ccc00cc004c010dd50010a99980318029baa0021498585858585858dc3a4000ae6955ceaab9e5573eae815d0aba25749",
"hash": "b4722fea910f2527073750f2d145f259ef3d8fec59b726abfd36a0b1"
"compiledCode": "5903280100003232323232323223232232253330073253330083330083375e601a601c601c601c601c601c601c601c601c601c601c601c60146ea8c004c028dd5001260126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff004a09444c94ccc024c94ccc028cdc3a400460166ea80044c94ccc02ccdd7980218069baa0014c0126d8799f58200000000000000000000000000000000000000000000000000000000000000000ff0013009375a6006601a6ea8004528180798061baa001163001300b375400626464a6660166464a6660200022c2a6660206026002264a66601c66ebcc018c040dd50009ba6300448202a35ae41c54ccc038cdd7980398081baa30073010375400298122d8799f581c11111111111111111111111111111111111111111111111111111111ff001533300e533300e300c300f3754600c60206ea8c01cc040dd50008a5014a22a66601c66ebcc00cc040dd5000a60103d879800013375e600a60206ea800530103d87a800014a029405280a5030120011637586002601c6ea8c014c038dd50031180898091809000899baf3002300d37546008601a6ea8014dd31800a40a8294094ccc02cc02400452f5bded8c0264646600200297adef6c6022533301100113301233760981014000374c00697adef6c60132323232533301233720910100002133016337609801014000374c00e00a2a66602466e3d22100002133016337609801014000374c00e00626602c66ec0dd48011ba600133006006003375660260066eb8c044008c054008c04c004c8cc0040052f5bded8c044a66602000226602266ec13001014000375000697adef6c60132323232533301133720910100002133015337609801014000375000e00a2a66602266e3d22100002133015337609801014000375000e00626602a66ec0dd48011ba800133006006003375a60240066eb8c040008c050008c0480048c03cc040c040c0400045281180718078008a502300d00114984d9594ccc014c00cc018dd50008a99980418039baa001149858594ccc00cc004c010dd50010a99980318029baa00214985858dc3a4000ae6955ceaab9e5573eae815d0aba201",
"hash": "759c4c40f04fe27a816fbe04c522ac00c710762e979ebe09ed276362"
},
{
"title": "deploy.spend",
@ -42,8 +42,8 @@
"$ref": "#/definitions/Data"
}
},
"compiledCode": "5902620100003232323232323232222533300453330043375e00698103d879800013253330053323223253330093370e900018051baa0011323232533300c3375e980106d8799f182aff0000213370e600c00a90020a50533300b3370e900018061baa001132533300f0011613253330103013002149858c94cccccc0500045858584dd68008b180880098069baa001165333333011001100116161616300e300b37540022c64646600200200644a66601c002298103d87a8000132323232533300f3372200e0042a66601e66e3c01c0084cdd2a40006602600297ae014c0103d87a80001330060060033010003375c601c004602400460200026e50dd9a6106d8799f182aff00300100122533300a0011480004cdc02400466004004601a0026eacc028c02cc02cc02cc02cc02cc02cc02cc02cc02cc02cc01cdd5180098039baa00213232533300a00116132533300b00116132533300932533300a3375e600a60186ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e601e60206020602060186ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a0601c0062a66601266ebcc038c03cc02cdd5180298059baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff00153330093370e900218051baa3004300b37540022944585280a50300d001300d0013758600260106ea8c008c020dd500191805980618060008a502300a00114a029309b2b2b9a5573aaae7955cfaba05742ae895d201",
"hash": "afe28fb3a5ca0c66aa19eb0ea419c60e20ea6e3c82875f74db76d32e"
"compiledCode": "5902520100003232323232323232222533300453330043375e00698103d879800013253330053323223253330093370e900018051baa001132533300a3370e900018059baa001132533300e001161325333333013001161616132533301030130031533300d3375e980106d8799f182aff0000413370e600e00c90020a5016375a0022c602000260186ea800458c038c02cdd50008b1919198008008019129998070008a6103d87a8000132323232533300f3372200e0042a66601e66e3c01c0084cdd2a40006602600297ae014c0103d87a80001330060060033010003375c601c004602400460200026e50dd9a6106d8799f182aff00300100122533300a0011480004cdc02400466004004601a0026eacc028c02cc02cc02cc02cc02cc02cc02cc02cc02cc02cc01cdd5180098039baa00213232533300a00116132533300b00116132533300932533300a3375e600a60186ea800530126d87a9f5820fcaa61fb85676101d9e3398a484674e71c45c3fd41b492682f3b0054f4cf3273ff0013375e601e60206020602060186ea800530122d8799f581ce37db487fbd58c45d059bcbf5cd6b1604d3bec16cf888f1395a4ebc4ff0014a0601c0062a66601266ebcc038c03cc02cdd5180298059baa0014c012ad8799fd8799fd8799f581c66666666666666666666666666666666666666666666666666666666ffffff00153330093370e900218051baa3004300b37540022944585280a50300d001300d0013758600260106ea8c008c020dd500191805980618060008a502300a00114a029309b2b2b9a5573aaae7955cfaba05742ae895d201",
"hash": "d593ff2c1db29ce9a9a392280895f03d00705203dc4a0ea15870a0b1"
},
{
"title": "mint.mint",
@ -53,8 +53,8 @@
"$ref": "#/definitions/Data"
}
},
"compiledCode": "5903070100003232323232323222533300332323232325332330093232533300e00116132533300f3012002132533300d3005300e3754002266e3c008dd7180918079baa001163008300e37540142c6eb8c040004cc004004cc010c00cdd5980298061baa3007300c375401091010022533300e00114bd70099807980618080009980100118088008a999191980599912999806980298071baa002132533300e3005300f37540022c266e1cdd6980998081baa001483c850c8cc004004c94ccc03cc018c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100130093756601660246ea8010894ccc0500045300103d87a800013232323253330153372200e0042a66602a66e3c01c0084c02ccc064dd3000a5eb80530103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00322533301200114c103d87a800013232323253330133372291103666f6f00002153330133371e910103666f6f000021300933017375000297ae014c0103d87a8000133006006003375a60280066eb8c048008c058008c05000458c01cc034dd5004980418069baa009132323232533300f3007301037540022a66601e66ebc038c044c8cdd8180a800980a980b0009bac3014301137540022600c60046eacc010c044dd5180618089baa00d14a02c64660020026eacc010c044dd5180618089baa00d22533301300114c103d87a80001323253330123375e6026004601c60286ea80404c020cc058dd39980b18098011980b180a00125eb812f5c0266008008002602e004602a002600200244a66602200229000099b8048008cc008008c0500048c044c048c048c048c048c048c048c048c048c048004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300d00114bd6f7b630099191919299980719b910070021533300e3371e00e0042006200a26602466ec0dd48011ba6001330060060033756601e0066eb8c034008c044008c03c0048c02cc030c030c030c0300048c028c02c0048c024004526136565734aae7555cf2ab9f5740ae855d101",
"hash": "cae7d307b37aaa4d2500641c8c6e823ea313aa43fb6dbc9ed72b7228"
"compiledCode": "590300010000323232323232322253330033232323232533233009323232533300f3012002132533300d3005300e3754002266e3c008dd7180918079baa001163008300e37540142c6eb8c040004cc004004cc010c00cdd5980298061baa3007300c37540109110022533300e00114bd70099807980618080009980100118088008a999191980599912999806980298071baa002132533300e3005300f37540022c266e1cdd6980998081baa001483c850c8cc004004c94ccc03cc018c040dd50008a5eb7bdb1804dd5980a18089baa00132323300100130093756601660246ea8010894ccc0500045300103d87a800013232323253330153372200e0042a66602a66e3c01c0084c02ccc064dd3000a5eb80530103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00322533301200114c103d87a800013232323253330133372291103666f6f00002153330133371e910103666f6f000021300933017375000297ae014c0103d87a8000133006006003375a60280066eb8c048008c058008c05000458c01cc034dd5004980418069baa009132323232533300f3007301037540022a66601e66ebc038c044c8cdd8180a800980a980b0009bac3014301137540022600c60046eacc010c044dd5180618089baa00d14a02c64660020026eacc010c044dd5180618089baa00d22533301300114c103d87a80001323253330123375e6026004601c60286ea80404c020cc058dd39980b18098011980b180a00125eb812f5c0266008008002602e004602a002600200244a66602200229000099b8048008cc008008c0500048c044c048c048c048c048c048c048c048c048c048004dd2a40006e1d200214a06e1d200014a046600400291010022323300100100322533300d00114bd6f7b630099191919299980719b910070021533300e3371e00e0042006200a26602466ec0dd48011ba6001330060060033756601e0066eb8c034008c044008c03c0048c02cc030c030c030c0300048c028c02c0048c024004526136565734aae7555cf2ab9f5740ae855d101",
"hash": "f557530d177449d0609a60cbe4f48b221c04a6ca7f9f235fcdc8c741"
},
{
"title": "withdrawals.spend",
@ -70,8 +70,8 @@
"$ref": "#/definitions/Void"
}
},
"compiledCode": "590249010000323232323232323223223225333006323232533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002902a198009bab3002300b3754600660166ea80108cdd79805800a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002900e198009bab3002300b3754600660166ea80108cdd79805800a60126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198061baa3004300c375400a44a66601c002297ae013300f300c3010001330020023011001374e6601a98126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff003300d4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd700a5014a044646600200200644a66601e002298103d87a800013232533300e300500213374a9000198091ba733012300f0023301230100024bd7025eb804cc010010004c04c008c0440048c034c038c038c038c038c038c0380048c03000452613656533333300b001153330043370e900018029baa00115333007300637540022930b0b0b0b0b0b29999998048008a99980119b8748000c00cdd50008a99980298021baa00114985858585858595cd2ab9d5573caae7d5d02ba15744ae901",
"hash": "45d4f36c2dcf9831e37995edb428bed6928a55b39b401c1dd5ab7886"
"compiledCode": "5902300100003232323232323223223225333006323232533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002902a198009bab3002300b3754600660166ea80108cdd79805800a6126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff001533300932533300a3370e900118059baa0011613370e6eb4c030c8cdd81808000980818088009bac300f300c3754002900e198009bab3002300b3754600660166ea80108cdd79805800a60126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff0013375e6e9cc8cc004004dd5980198061baa3004300c375400a44a66601c002297ae013300f300c3010001330020023011001374e6601a98126d8799fd8799f581c22222222222222222222222222222222222222222222222222222222ffff003300d4c126d8799fd87a9f581cafddc16c18e7d8de379fb9aad39b3d1b5afd27603e5ebac818432a72ffff004bd700a5014a044646600200200644a66601e002298103d87a800013232533300e300500213374a9000198091ba733012300f0023301230100024bd7025eb804cc010010004c04c008c0440048c034c038c038c038c038c038c0380048c0300045261365653330043370e900018029baa00115333007300637540022930b0b299980119b8748000c00cdd50008a99980298021baa001149858595cd2ab9d5573caae7d5d02ba157441",
"hash": "06f1f9df4be68a65cd55a921e3e7ec1eb4104906c53e0e564c726faa"
}
],
"definitions": {

View File

@ -25,7 +25,7 @@ for convenience.
- [ ] withdraw
- [ ] publish
- [ ] voting
- [ ] proposing
- [x] proposing
- Transaction body
- [x] inputs
@ -38,7 +38,7 @@ for convenience.
- [x] fee
- [x] mint
- certificates
- [ ] none
- [x] none
- some
- Register credential
- [ ] no deposit
@ -56,26 +56,26 @@ for convenience.
- [ ] Delegate CC
- [ ] Retire CC
- withdrawals
- [ ] none
- [x] none
- [ ] some
- [ ] validity range
- extra signatories
- [x] none
- [ ] some
- [ ] redeemers
- [x] redeemers
- [x] datums
- votes
- [ ] none
- [x] none
- [ ] some
- proposal procedures
- [ ] none
- [ ] some
- [x] none
- [x] some
- current treasury
- [ ] with
- [ ] without
- [x] without
- treasury donation
- [ ] with
- [ ] without
- [x] without
- Address
- [x] type-0 (key | key)
@ -105,21 +105,21 @@ for convenience.
- [ ] with action id
- [ ] without action id
- hardfork initiation
- [ ] with action id
- [ ] without action id
- [x] with action id
- [x] without action id
- treasuryWithdrawals
- [ ] with constitution
- [ ] without constitution
- [x] with constitution
- [x] without constitution
- no confidence
- [ ] with action id
- [ ] without action id
- [x] with action id
- [x] without action id
- update committee
- [ ] with action id
- [ ] without action id
- [x] with action id
- [x] without action id
- new constitution
- [ ] with action id
- [ ] without action id
- [ ] info action
- [x] with action id
- [x] without action id
- [x] info action
- Vote
- [ ] No
@ -164,11 +164,11 @@ for convenience.
- [ ] 33 : nonnegative_interval}
- Constitution
- [ ] with guardrail script
- [ ] without guardrail script
- [x] with guardrail script
- [x] without guardrail script
- Credential
- [ ] key
- [x] key
- [x] script
- Delegatee

View File

@ -0,0 +1,5 @@
[
{ 0: h'6000000000000000000000000000000000000000000000000000000000'
, 1: 1000000
}
]

View File

@ -0,0 +1,122 @@
[
{ 0:
[ [h'0000000000000000000000000000000000000000000000000000000000000000', 0]
]
, 1:
[]
, 2: 42
, 20: 258(
[
[ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 1, null, [ 10, 0 ] ]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 1, [ h'0000000000000000000000000000000000000000000000000000000000000000', 0 ] , [ 11, 0 ] ]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 2
, { h'E011111111111111111111111111111111111111111111111111111111': 1000000 }
, null
]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 2
, { h'E022222222222222222222222222222222222222222222222222222222': 1000000 }
, h'{{ proposing_all.guardrails.hash }}'
]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 3, null ]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 4
, null
, [ [0, h'00000000000000000000000000000000000000000000000000000000'] ]
, { [0, h'00000000000000000000000000000000000000000000000000000000']: 500 }
, 30([1, 2])
]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 5
, null
, [ [ "https://constitution.cardano.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
, null
]
]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'F000000000000000000000000000000000000000000000000000000000'
, [ 5
, null
, [ [ "https://constitution.cardano.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
, h'00000000000000000000000000000000000000000000000000000000'
]
]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
, [ 2000000
, h'E000000000000000000000000000000000000000000000000000000000'
, [ 6 ]
, [ "https://aiken-lang.org"
, h'0000000000000000000000000000000000000000000000000000000000000000'
]
]
]
)
},
{ 5: [[5, 3, 121([]), [1000000, 100000000]]]
, 7: [h'{{ proposing_all.guardrails.cbor }}']
},
true,
null
]

View File

@ -0,0 +1 @@
../../../../../stdlib/lib

View File

@ -1 +0,0 @@
../../../../../../stdlib/lib/aiken

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
use aiken/dict.{Dict}
use aiken/list
use aiken/transaction.{
use aiken/collection/dict.{Dict}
use aiken/collection/list
use cardano/assets.{PolicyId, Value}
use cardano/credential
use cardano/transaction.{
DatumHash, Input, Mint, Minting, NoDatum, Output, OutputReference,
ScriptContext, ScriptInfo, ScriptPurpose,
}
use aiken/transaction/credential
use aiken/transaction/value.{PolicyId, Value}
const null28 = #"00000000000000000000000000000000000000000000000000000000"
@ -37,7 +37,7 @@ fn assert_reference_inputs(inputs: List<Input>) -> Void {
},
output: Output {
address: credential.from_verification_key(null28),
value: value.from_lovelace(1_000_000),
value: assets.from_lovelace(1_000_000),
datum: NoDatum,
reference_script: None,
},
@ -74,7 +74,7 @@ fn assert_outputs(
Some(
Output {
address: credential.from_verification_key(null28),
value: value.from_lovelace(1_000_000),
value: assets.from_lovelace(1_000_000),
datum: DatumHash(void_hash),
reference_script: None,
},
@ -85,9 +85,9 @@ fn assert_outputs(
Output {
address: credential.from_verification_key(null28)
|> credential.with_delegation_key(null28),
value: value.from_lovelace(1_000_000)
|> value.add(our_policy_id, "tuna", 100000000000000)
|> value.add(other_policy_id, "aiken", 42),
value: assets.from_lovelace(1_000_000)
|> assets.add(our_policy_id, "tuna", 100000000000000)
|> assets.add(other_policy_id, "aiken", 42),
datum: NoDatum,
reference_script: None,
},
@ -98,8 +98,8 @@ fn assert_outputs(
Output {
address: credential.from_script(null28)
|> credential.with_delegation_key(null28),
value: value.from_lovelace(1_000_000)
|> value.add(other_policy_id, "cardano", 1),
value: assets.from_lovelace(1_000_000)
|> assets.add(other_policy_id, "cardano", 1),
datum: NoDatum,
reference_script: Some(
#"68ad54b3a8124d9fe5caaaf2011a85d72096e696a2fb3d7f86c41717",
@ -116,7 +116,7 @@ fn assert_mint(mint: Value, our_policy_id: PolicyId, other_policy_id: PolicyId)
(other_policy_id, "aiken", -14),
(other_policy_id, "cardano", 1),
(our_policy_id, "tuna", 100000000000000),
] == value.flatten(mint)
] == assets.flatten(mint)
Void
}

View File

@ -0,0 +1,155 @@
use aiken/collection/list
use aiken/math/rational
use cardano/credential.{Script, VerificationKey}
use cardano/governance.{
Constitution, ConstitutionalCommittee, GovernanceAction, GovernanceActionId,
HardForkInitiation, NewConstitution, NicePoll, NoConfidence, ProposalProcedure,
ProtocolVersion, TreasuryWithdrawal,
}
use cardano/transaction.{Propose, Redeemer, ScriptContext, ScriptPurpose}
const null28 = #"00000000000000000000000000000000000000000000000000000000"
const null32 =
#"0000000000000000000000000000000000000000000000000000000000000000"
validator {
fn guardrails(_tmp1: Void, ctx: ScriptContext) -> Bool {
let procedures = ctx.transaction.proposal_procedures
assert_redeemers(ctx.transaction.redeemers)
assert_proposal_procedure(
list.at(procedures, 0),
fn(action) {
expect
HardForkInitiation {
ancestor: None,
new_version: ProtocolVersion(10, 0),
} == action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 1),
fn(action) {
expect
HardForkInitiation {
ancestor: Some(GovernanceActionId(null32, 0)),
new_version: ProtocolVersion(11, 0),
} == action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 2),
fn(action) {
expect
TreasuryWithdrawal {
beneficiaries: [
Pair(VerificationKey(
#"11111111111111111111111111111111111111111111111111111111",
),
1_000_000),
],
guardrails: None,
} == action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 3),
fn(action) {
expect TreasuryWithdrawal { guardrails: Some(..), .. } = action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 4),
fn(action) {
expect NoConfidence { ancestor: None } == action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 5),
fn(action) {
expect Some(quorum) = rational.new(1, 2)
expect
ConstitutionalCommittee {
ancestor: None,
evicted_members: [VerificationKey(null28)],
added_members: [Pair(VerificationKey(null28), 500)],
quorum,
} == action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 6),
fn(action) {
expect
NewConstitution {
ancestor: None,
constitution: Constitution { guardrails: None },
} == action
Void
},
)
assert_proposal_procedure(
list.at(procedures, 7),
fn(action) {
expect
NewConstitution {
ancestor: None,
constitution: Constitution { guardrails: Some(null28) },
} == action
Void
},
)
assert_last_proposal_procedure(list.at(procedures, 8))
True
}
}
fn assert_redeemers(redeemers: Pairs<ScriptPurpose, Redeemer>) -> Void {
expect [
Pair(Propose(
3,
ProposalProcedure { deposit, return_address, governance_action },
),
data),
] = redeemers
expect deposit == 2_000_000
expect return_address == Script(null28)
expect TreasuryWithdrawal { .. } = governance_action
expect Void = data
Void
}
fn assert_proposal_procedure(
procedure: Option<ProposalProcedure>,
with: fn(GovernanceAction) -> Void,
) -> Void {
expect Some(procedure) = procedure
expect procedure.deposit == 2_000_000
expect procedure.return_address == Script(null28)
with(procedure.governance_action)
}
fn assert_last_proposal_procedure(procedure: Option<ProposalProcedure>) -> Void {
expect Some(procedure) = procedure
expect procedure.deposit == 2_000_000
expect procedure.return_address == VerificationKey(null28)
expect procedure.governance_action == NicePoll
Void
}

View File

@ -1,10 +1,10 @@
use aiken/dict
use aiken/transaction.{
use aiken/collection/dict
use cardano/assets
use cardano/credential.{Address, Script}
use cardano/transaction.{
InlineDatum, Input, Output, OutputReference, ScriptContext, ScriptInfo,
ScriptPurpose, Spend, Spending,
}
use aiken/transaction/credential.{Address, ScriptCredential}
use aiken/transaction/value
validator {
fn spend(_tmp1: Void, _tmp2: Void, ctx: ScriptContext) {
@ -64,12 +64,10 @@ fn assert_inputs(inputs: List<Input>) {
expect
transaction_id == #"0000000000000000000000000000000000000000000000000000000000000000"
expect resolved_input_value == value.from_lovelace(1000000000)
expect resolved_input_value == assets.from_lovelace(1000000000)
expect Address {
payment_credential: ScriptCredential(_),
stake_credential: None,
} = address
expect Address { payment_credential: Script(_), stake_credential: None } =
address
Void
}