283 keep order of chain specific outputs #285
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces the concept of a "declared index" for transaction outputs and Cardano publish directives, ensuring their original order is preserved throughout parsing, lowering, compilation, and serialization. The declared index is now tracked in the AST, IR, and final output structures, and is included in all relevant test fixtures and example files. This change enables deterministic ordering of outputs, which is critical for correct transaction construction and downstream processing.
Core logic and data model changes:
declared_indexfield toOutputBlockandCardanoPublishBlockin the AST, and ensured it is set during parsing to reflect the order in which outputs and directives are declared.declared_indexfor sorting outputs, ensuring the final transaction outputs are in the correct order.Parsing and lowering enhancements:
Modified the AST parsing logic for outputs and Cardano-specific blocks to assign and increment
declared_indexas each output or directive is encountered.Ensured that the lowering phase includes the
declared_indexin the IR representations.Test and example updates:
Updated all relevant test cases and example files to include the new
declared_indexfield, ensuring consistency and coverage for the new behavior.These changes collectively ensure that output and directive ordering is explicit and robust throughout the transaction lifecycle.