Skip to content

Commit 8165494

Browse files
authored
Merge pull request #78 from BitGo/WP-00000-mulitisg-cleanup
chore(ebe): remove unreachable if conditions
2 parents 933fbfa + 0d66aa1 commit 8165494

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/__tests__/api/enclaved/postIndependentKey.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,13 @@ describe('postIndependentKey', () => {
8383

8484
kmsNock.done();
8585
});
86+
87+
it('should fail to post an independent key if source is not provided', async () => {
88+
const response = await agent
89+
.post(`/api/${coin}/key/independent`)
90+
.set('Authorization', `Bearer ${accessToken}`)
91+
.send({});
92+
93+
response.status.should.equal(400);
94+
});
8695
});

src/api/enclaved/handlers/postIndependentKey.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export async function postIndependentKey(
66
req: EnclavedApiSpecRouteRequest<'v1.key.independent', 'post'>,
77
) {
88
const { source, seed }: { source: string; seed?: string } = req.decoded;
9-
if (!source) {
10-
throw new Error('Source is required for key generation');
11-
}
129

1310
// setup clients
1411
const bitgo: BitGo = req.bitgo;

src/api/enclaved/handlers/signMultisigTransaction.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ export async function signMultisigTransaction(
1212
txPrebuild,
1313
}: { source: string; pub: string; txPrebuild: TransactionPrebuild } = req.body;
1414

15-
if (!source || !pub) {
16-
throw new Error('Source and public key are required for signing');
17-
} else if (!txPrebuild) {
18-
throw new Error('Transaction prebuild is required for signing');
19-
}
20-
2115
const bitgo = req.bitgo;
2216
const kms = new KmsClient(req.config);
2317

0 commit comments

Comments
 (0)