@@ -3,7 +3,6 @@ import 'should-http';
33import 'should-sinon' ;
44import 'should' ;
55import * as fs from 'fs' ;
6- import { Request } from 'express' ;
76import { BitGo , Coin , BaseCoin , Wallet , Wallets } from 'bitgo' ;
87import '../../lib/asserts' ;
98import { handleV2OFCSignPayload , handleV2OFCSignPayloadInExtSigningMode } from '../../../src/clientRoutes' ;
@@ -158,10 +157,14 @@ describe('With the handler to sign an arbitrary payload in external signing mode
158157 walletId,
159158 payload,
160159 } ,
160+ decoded : {
161+ walletId,
162+ payload,
163+ } ,
161164 config : {
162165 signerFileSystemPath : 'signerFileSystemPath' ,
163166 } ,
164- } as unknown as Request ;
167+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
165168
166169 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . resolvedWith ( expectedResponse ) ;
167170 readFileStub . should . be . calledOnceWith ( 'signerFileSystemPath' ) ;
@@ -195,10 +198,15 @@ describe('With the handler to sign an arbitrary payload in external signing mode
195198 payload,
196199 walletPassphrase : walletPassword ,
197200 } ,
201+ decoded : {
202+ walletId,
203+ payload,
204+ walletPassphrase : walletPassword ,
205+ } ,
198206 config : {
199207 signerFileSystemPath : 'signerFileSystemPath' ,
200208 } ,
201- } as unknown as Request ;
209+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
202210
203211 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . resolvedWith ( expectedResponse ) ;
204212 readFileStub . should . be . calledOnceWith ( 'signerFileSystemPath' ) ;
@@ -233,10 +241,15 @@ describe('With the handler to sign an arbitrary payload in external signing mode
233241 payload,
234242 walletPassphrase : walletPassword ,
235243 } ,
244+ decoded : {
245+ walletId,
246+ payload,
247+ walletPassphrase : walletPassword ,
248+ } ,
236249 config : {
237250 signerFileSystemPath : 'signerFileSystemPath' ,
238251 } ,
239- } as unknown as Request ;
252+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
240253
241254 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . resolvedWith ( expectedResponse ) ;
242255 readFileStub . should . be . calledOnceWith ( 'signerFileSystemPath' ) ;
@@ -260,7 +273,11 @@ describe('With the handler to sign an arbitrary payload in external signing mode
260273 walletId,
261274 payload,
262275 } ,
263- } as unknown as Request ;
276+ decoded : {
277+ walletId,
278+ payload,
279+ } ,
280+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
264281
265282 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . rejectedWith (
266283 'Could not find wallet passphrase WALLET_61f039aad587c2000745c687373e0fa9_PASSPHRASE in environment'
@@ -278,10 +295,14 @@ describe('With the handler to sign an arbitrary payload in external signing mode
278295 walletId,
279296 payload,
280297 } ,
298+ decoded : {
299+ walletId,
300+ payload,
301+ } ,
281302 config : {
282303 signerFileSystemPath : undefined ,
283304 } ,
284- } as unknown as Request ;
305+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
285306
286307 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . rejectedWith (
287308 'Missing required configuration: signerFileSystemPath'
@@ -301,10 +322,14 @@ describe('With the handler to sign an arbitrary payload in external signing mode
301322 walletId,
302323 payload,
303324 } ,
325+ decoded : {
326+ walletId,
327+ payload,
328+ } ,
304329 config : {
305330 signerFileSystemPath : 'signerFileSystemPath' ,
306331 } ,
307- } as unknown as Request ;
332+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
308333
309334 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . rejectedWith (
310335 "Error when trying to decrypt private key: INVALID: json decode: this isn't json!"
@@ -326,10 +351,14 @@ describe('With the handler to sign an arbitrary payload in external signing mode
326351 walletId,
327352 payload,
328353 } ,
354+ decoded : {
355+ walletId,
356+ payload,
357+ } ,
329358 config : {
330359 signerFileSystemPath : 'signerFileSystemPath' ,
331360 } ,
332- } as unknown as Request ;
361+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
333362
334363 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . rejectedWith (
335364 "Error when trying to decrypt private key: CORRUPT: password error - ccm: tag doesn't match"
@@ -349,10 +378,15 @@ describe('With the handler to sign an arbitrary payload in external signing mode
349378 payload,
350379 walletPassphrase : 'invalidPassphrase' ,
351380 } ,
381+ decoded : {
382+ walletId,
383+ payload,
384+ walletPassphrase : 'invalidPassphrase' ,
385+ } ,
352386 config : {
353387 signerFileSystemPath : 'signerFileSystemPath' ,
354388 } ,
355- } as unknown as Request ;
389+ } as unknown as ExpressApiRouteRequest < 'express.v2.ofc.extSignPayload' , 'post' > ;
356390
357391 await handleV2OFCSignPayloadInExtSigningMode ( req ) . should . be . rejectedWith (
358392 "Error when trying to decrypt private key: CORRUPT: password error - ccm: tag doesn't match"
0 commit comments