Skip to content

Commit ab27218

Browse files
committed
chore(mbe): rename helper
Ticket: WP-5232
1 parent ba2f0c0 commit ab27218

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
TransactionState,
1717
} from '@bitgo/sdk-core';
1818
import { EnclavedExpressClient } from '../../../../src/api/master/clients/enclavedExpressClient';
19-
import { handleEcdsaSigning } from '../../../../src/api/master/handlers/ecdsa';
19+
import { handleEcdsaMPCv2Signing } from '../../../../src/api/master/handlers/ecdsa';
2020
import { BitGo } from 'bitgo';
2121
import { readKey } from 'openpgp';
2222

@@ -238,7 +238,7 @@ describe('Ecdsa Signing Handler', () => {
238238
signatureShareRound3: round3SignatureShare,
239239
});
240240

241-
const result = await handleEcdsaSigning(
241+
const result = await handleEcdsaMPCv2Signing(
242242
bitgo,
243243
wallet,
244244
txRequest.txRequestId,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ describe('POST /api/:coin/wallet/:walletId/sendmany', () => {
371371
.returns('ecdsa');
372372

373373
// Mock handleEcdsaSigning
374-
const handleEcdsaSigningStub = sinon.stub().resolves({
374+
const handleEcdsaMPCv2Signing = sinon.stub().resolves({
375375
txRequestId: 'test-tx-request-id',
376376
state: 'signed',
377377
apiVersion: 'full',
@@ -386,7 +386,7 @@ describe('POST /api/:coin/wallet/:walletId/sendmany', () => {
386386
});
387387

388388
// Import and stub the handleEcdsaSigning function
389-
sinon.stub(ecdsa, 'handleEcdsaSigning').callsFake(handleEcdsaSigningStub);
389+
sinon.stub(ecdsa, 'handleEcdsaMPCv2Signing').callsFake(handleEcdsaMPCv2Signing);
390390

391391
const response = await agent
392392
.post(`/api/${coin}/wallet/${walletId}/sendMany`)
@@ -417,7 +417,7 @@ describe('POST /api/:coin/wallet/:walletId/sendmany', () => {
417417
sinon.assert.calledOnce(verifyStub);
418418
sinon.assert.calledTwice(multisigTypeStub);
419419
sinon.assert.calledOnce(getMPCAlgorithmStub);
420-
sinon.assert.calledOnce(handleEcdsaSigningStub);
420+
sinon.assert.calledOnce(handleEcdsaMPCv2Signing);
421421
});
422422

423423
it('should fail when backup key is used for ECDSA TSS signing', async () => {

src/api/master/handlers/ecdsa.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ import {
1515
SignMpcV2Round2Response,
1616
} from '../clients/enclavedExpressClient';
1717

18-
export async function handleEcdsaSigning(
18+
export async function handleEcdsaMPCv2Signing(
1919
bitgo: BitGoBase,
2020
wallet: Wallet,
2121
txRequestId: string,
2222
enclavedExpressClient: EnclavedExpressClient,
2323
source: 'user' | 'backup',
2424
commonKeychain: string,
2525
reqId: IRequestTracer,
26-
) {
26+
): Promise<TxRequest> {
2727
const ecdsaMPCv2Utils = new EcdsaMPCv2Utils(bitgo, wallet.baseCoin, wallet);
2828
const txRequest = await getTxRequest(bitgo, wallet.id(), txRequestId, reqId);
2929

src/api/master/handlers/eddsa.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function handleEddsaSigning(
2222
commonKeychain: string,
2323
reqId?: IRequestTracer,
2424
) {
25-
const eddsaUtils = new EddsaUtils(bitgo, wallet.baseCoin);
25+
const eddsaUtils = new EddsaUtils(bitgo, wallet.baseCoin, wallet);
2626
const txRequest = await getTxRequest(bitgo, wallet.id(), txRequestId, reqId);
2727

2828
const { apiVersion } = txRequest;

src/api/master/handlers/handleSendMany.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import logger from '../../../logger';
1515
import { MasterApiSpecRouteRequest } from '../routers/masterApiSpec';
1616
import { handleEddsaSigning } from './eddsa';
17-
import { handleEcdsaSigning } from './ecdsa';
17+
import { handleEcdsaMPCv2Signing } from './ecdsa';
1818
import { EnclavedExpressClient } from '../clients/enclavedExpressClient';
1919

2020
/**
@@ -213,7 +213,7 @@ async function signAndSendTxRequests(
213213
reqId,
214214
);
215215
} else if (mpcAlgorithm === 'ecdsa') {
216-
signedTxRequest = await handleEcdsaSigning(
216+
signedTxRequest = await handleEcdsaMPCv2Signing(
217217
bitgo,
218218
wallet,
219219
txRequestId,

0 commit comments

Comments
 (0)