diff --git a/src/__tests__/api/master/generateWallet.test.ts b/src/__tests__/api/master/generateWallet.test.ts index 57f8567e..e4832afc 100644 --- a/src/__tests__/api/master/generateWallet.test.ts +++ b/src/__tests__/api/master/generateWallet.test.ts @@ -116,6 +116,7 @@ describe('POST /api/:coin/wallet/generate', () => { .send({ label: 'test_wallet', enterprise: 'test_enterprise', + multisigType: 'onchain', }); response.status.should.equal(200); @@ -485,7 +486,7 @@ describe('POST /api/:coin/wallet/generate', () => { backupFinalizeNock.done(); addBackupKeyNock.done(); addWalletNock.done(); - response.status.should.equal(200); // TODO: Update to 200 when fully integrated with finalize endpoint + response.status.should.equal(200); }); it('should generate a TSS MPC v2 wallet by calling the enclaved express service', async () => { @@ -1137,4 +1138,27 @@ describe('POST /api/:coin/wallet/generate', () => { (e as Error).message.should.equal('enclavedExpressUrl and enclavedExpressCert are required'); } }); + + it('should fail when multisig type is invalid / not provided', async () => { + const response = await agent + .post(`/api/${coin}/wallet/generate`) + .set('Authorization', `Bearer ${accessToken}`) + .send({ + label: 'test_wallet', + enterprise: 'test_enterprise', + multisigType: 'invalid', + }); + + response.status.should.equal(400); + + const response2 = await agent + .post(`/api/${coin}/wallet/generate`) + .set('Authorization', `Bearer ${accessToken}`) + .send({ + label: 'test_wallet', + enterprise: 'test_enterprise', + }); + + response2.status.should.equal(400); + }); }); diff --git a/src/api/master/routers/masterApiSpec.ts b/src/api/master/routers/masterApiSpec.ts index 3a517e36..a9548e50 100644 --- a/src/api/master/routers/masterApiSpec.ts +++ b/src/api/master/routers/masterApiSpec.ts @@ -44,7 +44,7 @@ const GenerateWalletResponse: HttpResponse = { // Request type for /generate endpoint const GenerateWalletRequest = { label: t.string, - multisigType: t.union([t.undefined, t.literal('onchain'), t.literal('tss')]), + multisigType: t.union([t.literal('onchain'), t.literal('tss')]), enterprise: t.string, disableTransactionNotifications: t.union([t.undefined, t.boolean]), isDistributedCustody: t.union([t.undefined, t.boolean]),