Skip to content

feat: support decoding multi-operation Stellar transactions#235

Open
Opulencechuks wants to merge 1 commit into
Toolbox-Lab:mainfrom
Opulencechuks:main
Open

feat: support decoding multi-operation Stellar transactions#235
Opulencechuks wants to merge 1 commit into
Toolbox-Lab:mainfrom
Opulencechuks:main

Conversation

@Opulencechuks

Copy link
Copy Markdown

This PR closes #228
Description
Previously, Prism assumed one operation per transaction, leading to incomplete or misleading output for transactions containing multiple operations. This pull request introduces support for multi-operation transaction decoding.

Key Changes
Core Library (crates/core/src/decode/mod.rs):
Decodes envelopeXdr using the stellar_xdr::curr::TransactionEnvelope struct to determine the exact number of operations (handling both regular and fee-bump transactions).
Iterates over all operation indices independently, producing a Vec instead of a single report.
Filters transaction logs and events per operation index so each operation's diagnosis is distinct.
CLI Commands (crates/cli/src/commands/decode.rs & inspect.rs):
Updated to handle Vec.
Clearly labels and renders each operation separately with a header (e.g., === Operation X ===) when a transaction contains multiple operations.
Prints transaction-level fee stats only once (associated with the first report).
Saves the resulting reports as a JSON array when the --save parameter is provided.

Decodes all operations in a transaction envelope independently, aggregating them into a list ordered by operation index. Updates both the decode and inspect CLI commands to output reports for each operation separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decode Every Operation in a Multi-Operation Transaction Separately

1 participant