fix: handle serializedTxHex format in TSS verifyTransaction#8416
Merged
bhuvanr159 merged 1 commit intomasterfrom Apr 7, 2026
Merged
fix: handle serializedTxHex format in TSS verifyTransaction#8416bhuvanr159 merged 1 commit intomasterfrom
bhuvanr159 merged 1 commit intomasterfrom
Conversation
0184108 to
8f153a8
Compare
bhavidhingra
reviewed
Apr 7, 2026
8f153a8 to
d56758e
Compare
TICKET: CHALO-380
d56758e to
4a4f747
Compare
bhavidhingra
approved these changes
Apr 7, 2026
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.
TICKET: CHALO-380
Summary
Issue: TRX MPC wallet withdrawals were failing with
UtilsError: Number of contracts is greater than 1.Root cause:
verifyTransactionis called twice during the TSS signing flow:prebuildAndSignTransaction(wallet.ts:2480) —txHexisserializedTxHex, a full JSON string ({"txID":"...","raw_data":{...},"raw_data_hex":"..."})txHexissignableHex, raw protobuf hex bytesThe TSS branch only handled case 2 (protobuf hex). When case 1 passed a JSON string, the protobuf decoder produced garbage data and threw the error.
Fix: Detect the format by attempting
JSON.parse(txHex)— if it succeeds, extractraw_data_hexfrom the parsed JSON; if it fails, treattxHexas raw protobuf hex. This mirrors the pattern used by the builder's owngetTxReceipt()method inwrappedBuilder.ts.Test plan
serializedTxHex(JSON string) path — validates success and amount-mismatch failuresignableHex(protobuf) path still passnx run @bitgo/sdk-coin-trx:unit-test)tsc --noEmit)