diff --git a/src/__tests__/api/enclaved/postIndependentKey.test.ts b/src/__tests__/api/enclaved/postIndependentKey.test.ts index e18be0e..3b94087 100644 --- a/src/__tests__/api/enclaved/postIndependentKey.test.ts +++ b/src/__tests__/api/enclaved/postIndependentKey.test.ts @@ -83,4 +83,13 @@ describe('postIndependentKey', () => { kmsNock.done(); }); + + it('should fail to post an independent key if source is not provided', async () => { + const response = await agent + .post(`/api/${coin}/key/independent`) + .set('Authorization', `Bearer ${accessToken}`) + .send({}); + + response.status.should.equal(400); + }); }); diff --git a/src/api/enclaved/handlers/postIndependentKey.ts b/src/api/enclaved/handlers/postIndependentKey.ts index 8ba4871..7727867 100644 --- a/src/api/enclaved/handlers/postIndependentKey.ts +++ b/src/api/enclaved/handlers/postIndependentKey.ts @@ -6,9 +6,6 @@ export async function postIndependentKey( req: EnclavedApiSpecRouteRequest<'v1.key.independent', 'post'>, ) { const { source, seed }: { source: string; seed?: string } = req.decoded; - if (!source) { - throw new Error('Source is required for key generation'); - } // setup clients const bitgo: BitGo = req.bitgo; diff --git a/src/api/enclaved/handlers/signMultisigTransaction.ts b/src/api/enclaved/handlers/signMultisigTransaction.ts index 1d6ea3d..fd360db 100644 --- a/src/api/enclaved/handlers/signMultisigTransaction.ts +++ b/src/api/enclaved/handlers/signMultisigTransaction.ts @@ -12,12 +12,6 @@ export async function signMultisigTransaction( txPrebuild, }: { source: string; pub: string; txPrebuild: TransactionPrebuild } = req.body; - if (!source || !pub) { - throw new Error('Source and public key are required for signing'); - } else if (!txPrebuild) { - throw new Error('Transaction prebuild is required for signing'); - } - const bitgo = req.bitgo; const kms = new KmsClient(req.config);