How to apply a parameter using aiken blueprint apply
?
#555
-
I have the following extra parameter:
And my spend validator looks like this:
The relevant part for the blueprints has this: ...
"parameters": [
{
"title": "config",
"schema": {
"$ref": "#/definitions/cardano_swaps~1SwapConfig"
}
...
"cardano_swaps/SwapConfig": {
"title": "SwapConfig",
"anyOf": [
{
"title": "SwapConfig",
"dataType": "constructor",
"index": 0,
"fields": [
{
"title": "offer",
"$ref": "#/definitions/Tuple$ByteArray_ByteArray"
},
{
"title": "ask",
"$ref": "#/definitions/Tuple$ByteArray_ByteArray"
}
]
}
]
}, I used this test's error message to tell me what the cbor should be for an example
The error message says the cbor is aiken blueprint apply \
--out swap.plutus \
--validator cardano_swaps.spend \
"d8799f9f4040ff9f581cc0f8644a01a6bf5db02f4afe30d604975e63dd274f1098a1738e561d40ffff" But I get this error:
What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@fallen-icarus would you mind sharing the complete blueprint (minus the |
Beta Was this translation helpful? Give feedback.
-
{
"preamble": {
"title": "fallen-icarus/cardano_swaps",
"description": "Aiken contracts for project 'fallen-icarus/cardano_swaps'",
"version": "0.0.0",
"plutusVersion": "v2",
"license": "Apache-2.0"
},
"validators": [
{
"title": "cardano_swaps.mint",
"redeemer": {
"title": "redeemer",
"schema": {
"$ref": "#/definitions/cardano_swaps~1BeaconRedeemer"
}
},
"parameters": [
{
"title": "app_name",
"schema": {
"$ref": "#/definitions/String"
}
},
{
"title": "dapp_hash",
"schema": {
"$ref": "#/definitions/ByteArray"
}
}
],
"compiledCode": "5906b20100003232323232323232323232322322322232533300c3232323232323232323232323232533301a3370e9000000899191919191929998101980600a99804000807899999919191919191111191919191998048009119191919191919191919299981d19b8848000ccc06001c04922010013232323232533303f3370e9001181f00109919299982099b8748000c1000144c8c94ccc10d4ccc10d4ccc10d4ccc10ccdc780180e099b8f00101b14a0264a66608866e1d20000011324a260840162940c108028528099b8948202d2244c0205280a99982180a0a5114a02a66608666608666e3c00c07128251132632330210014910d20644170702061646472657373003302049114426561636f6e206d75737420676f20746f2061200001d153330433330433371e002036941288b0a99982199b8800848202d2244c5858dd71824000981f8028019bae3046001303d00200116304300330423043002375a6082608460840026607e0066607e64a66607666e1d2004001132323200232533303e3370e900000089919299982218238010a4c2a66082921334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016375c608a00260780042a66607c66e1d20020011323253330443047002132498c94ccc104cdc3a4000002264646464a66609260980042930a99823249334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016375a609400260940046eb4c120004c0fc00854cc1092412b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e740016303f00115330414901334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e20657870656374656400163045001303c002153303f4912b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e740016303c001304200130390061630390053303f375066603000e9101004881004bd700805981f800981f801181e800981a002981d800981d8011bab303900130390023037001302e0024a26eb0c0cc004c0cc004c0c8004c0a0004c00400488894ccc0b000c40044c8c8cccc018018004010cc01000800cc0c0010c0b800c88cdcb001000911191919299981419b874800800452000132375a605e002604c004604c00264a66604e66e1d200200114c103d87a800013232330080010053756605c002604a004604a0026601c0060046002002444a66604e004298103d87a800013232323253330273371e00a002266e9520003302c375000497ae01333007007003005375c60500066eb4c0a0008c0ac00cc0a400806806003c04c5281bab30250013025001302400130230013022001301800d13232323232323300c0153300800100f3756604a002604a002604800260460026044002603001a603001c446464a66603866e1d200200114bd6f7b6300991bab3023001301a002301a0013300300200122330030020013001001222533301c00214c103d87a8000132323232533301c3371e00a002266e95200033021374c00497ae01333007007003005375c603a0066eacc074008c08000cc07800888c94ccc05ccdc3a40000022a6660360042c264a6660380022646464a666036a66603666e3c00522010013370e00490010a5014a22c6eb8c070008dd6980e000980f0018b180f0010a99980b999802001111299980d000899b880024800052825114a22c602a00460020024444a666034006200226464646466600c002004666601001000600c00a6eb8c06c00cdd6980d801180f002180e0019bae3017001300e53330103370e9000180780088008a99808a4812a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016301500130150023013001300a002149858c800cc94ccc030cdc3a40000022a66602060140062930a99806a491d4578706563746564206e6f206669656c647320666f7220436f6e73747200161533300c3370e90010008a99980818050018a4c2a6601a92011d4578706563746564206e6f206669656c647320666f7220436f6e7374720016153300d4912b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e740016300a002375c0026e64dd700099800800a40004444666600e66e1c00400c0348cccc014014cdc000224004601e0020040044600c6ea80048c010dd5000ab9a5738aae7555cf2ab9f5740ae855d101",
"hash": "466af168e4bd0179654d4b129b56fa570930ab4f83602cff9046db13"
},
{
"title": "cardano_swaps.spend",
"datum": {
"title": "datum",
"schema": {
"$ref": "#/definitions/cardano_swaps~1SwapDatum"
}
},
"redeemer": {
"title": "redeemer",
"schema": {
"$ref": "#/definitions/cardano_swaps~1SwapRedeemer"
}
},
"parameters": [
{
"title": "config",
"schema": {
"$ref": "#/definitions/cardano_swaps~1SwapConfig"
}
}
],
"compiledCode": "5910800100003232323232323232323232322322223232533300c3232323232323232323232323232323232323232323232323232323232323232323232323253330313370e9000003099299981919b87480080044c8cc00c06c098c0c009c4c8c94ccc0d0cc01007009c4ccc8c888c8c8c8c8c8c8c8c94ccc100cdc399980b0008052450033702900019980b0010052450014a22c66601400c446464646464646604600e0026eacc130004c130004c108004c124004c124004c0fc0092f5bded8c06eacc110004c110004c10c004c108004c104008dd6181f800981b00098008009111299981e0018800899191980200119998030030008020019820002181f0018008138a50375c6072002606004e606004c2a66606266e1d200200613253330323370e9000000899318180138992999819999919111980180111919191919299981e99baf004007132330244c0103d87a8000001301800114a2608400260840026082004607e002606c0026002002444a66607400429444c8c94ccc0e0c00c0084ccc01401400400c528181f001981e0011bac3302f30310264801006c4cc00c06c09852818180139818013099299981919b87480080044c8c94ccc0d0cc06c00530106d8799f0001ff00133332323232323232323232323232323232323232322223232323232323232323232323232323232323232533305f33305f32330190012323232323253330663371090000008a99983319b8f00501213371e00602229405281bad306b001306b002375c60d200260d20046eb8c19c004ccc070010888ccc0740088894ccc194cdc38012400020022660d46e9ccc1a8dd4803198351ba90033306a375000497ae00010014bd702504a22c2a6660be6660be002941288b0a513232323232323232323371266e0801c004cdc10018029bad306c001306c002375a60d400260c200e6eb4c1a0004c1a0008dd69833000982e8009981400080219180e8009998198010048041919180e80099b8148000004ccc0c8004018014cc88ccc07403888c8c8c8c8c8c94ccc194cdd78028048a9998329982580518200008998208039981480191198148009119b814800000458401cc1a8004c1a8008dd5983400098340011833000982e80100219ba548000cc1800052f5c002660ba0046eacc16c004c8c8c8c8c8cdd81ba6004001306200130620013061002375660be00266603c018446464646464646464646464646464a6660d066ebc0280804c8c8c8c8c8c8cc1ccdd3000998399ba8003330730024bd70198248050069991191919191919191919191919ba548000cc1f8dd419b830030013307e375066e0c0080052f5c06608600400266e08018008cdc019b820070013370400600a6eb4c1ec004c1ec008dd6983c80098380029bad30770013077002375a60ea00260d80046606c6606800e00200a6606c6606800800200466e0000c018c1c0004c19cc94ccc1a8cdc3a400460d200220022a660d69212a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016304400733303e008014013100f306d001306d002375a60d600260d60166eacc1a4028c1a0004c1a0008dd5983300098330011832000982d80098310009831000982c00125eb841018000810100008106d8799f0001ff001bae305a004375c60b00066eb8c160010dd7182b001991919bb0305b002305b001305b001375860b200260b2004646466ec0c164008c164004c164004dd6182b80098270031bac305500130550013054002375860a400260920046002002444a66609a00429444c8c94ccc12cc00c0084ccc01401400400c52818288019bac304f00230010012222533304c00310011323232323330060010023333008008003006005375c609a0066eb4c134008c140010c13800cc00400488894ccc12800c40044c8c8c8c8ccc018004008cccc02002000c018014dd718258019bab304b002304e004304c00323374a9000198239ba8001330473750900125eb80c00400488894ccc11c00c40044c8c8cccc018018004010cc01000800cc12c010c12400cc0040048894ccc11000852f5bded8c02646464646609266ec0dd48009ba833005001002333007007003005375c608a0066eb4c114008c12000cc118008c0040048894ccc10800852f5bded8c02646464646608e66ec0dd48009ba633005001002333007007003005375c60860066eacc10c008c11800cc110008c00400488894ccc10400c40044c8c8cccc018018004010cc01000800cc114010c10c00cc0040048894ccc0e8cdc42400000226466e95200033040375066e0c00c004cc100dd419b830020014bd70198028010008a99981d19b88001480004ccc00c00ccdc0a400000466e052000001162232323232323232323232323374a9000198241ba833706006002660906ea0cdc1801000a5eb80cc034008004cdc100300119b82007003375a608a002608a0046eb4c10c004c0e8014dd6982080098208011bad303f0013036002300100122253330373370e90000008801099980180180099b8600200101c02702f1630390013030027132630300273030026223232323253330360011001163253330363370e90010008a5113253330373370e900000109919299981c99b8748000c0e00044c8c94ccc0eccdc3a400060740022646464646464646464646464660340020166eb0c130004c130004c12c004c128004c124004c120004c11c004c118004c114004c0ec030dd71821000981c8008029820000981b800801981f000981a801800899191919191919191919198088008049bab30450013045001304400130430013042001304100130400013036007303d00130340023034001303a001303a00130300023001001222533303500214a0264646464a66606a66ebc0140045288999803803801802981b0019bad3036002303900330370023001001222533303300214a026464a66606266e3c00800c5288999802802800801981b8019bae3035002302a02122232323253330303370e90010008a40002646eb4c0dc004c0b8008c0b8004c94ccc0bccdc3a40040022980103d87a800013232330080010053756606c002605a004605a0026600c0060046002002444a66605e004298103d87a8000132323232533302f3371e00a002266e95200033034375000497ae01333007007003005375c60600066eb4c0c0008c0cc00cc0c4008c0040048894ccc0b4008530103d87a8000132323232533302d3371e00a002266e95200033032374c00497ae01333007007003005375c605c0066eacc0b8008c0c400cc0bc0088c94ccc09ccdc3a400800226464640046046002605c002604a0042c604a00244666601000400244464a666054a66605c00229445280a6103d87a800013374a9000198179ba60014bd70199980380100091119299981699b87001480005300103d87a800013374a9000198191ba80014bd7019b8000200100600322533302533720004002298103d8798000153330253371e0040022980103d87a800014c103d87b8000300100122222533302a0041003132323232333330090090033333300a007001002006005006005375c60560066eb4c0ac008c0b8014c0b0010c0040048888894ccc0a40144cc0a8cdd81ba9004375000697adef6c6013232323253330293375e6600a01000298103d879800013302e337606ea4020dd40038048a99981499b8f00800113232533302b3370e9000000899191981919bb037520186ea000401cdd6981900098148010802981480099980300400380109981719bb037520026ea0008cccccc02802800c02001c018014dd718150019bad302a002302d006302b00530010012222253330260041003132323232333330090090033333300a007001002006005006005375c604e0066eacc09c008c0a8014c0a0010c0040048888894ccc0940144cc098cdd81ba9004374c00697adef6c6013232323253330253375e6600a01000298103d879800013302a337606ea4020dd30038048a99981299b8f0080011323253330273370e9000000899191981719bb037520186e9800401cdd5981700098128010802981280099980300400380109981519bb037520026e98008cccccc02802800c02001c018014dd718130019bab3026002302900630270052232533301d3370e900100089919299980f99803000a6106d8799f0001ff0013253330203370e900000089919299981119baf00100414a22c604e002603c00c2944c07801458c090004c06c0084c98c06c008c06c00488c8c8c8c8c8c8c8c8cdc419b820030053370400e0026eb4c0a0004c0a0008dd69813000980e8029bad30240013024002375a60440026032004603c002602aa66602e66e1d200030160011001153301849012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016301c001301c001301253330143370e9000180980088008a9980aa4812a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016301900130103253330133370e9000180900088008a9980a2492a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e001633323222323300400123375e66028602c00290000019bac33012301400248000c0040048894ccc064008530103d87a8000132325333017300300213374a90001980e00125eb804ccc01401400400cc07400cc06c008014004c05c004c0394ccc040cdc3a4004601e00220022a6602292012a4578706563746564206f6e20696e636f727265637420636f6e7374727563746f722076617269616e742e0016301500130150023013001300a003149858c8014c014010c800cc94ccc02ccdc3a40000022a66601e60120062930a998062491d4578706563746564206e6f206669656c647320666f7220436f6e73747200161533300b3370e90010008a99980798048018a4c2a6601892011d4578706563746564206e6f206669656c647320666f7220436f6e73747200161533300b3370e90020008a99980798048018a4c2a6601892011d4578706563746564206e6f206669656c647320666f7220436f6e7374720016153300c4912b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e740016300900223253330083370e900000089919299980718088010a4c2a66016921334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016375c601e002600c0042a66601066e1d200200113232533300e3011002132498c94ccc02ccdc3a4000002264646464a666026602c0042930a99808249334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016375a602800260280046eb4c048004c02400854cc0312412b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e7400163009001153300b4901334c6973742f5475706c652f436f6e73747220636f6e7461696e73206d6f7265206974656d73207468616e2065787065637465640016300f001300600215330094912b436f6e73747220696e64657820646964206e6f74206d6174636820616e7920747970652076617269616e740016300600133001001480008888cccc01ccdc38008018069199980280299b8000448008c03c0040080088c018dd5000918021baa0015734ae7155ceaab9e5573eae815d0aba21",
"hash": "9ec142e495247cc128237179b0b5947fdab1620d4327a3299afe8317"
}
],
"definitions": {
"ByteArray": {
"dataType": "bytes"
},
"String": {
"dataType": "#string"
},
"Tuple$ByteArray_ByteArray": {
"title": "Tuple",
"dataType": "list",
"items": [
{
"$ref": "#/definitions/ByteArray"
},
{
"$ref": "#/definitions/ByteArray"
}
]
},
"cardano_swaps/BeaconRedeemer": {
"title": "BeaconRedeemer",
"anyOf": [
{
"title": "MintBeacon",
"dataType": "constructor",
"index": 0,
"fields": []
},
{
"title": "BurnBeacon",
"dataType": "constructor",
"index": 1,
"fields": []
}
]
},
"cardano_swaps/SwapConfig": {
"title": "SwapConfig",
"anyOf": [
{
"title": "SwapConfig",
"dataType": "constructor",
"index": 0,
"fields": [
{
"title": "offer",
"$ref": "#/definitions/Tuple$ByteArray_ByteArray"
},
{
"title": "ask",
"$ref": "#/definitions/Tuple$ByteArray_ByteArray"
}
]
}
]
},
"cardano_swaps/SwapDatum": {
"title": "SwapDatum",
"anyOf": [
{
"title": "BeaconSymbol",
"dataType": "constructor",
"index": 0,
"fields": [
{
"title": "symbol",
"$ref": "#/definitions/ByteArray"
}
]
},
{
"title": "SwapPrice",
"dataType": "constructor",
"index": 1,
"fields": [
{
"title": "price",
"$ref": "#/definitions/cardano_swaps~1ratio~1Rational"
}
]
}
]
},
"cardano_swaps/SwapRedeemer": {
"title": "SwapRedeemer",
"anyOf": [
{
"title": "Close",
"dataType": "constructor",
"index": 0,
"fields": []
},
{
"title": "Update",
"dataType": "constructor",
"index": 1,
"fields": []
},
{
"title": "Swap",
"dataType": "constructor",
"index": 2,
"fields": []
}
]
},
"cardano_swaps/ratio/Rational": {
"title": "Rational",
"description": "A fraction of integers. This type can be used to represent decimals on-chain.\n\n In order to guarantee the invariant of the denominator always being positive, the type\n constructors are not exposed. Instead, a `Rational` can be created with `unsafe_ratio`, `ratio`,\n or `from_integer`. All operations on the `Rational` type enforce this invariant.\n\n All arithmetic operations on the `Rational` type automatically reduce the resulting fraction by\n dividing the numerator and denominator by their greatest common divisor.\n\n Operations on `Rational` can easily be piped together:\n ```aiken\n from_integer(21)\n |> add(rat1)\n |> multiply(rat2)\n |> subtract(rat3)\n ```",
"dataType": "integer"
}
}
} |
Beta Was this translation helpful? Give feedback.
-
PR #560 seems to have fixed the issue. My original command works with the latest commit. |
Beta Was this translation helpful? Give feedback.
PR #560 seems to have fixed the issue. My original command works with the latest commit.