File tree Expand file tree Collapse file tree 2 files changed +24
-13
lines changed
sdk-core/src/bitgo/wallet Expand file tree Collapse file tree 2 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -1589,6 +1589,7 @@ describe('V2 Wallet:', function () {
15891589 'unsigned'
15901590 )
15911591 ) ;
1592+ psbts . forEach ( ( psbt ) => utxoLib . bitgo . addXpubsToPsbt ( psbt , rootWalletKey ) ) ;
15921593 const txHexes = psbts . map ( ( psbt ) => ( { txHex : psbt . toHex ( ) } ) ) ;
15931594
15941595 const nocks : nock . Scope [ ] = [ ] ;
@@ -1627,6 +1628,7 @@ describe('V2 Wallet:', function () {
16271628 rootWalletKey ,
16281629 'unsigned'
16291630 ) ;
1631+ utxoLib . bitgo . addXpubsToPsbt ( psbt , rootWalletKey ) ;
16301632
16311633 const nocks : nock . Scope [ ] = [ ] ;
16321634 nocks . push (
Original file line number Diff line number Diff line change @@ -735,24 +735,33 @@ export class Wallet implements IWallet {
735735 return buildResponse ;
736736 }
737737
738+ const keychains = ( await this . baseCoin
739+ . keychains ( )
740+ . getKeysForSigning ( { wallet : this , reqId } ) ) as unknown as Keychain [ ] ;
741+
738742 // Validate that the platform-built transaction matches user parameters
739743 const txPrebuilds = Array . isArray ( buildResponse ) ? buildResponse : [ buildResponse ] ;
740744 await Promise . all (
741- txPrebuilds . map ( ( txPrebuild ) =>
742- this . baseCoin . verifyTransaction ( {
743- txParams : params ,
744- txPrebuild,
745- wallet : this ,
746- verification : params . verification ?? { } ,
747- reqId,
748- } )
749- )
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+ } ,
759+ } ,
760+ reqId,
761+ } )
762+ )
750763 ) ;
751764
752- const keychains = ( await this . baseCoin
753- . keychains ( )
754- . getKeysForSigning ( { wallet : this , reqId } ) ) as unknown as Keychain [ ] ;
755-
756765 const transactionParams = {
757766 ...params ,
758767 keychain : keychains [ 0 ] ,
You can’t perform that action at this time.
0 commit comments