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.
@codeZe-us codeZe-us requested review from Emrys02 and codeZe-us and removed request for Emrys02 June 19, 2026 01:32

@codeZe-us codeZe-us left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Opulencechuks The FeeBump path in mod.rs is wrong, fb.tx.fee_bump_op doesn't exist, a fee bump transaction wraps a single inner TransactionV1Envelope so it should be fb.tx.inner_tx.operations.len(), and the operation label uses 0-based indexing (=== Operation 0 ===) which is confusing, consider labeling from 1 instead

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

2 participants