feat: support decoding multi-operation Stellar transactions#235
Open
Opulencechuks wants to merge 1 commit into
Open
feat: support decoding multi-operation Stellar transactions#235Opulencechuks wants to merge 1 commit into
Opulencechuks wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 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.