@@ -15,10 +15,6 @@ import {
1515import { UnlockLightningWalletBody , UnlockLightningWalletParams } from '../../../src/typedRoutes/api/v2/unlockWallet' ;
1616import { OfcSignPayloadBody } from '../../../src/typedRoutes/api/v2/ofcSignPayload' ;
1717import { CreateAddressBody , CreateAddressParams } from '../../../src/typedRoutes/api/v2/createAddress' ;
18- import {
19- KeychainChangePasswordBody ,
20- KeychainChangePasswordParams ,
21- } from '../../../src/typedRoutes/api/v2/keychainChangePassword' ;
2218
2319export function assertDecode < T > ( codec : t . Type < T , unknown > , input : unknown ) : T {
2420 const result = codec . decode ( input ) ;
@@ -247,24 +243,4 @@ describe('io-ts decode tests', function () {
247243 assertDecode ( t . type ( CreateAddressBody ) , { eip1559 : { maxFeePerGas : 1 , maxPriorityFeePerGas : 1 } } ) ;
248244 assertDecode ( t . type ( CreateAddressBody ) , { } ) ;
249245 } ) ;
250-
251- it ( 'express.keychain.changePassword' , function ( ) {
252- // missing id
253- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordParams ) , { coin : 'btc' } ) ) ;
254- // invalid coin type
255- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordParams ) , { coin : 123 , id : 'abc' } ) ) ;
256- // valid params
257- assertDecode ( t . type ( KeychainChangePasswordParams ) , { coin : 'btc' , id : 'abc' } ) ;
258- // missing required fields
259- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordBody ) , { } ) ) ;
260- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordBody ) , { oldPassword : 'a' } ) ) ;
261- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordBody ) , { newPassword : 'b' } ) ) ;
262- // invalid types
263- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordBody ) , { oldPassword : 1 , newPassword : 'b' } ) ) ;
264- assert . throws ( ( ) => assertDecode ( t . type ( KeychainChangePasswordBody ) , { oldPassword : 'a' , newPassword : 2 } ) ) ;
265- // valid minimal
266- assertDecode ( t . type ( KeychainChangePasswordBody ) , { oldPassword : 'a' , newPassword : 'b' } ) ;
267- // valid with optional otp
268- assertDecode ( t . type ( KeychainChangePasswordBody ) , { oldPassword : 'a' , newPassword : 'b' , otp : '123456' } ) ;
269- } ) ;
270246} ) ;
0 commit comments