@@ -3462,6 +3462,32 @@ describe('V2 Wallet:', function () {
34623462 args [ 1 ] ! . should . equal ( 'full' ) ;
34633463 } ) ;
34643464
3465+ it ( 'should call prebuildTxWithIntent with the correct params for bridgeFunds' , async function ( ) {
3466+ const intentAmount = { value : '1000000' , symbol : 'thypeevm' } ;
3467+ const feeOptions = {
3468+ maxFeePerGas : 3000000000 ,
3469+ maxPriorityFeePerGas : 2000000000 ,
3470+ } ;
3471+
3472+ const prebuildTxWithIntent = sandbox . stub ( ECDSAUtils . EcdsaUtils . prototype , 'prebuildTxWithIntent' ) ;
3473+ prebuildTxWithIntent . resolves ( txRequestFull ) ;
3474+
3475+ await tssEthWallet . prebuildTransaction ( {
3476+ reqId,
3477+ type : 'bridgeFunds' ,
3478+ intentAmount,
3479+ feeOptions,
3480+ } ) ;
3481+
3482+ sinon . assert . calledOnce ( prebuildTxWithIntent ) ;
3483+ const args = prebuildTxWithIntent . args [ 0 ] ;
3484+ args [ 0 ] ! . intentType . should . equal ( 'bridgeFunds' ) ;
3485+ args [ 0 ] ! . amount ! . should . deepEqual ( intentAmount ) ;
3486+ args [ 0 ] ! . feeOptions ! . should . deepEqual ( feeOptions ) ;
3487+ args [ 0 ] ! . should . not . have . property ( 'recipients' ) ;
3488+ args [ 1 ] ! . should . equal ( 'full' ) ;
3489+ } ) ;
3490+
34653491 it ( 'should call prebuildTxWithIntent with the correct feeOptions when passing using the legacy format' , async function ( ) {
34663492 const recipients = [
34673493 {
@@ -3722,6 +3748,27 @@ describe('V2 Wallet:', function () {
37223748 intent . intentType . should . equal ( 'fillNonce' ) ;
37233749 } ) ;
37243750
3751+ it ( 'populate intent should return valid bridgeFunds intent' , async function ( ) {
3752+ const mpcUtils = new ECDSAUtils . EcdsaUtils ( bitgo , bitgo . coin ( 'hteth' ) ) ;
3753+ const amount = { value : '1000000' , symbol : 'thypeevm' } ;
3754+ const feeOptions = {
3755+ maxFeePerGas : 3000000000 ,
3756+ maxPriorityFeePerGas : 2000000000 ,
3757+ } ;
3758+
3759+ const intent = mpcUtils . populateIntent ( bitgo . coin ( 'hteth' ) , {
3760+ reqId,
3761+ intentType : 'bridgeFunds' ,
3762+ amount,
3763+ feeOptions,
3764+ } ) ;
3765+
3766+ intent . intentType . should . equal ( 'bridgeFunds' ) ;
3767+ intent . amount ! . should . deepEqual ( amount ) ;
3768+ intent . feeOptions ! . should . deepEqual ( feeOptions ) ;
3769+ intent . should . have . property ( 'recipients' , undefined ) ;
3770+ } ) ;
3771+
37253772 it ( 'should build a single recipient transfer transaction providing apiVersion parameter as "full" ' , async function ( ) {
37263773 const recipients = [
37273774 {
0 commit comments