From e92cd6e652833107b5f52dd185bfba26e0c046d0 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Fri, 17 Jan 2025 16:09:59 -0500 Subject: [PATCH] fix some tests Signed-off-by: Shrenuj Bansal --- .../controllers/api/v4/historical-pnl-controller.test.ts | 4 ++-- .../controllers/api/v4/transfers-controller.test.ts | 8 ++++---- .../src/controllers/api/v4/compliance-controller.ts | 1 - indexer/services/comlink/src/lib/validation/schemas.ts | 2 -- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/indexer/services/comlink/__tests__/controllers/api/v4/historical-pnl-controller.test.ts b/indexer/services/comlink/__tests__/controllers/api/v4/historical-pnl-controller.test.ts index 9ff5c2468c9..bca33ac4cd5 100644 --- a/indexer/services/comlink/__tests__/controllers/api/v4/historical-pnl-controller.test.ts +++ b/indexer/services/comlink/__tests__/controllers/api/v4/historical-pnl-controller.test.ts @@ -264,14 +264,14 @@ describe('pnlTicks-controller#V4', () => { it('Get /historical-pnl with non-existent address and subaccount number returns 404', async () => { const response: request.Response = await sendRequest({ type: RequestMethod.GET, - path: '/v4/historical-pnl?address=invalid_address&subaccountNumber=100', + path: '/v4/historical-pnl?address=invalidaddress&subaccountNumber=100', expectedStatus: 404, }); expect(response.body).toEqual({ errors: [ { - msg: 'No subaccount found with address invalid_address and subaccountNumber 100', + msg: 'No subaccount found with address invalidaddress and subaccountNumber 100', }, ], }); diff --git a/indexer/services/comlink/__tests__/controllers/api/v4/transfers-controller.test.ts b/indexer/services/comlink/__tests__/controllers/api/v4/transfers-controller.test.ts index 432e050cc91..79ddfd4d04c 100644 --- a/indexer/services/comlink/__tests__/controllers/api/v4/transfers-controller.test.ts +++ b/indexer/services/comlink/__tests__/controllers/api/v4/transfers-controller.test.ts @@ -433,14 +433,14 @@ describe('transfers-controller#V4', () => { it('Get /transfers with non-existent address and subaccount number returns 404', async () => { const response: request.Response = await sendRequest({ type: RequestMethod.GET, - path: '/v4/transfers?address=invalid_address&subaccountNumber=100', + path: '/v4/transfers?address=invalidaddress&subaccountNumber=100', expectedStatus: 404, }); expect(response.body).toEqual({ errors: [ { - msg: 'No subaccount found with address invalid_address and subaccountNumber 100', + msg: 'No subaccount found with address invalidaddress and subaccountNumber 100', }, ], }); @@ -981,14 +981,14 @@ describe('transfers-controller#V4', () => { it('Get /transfers/parentSubaccountNumber with non-existent address and subaccount number returns 404', async () => { const response: request.Response = await sendRequest({ type: RequestMethod.GET, - path: '/v4/transfers/parentSubaccountNumber?address=invalid_address&parentSubaccountNumber=100', + path: '/v4/transfers/parentSubaccountNumber?address=invalidaddress&parentSubaccountNumber=100', expectedStatus: 404, }); expect(response.body).toEqual({ errors: [ { - msg: 'No subaccount found with address invalid_address and parentSubaccountNumber 100', + msg: 'No subaccount found with address invalidaddress and parentSubaccountNumber 100', }, ], }); diff --git a/indexer/services/comlink/src/controllers/api/v4/compliance-controller.ts b/indexer/services/comlink/src/controllers/api/v4/compliance-controller.ts index a99d96a0e83..f8f5bd23e19 100644 --- a/indexer/services/comlink/src/controllers/api/v4/compliance-controller.ts +++ b/indexer/services/comlink/src/controllers/api/v4/compliance-controller.ts @@ -23,7 +23,6 @@ import { complianceProvider } from '../../../helpers/compliance/compliance-clien import { create4xxResponse, handleControllerError } from '../../../lib/helpers'; import { rateLimiterMiddleware } from '../../../lib/rate-limit'; import { getIpAddr } from '../../../lib/utils'; -import { CheckAddressSchema } from '../../../lib/validation/schemas'; import { handleValidationErrors } from '../../../request-helpers/error-handler'; import ExportResponseCodeStats from '../../../request-helpers/export-response-code-stats'; import { ComplianceRequest, ComplianceResponse } from '../../../types'; diff --git a/indexer/services/comlink/src/lib/validation/schemas.ts b/indexer/services/comlink/src/lib/validation/schemas.ts index 63ffcbec93a..0d2ce534b70 100644 --- a/indexer/services/comlink/src/lib/validation/schemas.ts +++ b/indexer/services/comlink/src/lib/validation/schemas.ts @@ -1,5 +1,3 @@ -import * as console from 'node:console'; - import { isValidLanguageCode } from '@dydxprotocol-indexer/notifications'; import { perpetualMarketRefresher,