diff --git a/crates/tx3-cardano/src/compile/mod.rs b/crates/tx3-cardano/src/compile/mod.rs index 7b8a86e0..aa8724b6 100644 --- a/crates/tx3-cardano/src/compile/mod.rs +++ b/crates/tx3-cardano/src/compile/mod.rs @@ -288,24 +288,67 @@ fn compile_outputs( tx: &tir::Tx, network: Network, ) -> Result>, Error> { - let mut resolved: Vec<_> = tx - .outputs - .iter() - .map(|out| (out.optional, compile_output_block(out, network))) - .filter(|(optional, output)| !optional || output_has_assets(output)) - .map(|(_, output)| output) - .collect::, _>>()?; + let regular_outputs = tx.outputs.iter().filter_map(|out| { + let compiled = compile_output_block(out, network); + + if out.optional && !output_has_assets(&compiled) { + return None; + } + + let idx = out.index.as_number().map(|n| n as usize); + Some(compiled.map(|o| (idx, o))) + }); - let cardano_outputs = tx + let publish_outputs = tx .adhoc .iter() .filter(|x| x.name.as_str() == "cardano_publish") - .map(|adhoc| compile_cardano_publish_directive(adhoc, network)) + .map(|adhoc| { + let idx = adhoc + .data + .get("index") + .and_then(|expr| expr.as_number()) + .map(|n| n as usize); + + compile_cardano_publish_directive(adhoc, network).map(|o| (idx, o)) + }); + + let all: Vec<_> = publish_outputs + .chain(regular_outputs) .collect::, _>>()?; - resolved.extend(cardano_outputs); + order_by_index(all) +} + +fn order_by_index( + outputs: Vec<(Option, primitives::TransactionOutput<'static>)>, +) -> Result>, Error> { + let total = outputs.len(); + let mut slots: Vec>> = vec![None; total]; + let mut non_indexed = Vec::new(); + + for (idx, compiled) in outputs { + match idx { + Some(pos) => { + if pos >= total { + return Err(Error::ConsistencyError(format!( + "output index {pos} is out of range (total outputs: {total})" + ))); + } + slots[pos] = Some(compiled); + } + None => non_indexed.push(compiled), + } + } + + let mut filler = non_indexed.into_iter(); + for slot in &mut slots { + if slot.is_none() { + *slot = filler.next(); + } + } - Ok(resolved) + Ok(slots.into_iter().flatten().collect()) } pub fn compile_cardano_publish_directive( diff --git a/crates/tx3-lang/src/analyzing.rs b/crates/tx3-lang/src/analyzing.rs index 55e50b02..48387ac3 100644 --- a/crates/tx3-lang/src/analyzing.rs +++ b/crates/tx3-lang/src/analyzing.rs @@ -1019,6 +1019,7 @@ impl Analyzable for OutputBlockField { OutputBlockField::To(x) => x.analyze(parent), OutputBlockField::Amount(x) => x.analyze(parent), OutputBlockField::Datum(x) => x.analyze(parent), + OutputBlockField::Index(x) => x.analyze(parent), } } @@ -1027,6 +1028,7 @@ impl Analyzable for OutputBlockField { OutputBlockField::To(x) => x.is_resolved(), OutputBlockField::Amount(x) => x.is_resolved(), OutputBlockField::Datum(x) => x.is_resolved(), + OutputBlockField::Index(x) => x.is_resolved(), } } } diff --git a/crates/tx3-lang/src/ast.rs b/crates/tx3-lang/src/ast.rs index 54578928..53cc9a03 100644 --- a/crates/tx3-lang/src/ast.rs +++ b/crates/tx3-lang/src/ast.rs @@ -386,6 +386,7 @@ pub enum OutputBlockField { To(Box), Amount(Box), Datum(Box), + Index(Box), } impl OutputBlockField { @@ -394,6 +395,7 @@ impl OutputBlockField { OutputBlockField::To(_) => "to", OutputBlockField::Amount(_) => "amount", OutputBlockField::Datum(_) => "datum", + OutputBlockField::Index(_) => "index", } } } diff --git a/crates/tx3-lang/src/cardano.rs b/crates/tx3-lang/src/cardano.rs index 877aaca3..a8eee23b 100644 --- a/crates/tx3-lang/src/cardano.rs +++ b/crates/tx3-lang/src/cardano.rs @@ -567,6 +567,7 @@ pub enum CardanoPublishBlockField { Datum(Box), Version(Box), Script(Box), + Index(Box), } impl CardanoPublishBlockField { @@ -577,6 +578,7 @@ impl CardanoPublishBlockField { CardanoPublishBlockField::Datum(_) => "datum", CardanoPublishBlockField::Version(_) => "version", CardanoPublishBlockField::Script(_) => "script", + CardanoPublishBlockField::Index(_) => "index", } } } @@ -627,6 +629,12 @@ impl AstNode for CardanoPublishBlockField { DataExpr::parse(pair)?.into(), )) } + Rule::cardano_publish_block_index => { + let pair = pair.into_inner().next().unwrap(); + Ok(CardanoPublishBlockField::Index( + DataExpr::parse(pair)?.into(), + )) + } x => unreachable!("Unexpected rule in cardano_publish_block_field: {:?}", x), } } @@ -638,6 +646,7 @@ impl AstNode for CardanoPublishBlockField { Self::Datum(x) => x.span(), Self::Version(x) => x.span(), Self::Script(x) => x.span(), + Self::Index(x) => x.span(), } } } @@ -679,6 +688,7 @@ impl Analyzable for CardanoPublishBlockField { CardanoPublishBlockField::Datum(x) => x.analyze(parent), CardanoPublishBlockField::Version(x) => x.analyze(parent), CardanoPublishBlockField::Script(x) => x.analyze(parent), + CardanoPublishBlockField::Index(x) => x.analyze(parent), } } @@ -689,6 +699,7 @@ impl Analyzable for CardanoPublishBlockField { CardanoPublishBlockField::Datum(x) => x.is_resolved(), CardanoPublishBlockField::Version(x) => x.is_resolved(), CardanoPublishBlockField::Script(x) => x.is_resolved(), + CardanoPublishBlockField::Index(x) => x.is_resolved(), } } } @@ -725,6 +736,7 @@ impl IntoLower for CardanoPublishBlockField { } CardanoPublishBlockField::Version(x) => Ok(("version".to_string(), x.into_lower(ctx)?)), CardanoPublishBlockField::Script(x) => Ok(("script".to_string(), x.into_lower(ctx)?)), + CardanoPublishBlockField::Index(x) => Ok(("index".to_string(), x.into_lower(ctx)?)), } } } @@ -736,7 +748,7 @@ impl IntoLower for CardanoPublishBlock { &self, ctx: &crate::lowering::Context, ) -> Result { - let data = self + let data: HashMap = self .fields .iter() .map(|x| x.into_lower(ctx)) diff --git a/crates/tx3-lang/src/lowering.rs b/crates/tx3-lang/src/lowering.rs index a49dfe79..ff9e88fb 100644 --- a/crates/tx3-lang/src/lowering.rs +++ b/crates/tx3-lang/src/lowering.rs @@ -686,6 +686,7 @@ impl IntoLower for ast::OutputBlockField { let ctx = ctx.enter_datum_expr(); x.into_lower(&ctx) } + ast::OutputBlockField::Index(x) => x.into_lower(ctx), } } } @@ -697,12 +698,14 @@ impl IntoLower for ast::OutputBlock { let address = self.find("to").into_lower(ctx)?.unwrap_or_default(); let datum = self.find("datum").into_lower(ctx)?.unwrap_or_default(); let amount = self.find("amount").into_lower(ctx)?.unwrap_or_default(); + let index = self.find("index").into_lower(ctx)?.unwrap_or_default(); Ok(ir::Output { address, datum, amount, optional: self.optional, + index, }) } } diff --git a/crates/tx3-lang/src/parsing.rs b/crates/tx3-lang/src/parsing.rs index 2b34fc1c..473f76a1 100644 --- a/crates/tx3-lang/src/parsing.rs +++ b/crates/tx3-lang/src/parsing.rs @@ -569,6 +569,11 @@ impl AstNode for OutputBlockField { let x = OutputBlockField::Datum(DataExpr::parse(pair)?.into()); Ok(x) } + Rule::output_block_index => { + let pair = pair.into_inner().next().unwrap(); + let x = OutputBlockField::Index(DataExpr::parse(pair)?.into()); + Ok(x) + } x => unreachable!("Unexpected rule in output_block_field: {:?}", x), } } @@ -578,6 +583,7 @@ impl AstNode for OutputBlockField { Self::To(x) => x.span(), Self::Amount(x) => x.span(), Self::Datum(x) => x.span(), + Self::Index(x) => x.span(), } } } @@ -2817,4 +2823,6 @@ mod tests { test_parsing!(list_concat); test_parsing!(buidler_fest_2026); + + test_parsing!(index_outputs); } diff --git a/crates/tx3-lang/src/tx3.pest b/crates/tx3-lang/src/tx3.pest index a01471ff..4ec470b3 100644 --- a/crates/tx3-lang/src/tx3.pest +++ b/crates/tx3-lang/src/tx3.pest @@ -247,11 +247,13 @@ reference_block = { output_block_to = { "to" ~ ":" ~ data_expr } output_block_amount = { "amount" ~ ":" ~ data_expr } output_block_datum = { "datum" ~ ":" ~ data_expr } +output_block_index = { "index" ~ ":" ~ data_expr } output_block_field = _{ output_block_to | output_block_amount | - output_block_datum + output_block_datum | + output_block_index } output_block = { @@ -374,6 +376,7 @@ cardano_publish_block_amount = { "amount" ~ ":" ~ data_expr } cardano_publish_block_datum = { "datum" ~ ":" ~ data_expr } cardano_publish_block_version = { "version" ~ ":" ~ data_expr } cardano_publish_block_script = { "script" ~ ":" ~ data_expr } +cardano_publish_block_index = { "index" ~ ":" ~ data_expr } cardano_publish_block_field = _{ @@ -381,7 +384,8 @@ cardano_publish_block_field = _{ cardano_publish_block_amount | cardano_publish_block_datum | cardano_publish_block_version | - cardano_publish_block_script + cardano_publish_block_script | + cardano_publish_block_index } cardano_publish_block = { diff --git a/crates/tx3-tir/src/model/v1beta0.rs b/crates/tx3-tir/src/model/v1beta0.rs index 1d0ad338..e3e4b78c 100644 --- a/crates/tx3-tir/src/model/v1beta0.rs +++ b/crates/tx3-tir/src/model/v1beta0.rs @@ -305,6 +305,8 @@ pub struct Output { pub datum: Expression, pub amount: Expression, pub optional: bool, + #[serde(default)] + pub index: Expression, } #[derive(Serialize, Deserialize, Debug, Clone)] @@ -522,6 +524,7 @@ impl Node for Output { datum: self.datum.apply(visitor)?, amount: self.amount.apply(visitor)?, optional: self.optional, + index: self.index, }; Ok(visited) diff --git a/crates/tx3-tir/src/reduce/mod.rs b/crates/tx3-tir/src/reduce/mod.rs index eb60cf4c..4666a700 100644 --- a/crates/tx3-tir/src/reduce/mod.rs +++ b/crates/tx3-tir/src/reduce/mod.rs @@ -1159,6 +1159,7 @@ impl Composite for Output { datum: f(self.datum)?, amount: f(self.amount)?, optional: self.optional, + index: self.index, }) } } diff --git a/examples/asteria.move_ship.tir b/examples/asteria.move_ship.tir index b3cf5322..450cccf4 100644 --- a/examples/asteria.move_ship.tir +++ b/examples/asteria.move_ship.tir @@ -1168,7 +1168,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -1262,7 +1263,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/buidler_fest_2026.buy_ticket.tir b/examples/buidler_fest_2026.buy_ticket.tir index 28354443..40a89297 100644 --- a/examples/buidler_fest_2026.buy_ticket.tir +++ b/examples/buidler_fest_2026.buy_ticket.tir @@ -324,7 +324,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -458,7 +459,8 @@ } } }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -486,7 +488,8 @@ } ] }, - "optional": false + "optional": false, + "index": "None" } ], "validity": { diff --git a/examples/burn.burn_stuff.tir b/examples/burn.burn_stuff.tir index 3a8a4e89..658b00d0 100644 --- a/examples/burn.burn_stuff.tir +++ b/examples/burn.burn_stuff.tir @@ -244,7 +244,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/cardano_witness.mint_from_native_script.tir b/examples/cardano_witness.mint_from_native_script.tir index 95e1c83e..49e37c57 100644 --- a/examples/cardano_witness.mint_from_native_script.tir +++ b/examples/cardano_witness.mint_from_native_script.tir @@ -134,7 +134,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/cardano_witness.mint_from_plutus.tir b/examples/cardano_witness.mint_from_plutus.tir index c0f4530f..272b799d 100644 --- a/examples/cardano_witness.mint_from_plutus.tir +++ b/examples/cardano_witness.mint_from_plutus.tir @@ -134,7 +134,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, @@ -202,9 +203,6 @@ { "name": "plutus_witness", "data": { - "version": { - "Number": 3 - }, "script": { "Bytes": [ 81, @@ -226,6 +224,9 @@ 174, 105 ] + }, + "version": { + "Number": 3 } } } diff --git a/examples/donation.mint_from_plutus.tir b/examples/donation.mint_from_plutus.tir index 4aacfdf6..265a84b0 100644 --- a/examples/donation.mint_from_plutus.tir +++ b/examples/donation.mint_from_plutus.tir @@ -198,7 +198,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/env_vars.mint_from_env.tir b/examples/env_vars.mint_from_env.tir index b2b72adb..a096c753 100644 --- a/examples/env_vars.mint_from_env.tir +++ b/examples/env_vars.mint_from_env.tir @@ -72,7 +72,8 @@ } ] }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/faucet.claim_with_password.tir b/examples/faucet.claim_with_password.tir index d1f3874b..06cc1000 100644 --- a/examples/faucet.claim_with_password.tir +++ b/examples/faucet.claim_with_password.tir @@ -134,7 +134,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/index_outputs.ast b/examples/index_outputs.ast new file mode 100644 index 00000000..ce79630f --- /dev/null +++ b/examples/index_outputs.ast @@ -0,0 +1,488 @@ +{ + "env": null, + "txs": [ + { + "name": { + "value": "sorted_publish_plutus", + "span": { + "dummy": false, + "start": 35, + "end": 56 + } + }, + "parameters": { + "parameters": [ + { + "name": { + "value": "quantity", + "span": { + "dummy": false, + "start": 62, + "end": 70 + } + }, + "type": "Int" + } + ], + "span": { + "dummy": false, + "start": 56, + "end": 77 + } + }, + "locals": null, + "references": [], + "inputs": [ + { + "name": "source", + "many": false, + "fields": [ + { + "From": { + "Identifier": { + "value": "Sender", + "span": { + "dummy": false, + "start": 113, + "end": 119 + } + } + } + }, + { + "MinAmount": { + "AddOp": { + "lhs": { + "AddOp": { + "lhs": { + "AddOp": { + "lhs": { + "FnCall": { + "callee": { + "value": "Ada", + "span": { + "dummy": false, + "start": 141, + "end": 144 + } + }, + "args": [ + { + "Identifier": { + "value": "quantity", + "span": { + "dummy": false, + "start": 145, + "end": 153 + } + } + } + ], + "span": { + "dummy": false, + "start": 141, + "end": 154 + } + } + }, + "rhs": { + "FnCall": { + "callee": { + "value": "min_utxo", + "span": { + "dummy": false, + "start": 157, + "end": 165 + } + }, + "args": [ + { + "Identifier": { + "value": "funds", + "span": { + "dummy": false, + "start": 166, + "end": 171 + } + } + } + ], + "span": { + "dummy": false, + "start": 157, + "end": 172 + } + } + }, + "span": { + "dummy": false, + "start": 155, + "end": 156 + } + } + }, + "rhs": { + "FnCall": { + "callee": { + "value": "min_utxo", + "span": { + "dummy": false, + "start": 175, + "end": 183 + } + }, + "args": [ + { + "Identifier": { + "value": "funds_rep", + "span": { + "dummy": false, + "start": 184, + "end": 193 + } + } + } + ], + "span": { + "dummy": false, + "start": 175, + "end": 194 + } + } + }, + "span": { + "dummy": false, + "start": 173, + "end": 174 + } + } + }, + "rhs": { + "Identifier": { + "value": "fees", + "span": { + "dummy": false, + "start": 197, + "end": 201 + } + } + }, + "span": { + "dummy": false, + "start": 195, + "end": 196 + } + } + } + } + ], + "span": { + "dummy": false, + "start": 84, + "end": 208 + } + } + ], + "outputs": [ + { + "name": { + "value": "funds", + "span": { + "dummy": false, + "start": 402, + "end": 407 + } + }, + "optional": false, + "fields": [ + { + "To": { + "Identifier": { + "value": "Sender", + "span": { + "dummy": false, + "start": 422, + "end": 428 + } + } + } + }, + { + "Amount": { + "FnCall": { + "callee": { + "value": "min_utxo", + "span": { + "dummy": false, + "start": 446, + "end": 454 + } + }, + "args": [ + { + "Identifier": { + "value": "funds", + "span": { + "dummy": false, + "start": 455, + "end": 460 + } + } + } + ], + "span": { + "dummy": false, + "start": 446, + "end": 461 + } + } + } + }, + { + "Index": { + "Number": 0 + } + } + ], + "span": { + "dummy": false, + "start": 395, + "end": 486 + } + }, + { + "name": { + "value": "funds_rep", + "span": { + "dummy": false, + "start": 499, + "end": 508 + } + }, + "optional": false, + "fields": [ + { + "To": { + "Identifier": { + "value": "Sender", + "span": { + "dummy": false, + "start": 523, + "end": 529 + } + } + } + }, + { + "Amount": { + "SubOp": { + "lhs": { + "SubOp": { + "lhs": { + "Identifier": { + "value": "source", + "span": { + "dummy": false, + "start": 547, + "end": 553 + } + } + }, + "rhs": { + "FnCall": { + "callee": { + "value": "Ada", + "span": { + "dummy": false, + "start": 556, + "end": 559 + } + }, + "args": [ + { + "Identifier": { + "value": "quantity", + "span": { + "dummy": false, + "start": 560, + "end": 568 + } + } + } + ], + "span": { + "dummy": false, + "start": 556, + "end": 569 + } + } + }, + "span": { + "dummy": false, + "start": 554, + "end": 555 + } + } + }, + "rhs": { + "Identifier": { + "value": "fees", + "span": { + "dummy": false, + "start": 572, + "end": 576 + } + } + }, + "span": { + "dummy": false, + "start": 570, + "end": 571 + } + } + } + } + ], + "span": { + "dummy": false, + "start": 492, + "end": 583 + } + } + ], + "validity": null, + "mints": [], + "burns": [], + "signers": null, + "adhoc": [ + { + "Cardano": { + "Publish": { + "name": null, + "fields": [ + { + "To": { + "Identifier": { + "value": "Receiver", + "span": { + "dummy": false, + "start": 249, + "end": 257 + } + } + } + }, + { + "Amount": { + "FnCall": { + "callee": { + "value": "Ada", + "span": { + "dummy": false, + "start": 275, + "end": 278 + } + }, + "args": [ + { + "Identifier": { + "value": "quantity", + "span": { + "dummy": false, + "start": 279, + "end": 287 + } + } + } + ], + "span": { + "dummy": false, + "start": 275, + "end": 288 + } + } + } + }, + { + "Version": { + "Number": 3 + } + }, + { + "Script": { + "HexString": { + "value": "5101010023259800a518a4d136564004ae69", + "span": { + "dummy": false, + "start": 326, + "end": 364 + } + } + } + }, + { + "Index": { + "Number": 1 + } + } + ], + "span": { + "dummy": false, + "start": 227, + "end": 389 + } + } + } + } + ], + "span": { + "dummy": false, + "start": 32, + "end": 585 + }, + "collateral": [], + "metadata": null + } + ], + "types": [], + "aliases": [], + "assets": [], + "parties": [ + { + "name": { + "value": "Sender", + "span": { + "dummy": false, + "start": 6, + "end": 12 + } + }, + "span": { + "dummy": false, + "start": 0, + "end": 13 + } + }, + { + "name": { + "value": "Receiver", + "span": { + "dummy": false, + "start": 21, + "end": 29 + } + }, + "span": { + "dummy": false, + "start": 15, + "end": 30 + } + } + ], + "policies": [], + "span": { + "dummy": false, + "start": 0, + "end": 586 + } +} \ No newline at end of file diff --git a/examples/index_outputs.tx3 b/examples/index_outputs.tx3 new file mode 100644 index 00000000..6fe97597 --- /dev/null +++ b/examples/index_outputs.tx3 @@ -0,0 +1,31 @@ +party Sender; + +party Receiver; + +tx sorted_publish_plutus( + quantity: Int +) { + input source { + from: Sender, + min_amount: Ada(quantity) + min_utxo(funds) + min_utxo(funds_rep) + fees, + } + + cardano::publish { + to: Receiver, + amount: Ada(quantity), + version: 3, + script: 0x5101010023259800a518a4d136564004ae69, + index: 1, + } + + output funds { + to: Sender, + amount: min_utxo(funds), + index: 0, + } + + output funds_rep { + to: Sender, + amount: source - Ada(quantity) - fees, + } +} diff --git a/examples/input_datum.increase_counter.tir b/examples/input_datum.increase_counter.tir index f46c0176..47ab847d 100644 --- a/examples/input_datum.increase_counter.tir +++ b/examples/input_datum.increase_counter.tir @@ -166,7 +166,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/lang_tour.my_tx.tir b/examples/lang_tour.my_tx.tir index 525dcb75..044b0e84 100644 --- a/examples/lang_tour.my_tx.tir +++ b/examples/lang_tour.my_tx.tir @@ -534,7 +534,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": { @@ -666,6 +667,12 @@ { "name": "withdrawal", "data": { + "redeemer": { + "Struct": { + "constructor": 0, + "fields": [] + } + }, "amount": { "Number": 100 }, @@ -676,18 +683,15 @@ "Address" ] } - }, - "redeemer": { - "Struct": { - "constructor": 0, - "fields": [] - } } } }, { "name": "plutus_witness", "data": { + "version": { + "Number": 2 + }, "script": { "Bytes": [ 171, @@ -696,9 +700,6 @@ 18, 52 ] - }, - "version": { - "Number": 2 } } }, diff --git a/examples/list_concat.concat_list.tir b/examples/list_concat.concat_list.tir index 2c78d058..672e7130 100644 --- a/examples/list_concat.concat_list.tir +++ b/examples/list_concat.concat_list.tir @@ -128,7 +128,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/local_vars.mint_from_local.tir b/examples/local_vars.mint_from_local.tir index 03853938..81358783 100644 --- a/examples/local_vars.mint_from_local.tir +++ b/examples/local_vars.mint_from_local.tir @@ -77,7 +77,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/map.transfer.tir b/examples/map.transfer.tir index 99a17871..241be073 100644 --- a/examples/map.transfer.tir +++ b/examples/map.transfer.tir @@ -72,7 +72,8 @@ } ] }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -191,7 +192,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/min_utxo.transfer_min.tir b/examples/min_utxo.transfer_min.tir index 8e5d4184..c6c10d38 100644 --- a/examples/min_utxo.transfer_min.tir +++ b/examples/min_utxo.transfer_min.tir @@ -76,7 +76,8 @@ } } }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -163,7 +164,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/reference_script.publish_native.tir b/examples/reference_script.publish_native.tir index 90fdd3b9..30f6c7a9 100644 --- a/examples/reference_script.publish_native.tir +++ b/examples/reference_script.publish_native.tir @@ -127,7 +127,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, @@ -147,6 +148,17 @@ 0 ] }, + "version": { + "Number": 0 + }, + "to": { + "EvalParam": { + "ExpectValue": [ + "receiver", + "Address" + ] + } + }, "amount": { "Assets": [ { @@ -162,17 +174,6 @@ } } ] - }, - "to": { - "EvalParam": { - "ExpectValue": [ - "receiver", - "Address" - ] - } - }, - "version": { - "Number": 0 } } } diff --git a/examples/reference_script.publish_plutus.tir b/examples/reference_script.publish_plutus.tir index 7506c0f5..e9ea1d62 100644 --- a/examples/reference_script.publish_plutus.tir +++ b/examples/reference_script.publish_plutus.tir @@ -127,7 +127,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, @@ -137,9 +138,6 @@ { "name": "cardano_publish", "data": { - "version": { - "Number": 3 - }, "amount": { "Assets": [ { @@ -178,6 +176,9 @@ 105 ] }, + "version": { + "Number": 3 + }, "to": { "EvalParam": { "ExpectValue": [ diff --git a/examples/swap.swap.tir b/examples/swap.swap.tir index c9a20a39..323372b4 100644 --- a/examples/swap.swap.tir +++ b/examples/swap.swap.tir @@ -249,7 +249,8 @@ } } }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -339,7 +340,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/transfer.transfer.tir b/examples/transfer.transfer.tir index d6750767..31f82603 100644 --- a/examples/transfer.transfer.tir +++ b/examples/transfer.transfer.tir @@ -72,7 +72,8 @@ } ] }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -155,7 +156,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/vesting.lock.tir b/examples/vesting.lock.tir index 5d9609db..166c7cf8 100644 --- a/examples/vesting.lock.tir +++ b/examples/vesting.lock.tir @@ -130,7 +130,8 @@ } ] }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -213,7 +214,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/vesting.unlock.tir b/examples/vesting.unlock.tir index 23f07fd2..4c41d0f8 100644 --- a/examples/vesting.unlock.tir +++ b/examples/vesting.unlock.tir @@ -210,7 +210,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, diff --git a/examples/withdrawal.transfer.tir b/examples/withdrawal.transfer.tir index facdbb3c..411954ab 100644 --- a/examples/withdrawal.transfer.tir +++ b/examples/withdrawal.transfer.tir @@ -72,7 +72,8 @@ } ] }, - "optional": false + "optional": false, + "index": "None" }, { "address": { @@ -155,7 +156,8 @@ ] } }, - "optional": false + "optional": false, + "index": "None" } ], "validity": null, @@ -173,14 +175,14 @@ ] } }, - "amount": { - "Number": 0 - }, "redeemer": { "Struct": { "constructor": 0, "fields": [] } + }, + "amount": { + "Number": 0 } } }