Repository navigation
fix: Skip fee subtraction for sponsor-paid escrow transactions - #1383
Open
FawwazLawal wants to merge 1 commit into
Open
FawwazLawal wants to merge 1 commit into
FawwazLawal wants to merge 1 commit into
Conversation
When an escrow transaction has its fee sponsored via SponsorFlags, the fee is not deducted from the sender's balance. The displayed XRP delta and "amount after" values were still subtracting the fee, showing incorrect amounts. Use getSponsorScopes to check whether the fee is sponsor-paid and conditionally skip the subtraction in metaParser, EscrowFinish, and EscrowCancel Description components.
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.
High Level Overview of Change
When an escrow transaction has its fee sponsored via
SponsorFlags, the fee is not deducted from the sender's balance. The explorer was still subtracting the fee when computing XRP deltas and "amount after" values, showing incorrect amounts for sponsor-paid escrows.Context of Change
The sponsor-fee check pattern already exists in
SimpleTab.tsxandDetailTabusinggetSponsorScopes(tx.SponsorFlags).includes('fee'). This fix applies the same pattern to three locations that were missing it:metaParser.tsxline 107:findXRPAmountfee subtraction now wrapped in a!feeSponsoredguardEscrowFinish/Description.tsxline 49: conditional fee subtraction in the displayed amountEscrowCancel/Description.tsxline 48: same pattern as EscrowFinishType of Change
Before / After
Before: Sponsor-paid escrow transactions show fee subtracted from the sender's XRP delta, even though the fee was paid by the sponsor.
After: When
getSponsorScopesindicates the fee scope is sponsored, the fee is not subtracted from the displayed amounts.Closes #1379