fix(xrp): route MPT token enablement to enableMpt type via coin config [CGD-2013]#9167
Conversation
88d4575 to
42cc7e0
Compare
|
Claude finished @0xPrabh's task —— View job Code Review for XRP MPT Token Enablement FixOverviewThis PR successfully addresses the root cause of the MPT token enablement routing issue by adding proper type detection via coin configuration. The changes are well-structured and solve the hardcoded ✅ Positive Changes1. Core Interface Enhancement (
|
…oin config Add getEnableTokenType to TokenEnablementConfig so coins can return the correct transaction type. XRP uses this to return 'enableMpt' for XrpMptCoin tokens instead of hardcoded 'enabletoken', avoiding the IOU TrustSet path that throws for MPT tokens. Remove redundant xrpl.decode fallbacks in ripple.ts and xrp.ts since binary/rippleBinaryCodec are aliased to xrpl which supports all tx types including MPTokenAuthorize. Simplify express handleV2EnableTokens by removing the offline MPT/IOU split. Add unit tests for getTokenEnablementConfig and MPTokenAuthorize explainTransaction paths. TICKET: CGD-2013 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
42cc7e0 to
d274c8e
Compare
Summary
getEnableTokenTypetoTokenEnablementConfigso coins can return the correct tx type per token'enableMpt'forXrpMptCointokens and'enabletoken'for IOU — fixes thetxrp:feesec is not an XRP tokenerror caused by hardcoded'enabletoken'routing all enablements to the IOU/TrustSet pathxrplcodec fallbacks inripple.tsandxrp.tsforMPTokenAuthorize(unsupported byripple-binary-codec)handleV2EnableTokensin express — remove offline MPT/IOU split,sendTokenEnablementshandles bothRoot Cause
wallet.buildTokenEnablements()hardcodedtype = 'enabletoken', routing to wallet-platform's TrustSet path which callsgetXrpCurrencyFromTokenName→instanceof XrpCoin→ throws forXrpMptCoin.