Skip to content

Commit 10e0dcc

Browse files
committed
test: edit integ tests for tx acceleration
Ticket: WCN-768
1 parent 04171a2 commit 10e0dcc

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/__tests__/integration/accelerate.integ.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ describe('Accelerate: EXTERNAL signing', () => {
6262
services.keyProvider.calls.filter((c) => c.path === '/sign').should.have.length(1);
6363
services.keyProvider.calls.filter((c) => c.path === '/key').should.have.length(0);
6464

65-
/** BitGo must receive tx/build, block/latest, and tx/send */
66-
services.bitgo.calls.filter((c) => c.path.endsWith('/tx/build')).should.have.length(1);
65+
/** BitGo must receive tx/build with the correct cpfpTxIds, block/latest, and tx/send */
66+
const buildCalls = services.bitgo.calls.filter((c) => c.path.endsWith('/tx/build'));
67+
buildCalls.should.have.length(1);
68+
const buildBody = buildCalls[0].body as { cpfpTxIds?: string[] };
69+
buildBody.should.have.property('cpfpTxIds').which.deepEqual([CPFP_TX_ID]);
70+
6771
services.bitgo.calls
6872
.filter((c) => c.path.endsWith('/public/block/latest'))
6973
.should.have.length(1);
@@ -127,7 +131,12 @@ describe('Accelerate: LOCAL signing', () => {
127131
services.keyProvider.calls.filter((c) => c.path === '/sign').should.have.length(0);
128132
services.keyProvider.calls.filter((c) => c.path.startsWith('/key/')).length.should.be.above(0);
129133

130-
services.bitgo.calls.filter((c) => c.path.endsWith('/tx/build')).should.have.length(1);
134+
/** BitGo must receive tx/build with the correct cpfpTxIds, block/latest, and tx/send */
135+
const buildCalls = services.bitgo.calls.filter((c) => c.path.endsWith('/tx/build'));
136+
buildCalls.should.have.length(1);
137+
const buildBody = buildCalls[0].body as { cpfpTxIds?: string[] };
138+
buildBody.should.have.property('cpfpTxIds').which.deepEqual([CPFP_TX_ID]);
139+
131140
services.bitgo.calls
132141
.filter((c) => c.path.endsWith('/public/block/latest'))
133142
.should.have.length(1);

src/__tests__/integration/helpers/mockBitgoServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type SendManyFixtureMethod = 'getWallet' | 'prebuildTx' | 'sendTx';
2525
type SupportedCoin = 'hteth' | 'tbtc';
2626
type CoinToFixtures<C extends SupportedCoin> = {
2727
[K in SendManyFixtureMethod]: `${K}.${C}`;
28-
} & { acceleratePrebuildTx: string };
28+
} & { acceleratePrebuildTx: `prebuildTx.accelerate.${C}` | `prebuildTx.${C}` };
2929

3030
/** Registry — add a new coin here to support it across all sendMany integ test routes */
3131
const COIN_FIXTURES: { [C in SupportedCoin]: CoinToFixtures<C> } = {

0 commit comments

Comments
 (0)