Skip to content

Commit f1681f8

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

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ describe('POST /api/:coin/wallet/generate', () => {
116116
.send({
117117
label: 'test_wallet',
118118
enterprise: 'test_enterprise',
119+
multisigType: 'onchain',
119120
});
120121

121122
response.status.should.equal(200);
@@ -485,7 +486,7 @@ describe('POST /api/:coin/wallet/generate', () => {
485486
backupFinalizeNock.done();
486487
addBackupKeyNock.done();
487488
addWalletNock.done();
488-
response.status.should.equal(200); // TODO: Update to 200 when fully integrated with finalize endpoint
489+
response.status.should.equal(200);
489490
});
490491

491492
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', () => {
11371138
(e as Error).message.should.equal('enclavedExpressUrl and enclavedExpressCert are required');
11381139
}
11391140
});
1141+
1142+
it('should fail when multisig type is invalid / not provided', async () => {
1143+
const response = await agent
1144+
.post(`/api/${coin}/wallet/generate`)
1145+
.set('Authorization', `Bearer ${accessToken}`)
1146+
.send({
1147+
label: 'test_wallet',
1148+
enterprise: 'test_enterprise',
1149+
multisigType: 'invalid',
1150+
});
1151+
1152+
response.status.should.equal(400);
1153+
1154+
const response2 = await agent
1155+
.post(`/api/${coin}/wallet/generate`)
1156+
.set('Authorization', `Bearer ${accessToken}`)
1157+
.send({
1158+
label: 'test_wallet',
1159+
enterprise: 'test_enterprise',
1160+
});
1161+
1162+
response2.status.should.equal(400);
1163+
});
11401164
});

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)