Skip to content

Commit c10a5d7

Browse files
Merge pull request #9121 from BitGo/fix/cecho-1451-flrp-custody-wallet-password
2 parents f509a08 + b73b34e commit c10a5d7

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

modules/bitgo/test/v2/unit/wallets.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,44 @@ describe('V2 Wallets:', function () {
810810
walletNock.isDone().should.be.true();
811811
});
812812

813+
it('should create a new FLRP TSS custodial wallet without requiring a passphrase', async function () {
814+
const keys = ['1', '2', '3'];
815+
const tflrp = bitgo.coin('tflrp');
816+
817+
const walletParams: GenerateWalletOptions = {
818+
label: 'flrp custodial wallet',
819+
enterprise: 'enterprise',
820+
type: 'custodial',
821+
// No multisigType specified — should default to 'tss' for FLRP
822+
// No passphrase — custodial wallets must not require one
823+
};
824+
825+
// FLRP is ECDSA, so generateCustodialMpcWallet fetches TSS settings
826+
nock('https://bitgo.fakeurl')
827+
.get('/api/v2/tss/settings')
828+
.reply(200, { coinSettings: { flrp: { walletCreationSettings: {} } } });
829+
830+
const walletNock = nock('https://bitgo.fakeurl')
831+
.post('/api/v2/tflrp/wallet/add')
832+
.times(1)
833+
.reply(200, { ...walletParams, multisigType: 'tss', keys });
834+
835+
const flrpWallets = new Wallets(bitgo, tflrp);
836+
837+
const res = await flrpWallets.generateWallet(walletParams);
838+
if (!isWalletWithKeychains(res)) {
839+
throw new Error('wallet missing required keychains');
840+
}
841+
res.wallet.label().should.equal(walletParams.label);
842+
should.equal(res.wallet.type(), walletParams.type);
843+
res.wallet.multisigType().should.equal('tss');
844+
res.userKeychain.id.should.equal(keys[0]);
845+
res.backupKeychain.id.should.equal(keys[1]);
846+
res.bitgoKeychain.id.should.equal(keys[2]);
847+
848+
walletNock.isDone().should.be.true();
849+
});
850+
813851
it('should create a new TSS SMC wallet', async function () {
814852
const commonKeychain = 'longstring';
815853
const seed = 'seed';

modules/sdk-coin-flrp/src/flrp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class Flrp extends BaseCoin {
6868

6969
/** inherited doc */
7070
getDefaultMultisigType(): MultisigType {
71-
return multisigTypes.onchain;
71+
return multisigTypes.tss;
7272
}
7373

7474
/** @inheritdoc */

modules/sdk-coin-flrp/test/unit/flrp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('Flrp test cases', function () {
6464
});
6565

6666
it('should return default multisig type', function () {
67-
basecoin.getDefaultMultisigType().should.equal('onchain');
67+
basecoin.getDefaultMultisigType().should.equal('tss');
6868
});
6969

7070
it('should support TSS', function () {

0 commit comments

Comments
 (0)