Skip to content

Commit f2d47ab

Browse files
Merge pull request #44 from BitGo/WP-00000-ebe-eddsa-follow-up
chore: address follow up comments
2 parents 9b32326 + 6b568ee commit f2d47ab

3 files changed

Lines changed: 3 additions & 20 deletions

File tree

src/api/enclaved/handlers/signMpcTransaction.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ interface EddsaSigningParams {
7070
export async function signMpcTransaction(req: EnclavedApiSpecRouteRequest<'v1.mpc.sign', 'post'>) {
7171
const { source, pub, coin, encryptedDataKey, shareType } = req.decoded;
7272

73-
if (!source || !pub) {
74-
throw new Error('Source and public key are required for MPC signing');
75-
}
76-
77-
if (!shareType) {
78-
throw new Error('Share type is required for MPC signing');
79-
}
80-
8173
const bitgo = req.bitgo;
8274
const coinInstance = bitgo.coin(coin);
8375

@@ -147,9 +139,6 @@ async function handleEddsaSigning(
147139

148140
switch (shareType.toLowerCase()) {
149141
case ShareType.Commitment: {
150-
if (!txRequest) {
151-
throw new Error('txRequest is required for commitment share generation');
152-
}
153142
if (!bitgoGpgPubKey) {
154143
throw new Error('bitgoGpgPubKey is required for commitment share generation');
155144
}
@@ -166,9 +155,6 @@ async function handleEddsaSigning(
166155
};
167156
}
168157
case ShareType.R: {
169-
if (!txRequest) {
170-
throw new Error('txRequest is required for R share generation');
171-
}
172158
if (!encryptedUserToBitgoRShare) {
173159
throw new Error('encryptedUserToBitgoRShare is required for R share generation');
174160
}
@@ -186,9 +172,6 @@ async function handleEddsaSigning(
186172
return await eddsaUtils.createRShareFromTxRequest(rShareParams);
187173
}
188174
case ShareType.G: {
189-
if (!txRequest) {
190-
throw new Error('txRequest is required for G share generation');
191-
}
192175
if (!bitgoToUserRShare) {
193176
throw new Error('bitgoToUserRShare is required for G share generation');
194177
}

src/enclavedBitgoExpress/routers/enclavedApiSpec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const RecoveryMultisigResponse: HttpResponse = {
8585
const SignMpcRequest = {
8686
source: t.string,
8787
pub: t.string,
88-
txRequest: t.union([t.undefined, t.any]),
88+
txRequest: t.any,
8989
bitgoToUserRShare: t.union([t.undefined, t.any]),
9090
userToBitgoRShare: t.union([t.undefined, t.any]),
9191
encryptedUserToBitgoRShare: t.union([t.undefined, t.any]),

src/kms/kmsClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class KmsClient {
9393
.set('x-api-key', 'abc')
9494
.send(params);
9595
} catch (error: any) {
96-
console.log('Error generating data key from KMS', error);
96+
debugLogger('Error generating data key from KMS', error);
9797
throw error;
9898
}
9999

@@ -120,7 +120,7 @@ export class KmsClient {
120120
.set('x-api-key', 'abc')
121121
.send(params);
122122
} catch (error: any) {
123-
console.log('Error decrypting data key from KMS', error);
123+
debugLogger('Error decrypting data key from KMS', error);
124124
throw error;
125125
}
126126

0 commit comments

Comments
 (0)