Skip to content

Commit 57d39ba

Browse files
fix(sdk-coin-tempo): update test fixtures for deriveUnhardened and 75% gas buffer
TEST_BACKUP_KEY updated to a full 130-char commonKeyChain (pubkey + chaincode) since buildUnsignedSweepTxnTSS now calls MPC.deriveUnhardened which requires both components. Test 2 balance raised from 15_000 to 50_000 to account for the 75% gas margin buffer raising the minimum required balance to 17_500. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> TICKET: CECHO-917
1 parent ffdc27d commit 57d39ba

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

  • modules/sdk-coin-tempo/test/unit

modules/sdk-coin-tempo/test/unit/tempo.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo/statics';
77
import { Tempo } from '../../src/tempo';
88
import { PATH_USD_ADDRESS } from '../../src/lib/constants';
99

10-
// secp256k1 generator point G — a well-known valid compressed public key
11-
const TEST_BACKUP_KEY = '0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798';
10+
// secp256k1 generator point G (33 bytes) + 32-byte chaincode — valid commonKeyChain for deriveUnhardened
11+
const TEST_BACKUP_KEY =
12+
'0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798' +
13+
'0000000000000000000000000000000000000000000000000000000000000001';
1214
const TEST_RECOVERY_DESTINATION = '0x80151ebf635e6ec8a5455258f617be6cda1fbd7e';
1315

1416
describe('Tempo Recovery', function () {
@@ -132,8 +134,8 @@ describe('Tempo Recovery', function () {
132134
}
133135

134136
it('deducts gasLimit × maxFeePerGas / 10^12 from pathUSD balance', async function () {
135-
// gasMargin = 1_000_000 * 20_000_000_000 / 10^12 = 20_000
136-
// sweepAmount = 1_000_000 - 20_000 = 980_000
137+
// gasMargin = 1_000_000 * 20_000_000_000 * 1.75 / 10^12 = 35_000
138+
// sweepAmount = 1_000_000 - 35_000 = 965_000
137139
stubBalanceAndNonce('1000000');
138140
const result = (await (basecoin as any).buildUnsignedSweepTxnTSS({
139141
backupKey: TEST_BACKUP_KEY,
@@ -146,9 +148,9 @@ describe('Tempo Recovery', function () {
146148
});
147149

148150
it('uses smaller margin when gasLimit is halved', async function () {
149-
// gasMargin = 500_000 * 20_000_000_000 / 10^12 = 10_000
150-
// sweepAmount = 15_000 - 10_000 = 5_000
151-
stubBalanceAndNonce('15000');
151+
// gasMargin = 500_000 * 20_000_000_000 * 1.75 / 10^12 = 17_500
152+
// sweepAmount = 50_000 - 17_500 = 32_500
153+
stubBalanceAndNonce('50000');
152154
const result = (await (basecoin as any).buildUnsignedSweepTxnTSS({
153155
backupKey: TEST_BACKUP_KEY,
154156
recoveryDestination: TEST_RECOVERY_DESTINATION,

0 commit comments

Comments
 (0)