Skip to content

Commit 538e14f

Browse files
Merge pull request #5236 from BitGo/WP-3257
fix(sdk-core): fix MPCv2 SMC wallet generation
2 parents ced1427 + 4782337 commit 538e14f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@ describe('V2 Wallets:', function () {
976976
keyType: 'tss',
977977
commonKeychain,
978978
derivedFromParentWithSeed: '37',
979+
isMPCv2: true,
979980
})
980981
.times(1)
981982
.reply(200, {
@@ -991,6 +992,7 @@ describe('V2 Wallets:', function () {
991992
keyType: 'tss',
992993
commonKeychain,
993994
derivedFromParentWithSeed: '37',
995+
isMPCv2: true,
994996
})
995997
.times(1)
996998
.reply(200, {

modules/sdk-core/src/bitgo/wallet/wallets.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,11 +1038,12 @@ export class Wallets implements IWallets {
10381038
const reqId = new RequestTracer();
10391039
this.bitgo.setRequestTracer(reqId);
10401040

1041+
let multisigTypeVersion: 'MPCv2' | undefined;
10411042
if (multisigType === 'tss' && this.baseCoin.getMPCAlgorithm() === 'ecdsa') {
10421043
const tssSettings: TssSettings = await this.bitgo
10431044
.get(this.bitgo.microservicesUrl('/api/v2/tss/settings'))
10441045
.result();
1045-
const multisigTypeVersion =
1046+
multisigTypeVersion =
10461047
tssSettings.coinSettings[this.baseCoin.getFamily()]?.walletCreationSettings?.coldMultiSigTypeVersion;
10471048
walletVersion = this.determineEcdsaMpcWalletVersion(walletVersion, multisigTypeVersion);
10481049
}
@@ -1071,6 +1072,7 @@ export class Wallets implements IWallets {
10711072
keyType: 'tss',
10721073
commonKeychain: commonKeychain,
10731074
derivedFromParentWithSeed: coldDerivationSeed,
1075+
isMPCv2: multisigTypeVersion === 'MPCv2' ? true : undefined,
10741076
};
10751077
const userKeychain = await this.baseCoin.keychains().add(userKeychainParams);
10761078

@@ -1079,6 +1081,7 @@ export class Wallets implements IWallets {
10791081
keyType: 'tss',
10801082
commonKeychain: commonKeychain,
10811083
derivedFromParentWithSeed: coldDerivationSeed,
1084+
isMPCv2: multisigTypeVersion === 'MPCv2' ? true : undefined,
10821085
};
10831086

10841087
const backupKeychain = await this.baseCoin.keychains().add(backupKeyChainParams);

0 commit comments

Comments
 (0)