Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/__tests__/api/enclaved/postIndependentKey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
3 changes: 0 additions & 3 deletions src/api/enclaved/handlers/postIndependentKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions src/api/enclaved/handlers/signMultisigTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down