Skip to content

Commit 8a49c2d

Browse files
committed
fix(sdk-core): use decrypt/encrypt in createOfflineKeyGenRound1Share
BitGoBase.decrypt and .encrypt already return Promise<string>; the Async variants do not exist and caused a TS2339 build failure on master for every package depending on sdk-core. Ticket: WCI-1023
1 parent e9c3e74 commit 8a49c2d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

modules/sdk-core/src/bitgo/utils/tss/eddsa/eddsaMPCv2.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,7 @@ export class EddsaMPCv2Utils extends BaseEddsaUtils {
663663
const { walletPassphrase, encryptedUserGpgPrvKey, bitgoGpgPubKey, counterPartyGpgPubKey } = params;
664664
const partyId = params.partyId ?? MPCv2PartiesEnum.USER;
665665

666-
const decryptedGpgPrvKey = isV2Envelope(encryptedUserGpgPrvKey)
667-
? await this.bitgo.decryptAsync({ input: encryptedUserGpgPrvKey, password: walletPassphrase })
668-
: this.bitgo.decrypt({ input: encryptedUserGpgPrvKey, password: walletPassphrase });
666+
const decryptedGpgPrvKey = await this.bitgo.decrypt({ input: encryptedUserGpgPrvKey, password: walletPassphrase });
669667
const gpgPrvKey = await pgp.readPrivateKey({ armoredKey: decryptedGpgPrvKey });
670668

671669
const [, ownSk] = await MPSComms.extractEd25519KeyPair(gpgPrvKey);
@@ -692,7 +690,7 @@ export class EddsaMPCv2Utils extends BaseEddsaUtils {
692690
ownMsgFrom: msg1.from,
693691
});
694692

695-
const encryptedRound1Session = await this.bitgo.encryptAsync({
693+
const encryptedRound1Session = await this.bitgo.encrypt({
696694
input: sessionPayload,
697695
password: walletPassphrase,
698696
adata: `${EddsaMPCv2Utils.MPS_DKG_KEYGEN_ROUND1_STATE}:${partyId}`,

0 commit comments

Comments
 (0)