Skip to content

Commit 3f959f5

Browse files
feat(mbe): refactor consolidation
1 parent 1e71b44 commit 3f959f5

File tree

4 files changed

+73
-337
lines changed

4 files changed

+73
-337
lines changed

src/__tests__/api/master/consolidateMPC.test.ts

Lines changed: 0 additions & 212 deletions
This file was deleted.

src/api/master/handlers/eddsa.ts

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import {
99
EddsaUtils,
1010
BaseCoin,
1111
ApiKeyShare,
12-
CustomRShareGeneratingFunction,
13-
CustomGShareGeneratingFunction,
14-
CustomCommitmentGeneratingFunction,
1512
} from '@bitgo/sdk-core';
1613
import { EnclavedExpressClient } from '../clients/enclavedExpressClient';
1714
import { exchangeEddsaCommitments } from '@bitgo/sdk-core/dist/src/bitgo/tss/common';
@@ -201,70 +198,3 @@ export async function orchestrateEddsaKeyGen({
201198
walletParams.keys = [userMpcKey.id, backupMpcKey.id, bitgoKeychain.id];
202199
return { walletParams, keychains };
203200
}
204-
205-
// Commitment
206-
export function createCustomCommitmentGenerator(
207-
bitgo: BitGoBase,
208-
wallet: Wallet,
209-
enclavedExpressClient: EnclavedExpressClient,
210-
source: 'user' | 'backup',
211-
pub: string,
212-
): CustomCommitmentGeneratingFunction {
213-
return async function customCommitmentGeneratingFunction(params) {
214-
const eddsaUtils = new EddsaUtils(bitgo, wallet.baseCoin);
215-
const bitgoGpgKey = await eddsaUtils.getBitgoPublicGpgKey();
216-
const { txRequest } = params;
217-
const response = await enclavedExpressClient.signMpcCommitment({
218-
txRequest,
219-
bitgoGpgPubKey: bitgoGpgKey.armor(),
220-
source,
221-
pub,
222-
});
223-
return {
224-
...response,
225-
encryptedUserToBitgoRShare: {
226-
...response.encryptedUserToBitgoRShare,
227-
encryptedDataKey: response.encryptedDataKey,
228-
},
229-
};
230-
};
231-
}
232-
233-
// RShare
234-
export function createCustomRShareGenerator(
235-
enclavedExpressClient: EnclavedExpressClient,
236-
source: 'user' | 'backup',
237-
pub: string,
238-
): CustomRShareGeneratingFunction {
239-
return async function customRShareGeneratingFunction(params) {
240-
const { txRequest, encryptedUserToBitgoRShare } = params;
241-
const encryptedDataKey = (encryptedUserToBitgoRShare as any).encryptedDataKey;
242-
return await enclavedExpressClient.signMpcRShare({
243-
txRequest,
244-
encryptedUserToBitgoRShare,
245-
encryptedDataKey,
246-
source,
247-
pub,
248-
});
249-
};
250-
}
251-
252-
// GShare
253-
export function createCustomGShareGenerator(
254-
enclavedExpressClient: EnclavedExpressClient,
255-
source: 'user' | 'backup',
256-
pub: string,
257-
): CustomGShareGeneratingFunction {
258-
return async function customGShareGeneratingFunction(params) {
259-
const { txRequest, bitgoToUserRShare, userToBitgoRShare, bitgoToUserCommitment } = params;
260-
const response = await enclavedExpressClient.signMpcGShare({
261-
txRequest,
262-
bitgoToUserRShare,
263-
userToBitgoRShare,
264-
bitgoToUserCommitment,
265-
source,
266-
pub,
267-
});
268-
return response.gShare;
269-
};
270-
}

0 commit comments

Comments
 (0)