Skip to content

Commit 1c5d5f2

Browse files
committed
fix(mbe): make multisigType required for generate wallet
Ticket: WP-00000
1 parent bcacf32 commit 1c5d5f2

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

src/__tests__/api/master/generateWallet.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,4 +1137,27 @@ describe('POST /api/:coin/wallet/generate', () => {
11371137
(e as Error).message.should.equal('enclavedExpressUrl and enclavedExpressCert are required');
11381138
}
11391139
});
1140+
1141+
it('should fail when multisig type is invalid / not provided', async () => {
1142+
const response = await agent
1143+
.post(`/api/${coin}/wallet/generate`)
1144+
.set('Authorization', `Bearer ${accessToken}`)
1145+
.send({
1146+
label: 'test_wallet',
1147+
enterprise: 'test_enterprise',
1148+
multisigType: 'invalid',
1149+
});
1150+
1151+
response.status.should.equal(400);
1152+
1153+
const response2 = await agent
1154+
.post(`/api/${coin}/wallet/generate`)
1155+
.set('Authorization', `Bearer ${accessToken}`)
1156+
.send({
1157+
label: 'test_wallet',
1158+
enterprise: 'test_enterprise',
1159+
});
1160+
1161+
response2.status.should.equal(400);
1162+
});
11401163
});

src/api/master/routers/masterApiSpec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const GenerateWalletResponse: HttpResponse = {
4444
// Request type for /generate endpoint
4545
const GenerateWalletRequest = {
4646
label: t.string,
47-
multisigType: t.union([t.undefined, t.literal('onchain'), t.literal('tss')]),
47+
multisigType: t.union([t.literal('onchain'), t.literal('tss')]),
4848
enterprise: t.string,
4949
disableTransactionNotifications: t.union([t.undefined, t.boolean]),
5050
isDistributedCustody: t.union([t.undefined, t.boolean]),

0 commit comments

Comments
 (0)