@@ -1066,7 +1066,7 @@ describe('ETH:', function () {
1066
1066
basecoin = bitgo . coin ( 'hteth' ) as Hteth ;
1067
1067
} ) ;
1068
1068
1069
- it ( 'should generate an unsigned consolidation' , async function ( ) {
1069
+ it ( 'should generate an unsigned consolidation for wallet v5 ' , async function ( ) {
1070
1070
nock ( baseUrl )
1071
1071
. get ( '/api' )
1072
1072
. query ( mockData . getTxListRequest ( mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) . address ) )
@@ -1091,7 +1091,6 @@ describe('ETH:', function () {
1091
1091
1092
1092
const params = mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) ;
1093
1093
const consolidationResult = await ( basecoin as AbstractEthLikeNewCoins ) . recoverConsolidations ( {
1094
- userKey : params . commonKeyChain , // Box A Data
1095
1094
backupKey : params . commonKeyChain , // Box B Data
1096
1095
derivationSeed : params . derivationSeed , // Key Derivation Seed (optional)
1097
1096
recoveryDestination : params . recoveryDestination , // Destination Address
@@ -1131,6 +1130,70 @@ describe('ETH:', function () {
1131
1130
) ;
1132
1131
} ) ;
1133
1132
1133
+ it ( 'should generate an unsigned consolidation for wallet v6' , async function ( ) {
1134
+ nock ( baseUrl )
1135
+ . get ( '/api' )
1136
+ . query ( mockData . getTxListRequest ( mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) . address ) )
1137
+ . times ( 2 )
1138
+ . reply ( 200 , mockData . getTxListResponse ) ;
1139
+
1140
+ nock ( baseUrl )
1141
+ . get ( '/api' )
1142
+ . query ( mockData . getBalanceRequest ( mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) . address ) )
1143
+ . times ( 2 )
1144
+ . reply ( 200 , mockData . getBalanceResponse ) ;
1145
+ nock ( baseUrl )
1146
+ . get ( '/api' )
1147
+ . query (
1148
+ mockData . getBalanceRequest (
1149
+ mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) . walletContractAddress
1150
+ )
1151
+ )
1152
+ . reply ( 200 , mockData . getBalanceResponse ) ;
1153
+
1154
+ nock ( baseUrl ) . get ( '/api' ) . query ( mockData . getContractCallRequest ) . reply ( 200 , mockData . getContractCallResponse ) ;
1155
+
1156
+ const params = mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) ;
1157
+ const consolidationResult = await ( basecoin as AbstractEthLikeNewCoins ) . recoverConsolidations ( {
1158
+ userKey : params . commonKeyChain , // Box A Data
1159
+ backupKey : params . commonKeyChain , // Box B Data
1160
+ derivationSeed : params . derivationSeed , // Key Derivation Seed (optional)
1161
+ recoveryDestination : params . recoveryDestination , // Destination Address
1162
+ gasLimit : 200000 , // Gas Limit
1163
+ eip1559 : { maxFeePerGas : 20000000000 , maxPriorityFeePerGas : 10000000000 } , // Max Fee Per Gas and Max Priority Fee Per Gas
1164
+ isTss : true ,
1165
+ replayProtectionOptions : {
1166
+ chain : '42' ,
1167
+ hardfork : 'london' ,
1168
+ } ,
1169
+ bitgoFeeAddress : '0x33a42faea3c6e87021347e51700b48aaf49aa1e7' ,
1170
+ startingScanIndex : 1 ,
1171
+ endingScanIndex : 2 ,
1172
+ } ) ;
1173
+ should . exist ( consolidationResult ) ;
1174
+ const unsignedBuilConsolidation = consolidationResult as UnsignedBuilConsolidation ;
1175
+ unsignedBuilConsolidation . should . have . property ( 'transactions' ) ;
1176
+ unsignedBuilConsolidation . transactions . should . have . length ( 2 ) ;
1177
+
1178
+ const output = unsignedBuilConsolidation . transactions [ 0 ] as MPCSweepTxs ;
1179
+ output . should . have . property ( 'txRequests' ) ;
1180
+ output . txRequests [ 0 ] . should . have . property ( 'transactions' ) ;
1181
+ output . txRequests [ 0 ] . transactions . should . have . length ( 1 ) ;
1182
+ output . txRequests [ 0 ] . should . have . property ( 'walletCoin' ) ;
1183
+ output . txRequests [ 0 ] . transactions . should . have . length ( 1 ) ;
1184
+ output . txRequests [ 0 ] . transactions [ 0 ] . should . have . property ( 'unsignedTx' ) ;
1185
+ output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . should . have . property ( 'serializedTxHex' ) ;
1186
+ output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . should . have . property ( 'signableHex' ) ;
1187
+ output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . should . have . property ( 'derivationPath' ) ;
1188
+ output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . should . have . property ( 'feeInfo' ) ;
1189
+ output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . should . have . property ( 'parsedTx' ) ;
1190
+ const parsedTx = output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . parsedTx as { spendAmount : string } ;
1191
+ parsedTx . should . have . property ( 'spendAmount' ) ;
1192
+ ( output . txRequests [ 0 ] . transactions [ 0 ] . unsignedTx . parsedTx as { outputs : any [ ] } ) . should . have . property (
1193
+ 'outputs'
1194
+ ) ;
1195
+ } ) ;
1196
+
1134
1197
it ( 'should throw an error for invalid address' , async function ( ) {
1135
1198
const params = mockData . getBuildUnsignedSweepForSelfCustodyColdWalletsMPCv2 ( ) ;
1136
1199
params . recoveryDestination = 'invalidAddress' ;
0 commit comments