@@ -8,7 +8,7 @@ import { EXPORT_IN_C } from '../resources/transactionData/exportInC';
88import { EXPORT_IN_P } from '../resources/transactionData/exportInP' ;
99import { IMPORT_IN_P } from '../resources/transactionData/importInP' ;
1010import { IMPORT_IN_C } from '../resources/transactionData/importInC' ;
11- import { HalfSignedAccountTransaction , TransactionType } from '@bitgo/sdk-core' ;
11+ import { HalfSignedAccountTransaction , TransactionType , MPCAlgorithm } from '@bitgo/sdk-core' ;
1212import assert from 'assert' ;
1313
1414describe ( 'Flrp test cases' , function ( ) {
@@ -57,6 +57,14 @@ describe('Flrp test cases', function () {
5757 basecoin . getDefaultMultisigType ( ) . should . equal ( 'onchain' ) ;
5858 } ) ;
5959
60+ it ( 'should support TSS' , function ( ) {
61+ basecoin . supportsTss ( ) . should . equal ( true ) ;
62+ } ) ;
63+
64+ it ( 'should return ecdsa as MPC algorithm' , function ( ) {
65+ ( basecoin . getMPCAlgorithm ( ) as MPCAlgorithm ) . should . equal ( 'ecdsa' ) ;
66+ } ) ;
67+
6068 describe ( 'Keypairs:' , ( ) => {
6169 it ( 'should generate a keypair from random seed' , function ( ) {
6270 const keyPair = basecoin . generateKeyPair ( ) ;
@@ -499,14 +507,39 @@ describe('Flrp test cases', function () {
499507 isValid . should . be . true ( ) ;
500508 } ) ;
501509
502- it ( 'should throw for address with wrong number of keychains' , async ( ) => {
510+ it ( 'should verify MPC wallet address with single keychain' , async ( ) => {
511+ const address = SEED_ACCOUNT . addressTestnet ;
512+
513+ const isValid = await basecoin . isWalletAddress ( {
514+ address,
515+ keychains : [ { pub : SEED_ACCOUNT . publicKey } ] ,
516+ } ) ;
517+
518+ isValid . should . be . true ( ) ;
519+ } ) ;
520+
521+ it ( 'should reject MPC wallet address that does not match keychain' , async ( ) => {
503522 const address = SEED_ACCOUNT . addressTestnet ;
504523
505524 await assert . rejects (
506525 async ( ) =>
507526 basecoin . isWalletAddress ( {
508527 address,
509- keychains : [ { pub : SEED_ACCOUNT . publicKey } ] ,
528+ keychains : [ { pub : ACCOUNT_1 . publicKey } ] ,
529+ } ) ,
530+ / a d d r e s s v a l i d a t i o n f a i l u r e /
531+ ) ;
532+ } ) ;
533+
534+ it ( 'should throw for multisig address with wrong number of keychains' , async ( ) => {
535+ // Two tilde-separated addresses but only 2 keychains
536+ const address = SEED_ACCOUNT . addressTestnet + '~' + ACCOUNT_1 . addressTestnet ;
537+
538+ await assert . rejects (
539+ async ( ) =>
540+ basecoin . isWalletAddress ( {
541+ address,
542+ keychains : [ { pub : SEED_ACCOUNT . publicKey } , { pub : ACCOUNT_1 . publicKey } ] ,
510543 } ) ,
511544 / I n v a l i d k e y c h a i n s /
512545 ) ;
0 commit comments