Skip to content

Commit 5125153

Browse files
committed
fix(bitgo): add non-null assertions for buildParams in tests
TypeScript strict checks require null guards before accessing the optional buildParams property on PrebuildTransactionResult. WP-8015 TICKET: WP-8015
1 parent ac1e04c commit 5125153

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/bitgo/test/v2/unit/wallet.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,8 @@ describe('V2 Wallet:', function () {
18631863
sinon.stub(basecoin, 'getLatestBlockHeight').resolves(blockHeight);
18641864
sinon.stub(basecoin, 'postProcessPrebuild').callsFake((params) => Promise.resolve(params));
18651865
const txPrebuild = await wallet.prebuildTransaction({ ...params, reqId: reqId });
1866-
txPrebuild.buildParams.should.deepEqual(serverBuildParams);
1866+
should.exist(txPrebuild.buildParams);
1867+
txPrebuild.buildParams!.should.deepEqual(serverBuildParams);
18671868
});
18681869

18691870
it('should fall back to request params when server does not return buildParams', async function () {
@@ -1876,7 +1877,8 @@ describe('V2 Wallet:', function () {
18761877
sinon.stub(basecoin, 'getLatestBlockHeight').resolves(blockHeight);
18771878
sinon.stub(basecoin, 'postProcessPrebuild').callsFake((params) => Promise.resolve(params));
18781879
const txPrebuild = await wallet.prebuildTransaction({ ...params, reqId: reqId });
1879-
txPrebuild.buildParams.should.deepEqual(tbtcHotWalletDefaultParams);
1880+
should.exist(txPrebuild.buildParams);
1881+
txPrebuild.buildParams!.should.deepEqual(tbtcHotWalletDefaultParams);
18801882
});
18811883
});
18821884

0 commit comments

Comments
 (0)