@@ -71,10 +71,13 @@ describe('POST /api/:coin/wallet/recovery', () => {
7171 } )
7272 . set ( 'Authorization' , `Bearer ${ accessToken } ` )
7373 . send ( {
74- userPub : ethRecoveryData . userKey ,
75- backupPub : ethRecoveryData . backupKey ,
74+ multiSigRecoveryParams : {
75+ userPub : ethRecoveryData . userKey ,
76+ backupPub : ethRecoveryData . backupKey ,
77+ walletContractAddress : ethRecoveryData . walletContractAddress ,
78+ bitgoPub : undefined ,
79+ } ,
7680 apiKey : 'etherscan-api-token' ,
77- walletContractAddress : ethRecoveryData . walletContractAddress ,
7881 recoveryDestinationAddress : ethRecoveryData . recoveryDestinationAddress ,
7982 } ) ;
8083
@@ -89,10 +92,13 @@ describe('POST /api/:coin/wallet/recovery', () => {
8992 . post ( `/api/${ coin } /wallet/recovery` )
9093 . set ( 'Authorization' , `Bearer ${ accessToken } ` )
9194 . send ( {
92- userPub : ethRecoveryData . userKey ,
93- backupPub : ethRecoveryData . backupKey ,
95+ multiSigRecoveryParams : {
96+ userPub : ethRecoveryData . userKey ,
97+ backupPub : ethRecoveryData . backupKey ,
98+ walletContractAddress : undefined ,
99+ bitgoPub : undefined ,
100+ } ,
94101 apiKey : 'etherscan-api-token' ,
95- walletContractAddress : undefined ,
96102 recoveryDestinationAddress : ethRecoveryData . recoveryDestinationAddress ,
97103 } ) ;
98104
@@ -105,9 +111,12 @@ describe('POST /api/:coin/wallet/recovery', () => {
105111 . post ( `/api/${ coin } /wallet/recovery` )
106112 . set ( 'Authorization' , `Bearer ${ accessToken } ` )
107113 . send ( {
108- userPub : ethRecoveryData . userKey ,
109- backupPub : ethRecoveryData . backupKey ,
110- walletContractAddress : ethRecoveryData . walletContractAddress ,
114+ multiSigRecoveryParams : {
115+ userPub : ethRecoveryData . userKey ,
116+ backupPub : ethRecoveryData . backupKey ,
117+ walletContractAddress : ethRecoveryData . walletContractAddress ,
118+ bitgoPub : undefined ,
119+ } ,
111120 recoveryDestinationAddress : undefined ,
112121 } ) ;
113122
@@ -120,18 +129,24 @@ describe('POST /api/:coin/wallet/recovery', () => {
120129 . post ( `/api/${ coin } /wallet/recovery` )
121130 . set ( 'Authorization' , `Bearer ${ accessToken } ` )
122131 . send ( {
123- backupPub : ethRecoveryData . backupKey ,
124- walletContractAddress : ethRecoveryData . walletContractAddress ,
132+ multiSigRecoveryParams : {
133+ backupPub : ethRecoveryData . backupKey ,
134+ walletContractAddress : ethRecoveryData . walletContractAddress ,
135+ bitgoPub : undefined ,
136+ } ,
125137 recoveryDestinationAddress : undefined ,
126138 } ) ;
127139
128140 const responseNoBackupKey = await agent
129141 . post ( `/api/${ coin } /wallet/recovery` )
130142 . set ( 'Authorization' , `Bearer ${ accessToken } ` )
131143 . send ( {
132- userPub : ethRecoveryData . userKey ,
144+ multiSigRecoveryParams : {
145+ userPub : ethRecoveryData . userKey ,
146+ walletContractAddress : ethRecoveryData . walletContractAddress ,
147+ bitgoPub : undefined ,
148+ } ,
133149 apiKey : 'etherscan-api-token' ,
134- walletContractAddress : ethRecoveryData . walletContractAddress ,
135150 recoveryDestinationAddress : undefined ,
136151 } ) ;
137152
@@ -143,4 +158,18 @@ describe('POST /api/:coin/wallet/recovery', () => {
143158 responseNoBackupKey . body . should . have . property ( 'error' ) ;
144159 responseNoBackupKey . body . error . should . match ( / b a c k u p P u b / i) ;
145160 } ) ;
161+
162+ it ( 'should fail TSS recovery when common keychain is missing' , async ( ) => {
163+ const response = await agent
164+ . post ( `/api/${ coin } /wallet/recovery` )
165+ . set ( 'Authorization' , `Bearer ${ accessToken } ` )
166+ . send ( {
167+ isTssRecovery : true ,
168+ recoveryDestinationAddress : ethRecoveryData . recoveryDestinationAddress ,
169+ } ) ;
170+
171+ response . status . should . equal ( 400 ) ;
172+ response . body . should . have . property ( 'error' ) ;
173+ response . body . error . should . match ( / T S S r e c o v e r y p a r a m e t e r s a r e r e q u i r e d / i) ;
174+ } ) ;
146175} ) ;
0 commit comments