Skip to content

Commit 5717147

Browse files
committed
fix(sdk-core): remove filter from prebuild validation
Ticket: WP-5945
1 parent ad3c6c4 commit 5717147

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ describe('Verify string type is used for value of unspent', function () {
6060
);
6161

6262
sinon.stub(wallet, 'signTransaction').resolves({});
63+
sinon.stub(wallet.baseCoin, 'verifyTransaction').resolves();
6364

6465
const sendScope = nock(bgUrl)
6566
.post(`/api/v2/${wallet.coin()}/wallet/${wallet.id()}/tx/send`, { type: manageUnspentType })

modules/sdk-core/src/bitgo/wallet/wallet.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -742,24 +742,22 @@ export class Wallet implements IWallet {
742742
// Validate that the platform-built transaction matches user parameters
743743
const txPrebuilds = Array.isArray(buildResponse) ? buildResponse : [buildResponse];
744744
await Promise.all(
745-
txPrebuilds
746-
.filter((txPrebuild) => txPrebuild.txHex)
747-
.map((txPrebuild) =>
748-
this.baseCoin.verifyTransaction({
749-
txParams: params,
750-
txPrebuild,
751-
wallet: this,
752-
verification: {
753-
...(params.verification ?? {}),
754-
keychains: {
755-
user: keychains[0],
756-
backup: keychains[1],
757-
bitgo: keychains[2],
758-
},
745+
txPrebuilds.map((txPrebuild) =>
746+
this.baseCoin.verifyTransaction({
747+
txParams: params,
748+
txPrebuild,
749+
wallet: this,
750+
verification: {
751+
...(params.verification ?? {}),
752+
keychains: {
753+
user: keychains[0],
754+
backup: keychains[1],
755+
bitgo: keychains[2],
759756
},
760-
reqId,
761-
})
762-
)
757+
},
758+
reqId,
759+
})
760+
)
763761
);
764762

765763
const transactionParams = {

0 commit comments

Comments
 (0)