@@ -3443,26 +3443,28 @@ describe('SOL:', function () {
34433443 result . should . equal ( true ) ;
34443444 } ) ;
34453445
3446- it ( 'should return false for address with incorrect keychain' , async function ( ) {
3446+ it ( 'should throw error for address with incorrect keychain' , async function ( ) {
34473447 const address = '7YAesfwPk41VChUgr65bm8FEep7ymWqLSW5rpYB5zZPY' ;
34483448 const wrongKeychain =
34493449 '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' ;
34503450 const index = '1' ;
34513451 const keychains = [ { id : '1' , type : 'tss' as const , commonKeychain : wrongKeychain } ] ;
34523452
3453- const result = await basecoin . isWalletAddress ( { keychains, address, index } ) ;
3454- result . should . equal ( false ) ;
3453+ await assert . rejects ( async ( ) => await basecoin . isWalletAddress ( { keychains, address, index } ) , {
3454+ message : `address validation failure: ${ address } is not a wallet address` ,
3455+ } ) ;
34553456 } ) ;
34563457
3457- it ( 'should return false for address with incorrect index' , async function ( ) {
3458+ it ( 'should throw error for address with incorrect index' , async function ( ) {
34583459 const address = '7YAesfwPk41VChUgr65bm8FEep7ymWqLSW5rpYB5zZPY' ;
34593460 const commonKeychain =
34603461 '8ea32ecacfc83effbd2e2790ee44fa7c59b4d86c29a12f09fb613d8195f93f4e21875cad3b98adada40c040c54c3569467df41a020881a6184096378701862bd' ;
34613462 const wrongIndex = '999' ;
34623463 const keychains = [ { id : '1' , type : 'tss' as const , commonKeychain } ] ;
34633464
3464- const result = await basecoin . isWalletAddress ( { keychains, address, index : wrongIndex } ) ;
3465- result . should . equal ( false ) ;
3465+ await assert . rejects ( async ( ) => await basecoin . isWalletAddress ( { keychains, address, index : wrongIndex } ) , {
3466+ message : `address validation failure: ${ address } is not a wallet address` ,
3467+ } ) ;
34663468 } ) ;
34673469
34683470 it ( 'should throw error for invalid address' , async function ( ) {
0 commit comments