Skip to content

Commit 87d9bd8

Browse files
feat(mbe): refactor consolidation
1 parent 7b98d91 commit 87d9bd8

File tree

4 files changed

+147
-337
lines changed

4 files changed

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

0 commit comments

Comments
 (0)