diff --git a/indexer/services/comlink/__tests__/controllers/api/v4/vault-controller.test.ts b/indexer/services/comlink/__tests__/controllers/api/v4/vault-controller.test.ts index 582cb25361..1686311cc1 100644 --- a/indexer/services/comlink/__tests__/controllers/api/v4/vault-controller.test.ts +++ b/indexer/services/comlink/__tests__/controllers/api/v4/vault-controller.test.ts @@ -451,7 +451,7 @@ describe('vault-controller#V4', () => { }); }); - it('Get /megavault/positions with 2 vault subaccount, 1 with no perpetual', async () => { + it('Get /megavault/positions with 2 vault subaccount, 1 with no perpetual, 1 invalid', async () => { await Promise.all([ VaultTable.create({ ...testConstants.defaultVault, @@ -463,6 +463,11 @@ describe('vault-controller#V4', () => { address: testConstants.vaultAddress, clobPairId: testConstants.defaultPerpetualMarket2.clobPairId, }), + VaultTable.create({ + ...testConstants.defaultVault, + address: 'invalid', + clobPairId: '999', + }), ]); const response: request.Response = await sendRequest({ type: RequestMethod.GET, diff --git a/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts b/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts index e4855b016a..10342c28e4 100644 --- a/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts +++ b/indexer/services/comlink/src/controllers/api/v4/vault-controller.ts @@ -662,7 +662,7 @@ async function getVaultMapping(): Promise { } validVaultMapping[subaccountId] = vaultMapping[subaccountId]; } - return vaultMapping; + return validVaultMapping; } export default router;