You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sdk-coin-xrp): partial-payment verify and explain fallthrough
Fix 4 CR-1406 §5.5 findings in modules/sdk-coin-xrp:
F1 partial payment (tfPartialPayment): explainTransaction and
explainPaymentTransaction now detect tfPartialPayment and, when metadata
is supplied, use meta.delivered_amount as the output amount instead of
the requested Amount. Without metadata, partialPayment: true is surfaced
on the explanation. verifyTransaction rejects tfPartialPayment prebuilds
(BitGo never builds them). Adds TF_PARTIAL_PAYMENT constant, distinct
from the numerically-identical REQUIRE_DESTINATION_TAG_FLAG.
F2 cross-currency verify: verifyTransaction no longer skips amount
comparison for object Amount (IssuedCurrencyAmount/MPTAmount). Adds
toBaseUnits using getBaseFactor() so display-unit Amount.value is
compared against base-unit recipient intent for both base XRP and tokens.
F3 explainTransaction fallthrough: adds explicit AccountDelete and
SignerListSet branches plus a default:throw, eliminating the silent
Payment-shaped fallthrough that produced undefined outputAmount/outputs
for AccountDelete recovery. Mirrors the safe switch in lib/transaction.ts.
F4 AMM enum: documents XrpTransactionType string values as public API
compared by downstream consumers, so AMM members can be added later
without breaking string comparisons across the SDK boundary.
Adds 8 unit tests covering all four fixes; updates 2 existing token
transfer tests that relied on the F2 skip.
Ticket: CSHLD-1452
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments