From 6d1674b7be02de42f618400d37d0814de2c866eb Mon Sep 17 00:00:00 2001 From: Support Bot Date: Tue, 15 Sep 2026 17:36:50 +0000 Subject: [PATCH] fix(abstract-eth): preserve zero wallet version for CCR Pass wallet version zero from cross-chain recovery build responses into the transaction builder and cover legacy CCR signing responses in EthLike tests.\n\nWithout this, a version-zero wallet is treated as missing during recovery signing, so self-serve CCR signing can produce an invalid transaction for affected customer funds.\n\nTicket: SPT-452 Session-Id: 43a697ad-f056-41b1-855b-c82224af5734 Task-Id: 72246e14-040e-4132-9fef-4e56482d1b19 --- modules/abstract-eth/src/abstractEthLikeNewCoins.ts | 2 +- modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/abstract-eth/src/abstractEthLikeNewCoins.ts b/modules/abstract-eth/src/abstractEthLikeNewCoins.ts index c353f958f6..c2fffc2d63 100644 --- a/modules/abstract-eth/src/abstractEthLikeNewCoins.ts +++ b/modules/abstract-eth/src/abstractEthLikeNewCoins.ts @@ -1708,7 +1708,7 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin implem const txBuilder = this.getTransactionBuilder(params.common) as TransactionBuilder; const txHex = buildResponse.txHex; txBuilder.from(txHex); - if (buildResponse.walletVersion) { + if (buildResponse.walletVersion !== undefined) { // If walletVersion is provided, set it in the txBuilder txBuilder.walletVersion(buildResponse.walletVersion); } diff --git a/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts b/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts index 6567a2c895..45c9be86c0 100644 --- a/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts +++ b/modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts @@ -60,6 +60,7 @@ describe('EthLike coin tests', function () { const recoveryId = '0x1234567890abcdef'; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).get(`/${recoveryId}/buildtx`).reply(200, { txHex: mockData.ccr[coin.name].txHex, + walletVersion: 0, }); const walletPassphrase = TestBitGo.V2.TEST_RECOVERY_PASSCODE as string; const params = { @@ -75,6 +76,7 @@ describe('EthLike coin tests', function () { const recoveryId = '0x1234567890abcdef'; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).get(`/${recoveryId}/buildtx`).reply(200, { txHex: mockData.ccr[coin.name].txHex, + walletVersion: 0, }); nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).post(`/${recoveryId}/sign`).reply(200, { coin: coin.name, @@ -96,6 +98,7 @@ describe('EthLike coin tests', function () { const recoveryId = '0x1234567890abcdef'; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`)).get(`/${recoveryId}/buildtx`).reply(200, { txHex: mockData.ccr[coin.name].txHex, + walletVersion: 0, }); const params = { recoveryId, @@ -112,7 +115,7 @@ describe('EthLike coin tests', function () { coin: coin.name, txHex: mockData.ccr[coin.name].txHex, txid: mockData.ccr[coin.name].txid, - walletVersion: 1, + walletVersion: 0, }; nock(bitgo.microservicesUrl(`/api/recovery/v1/crosschain`))