diff --git a/lib/util/chain.ts b/lib/util/chain.ts index 92ab6824..b24dc4da 100644 --- a/lib/util/chain.ts +++ b/lib/util/chain.ts @@ -4,7 +4,6 @@ export enum ChainId { OPTIMISM = 10, ARBITRUM_ONE = 42161, POLYGON = 137, - TENDERLY = 12341234, } -export const SUPPORTED_CHAINS = [ChainId.MAINNET, ChainId.GÖRLI, ChainId.POLYGON, ChainId.TENDERLY] +export const SUPPORTED_CHAINS = [ChainId.MAINNET, ChainId.GÖRLI, ChainId.POLYGON] diff --git a/test/handlers/check-order-status.test.ts b/test/handlers/check-order-status.test.ts index bfa09aa2..87d66860 100644 --- a/test/handlers/check-order-status.test.ts +++ b/test/handlers/check-order-status.test.ts @@ -118,7 +118,7 @@ describe('Testing check order status handler', () => { orderStatus: ORDER_STATUS.OPEN as string, chainId: 2022, } as any) - ).rejects.toThrowError(`"chainId" must be one of [1, 5, 137, 12341234]`) + ).rejects.toThrowError(`"chainId" must be one of [1, 5, 137]`) }) }) diff --git a/test/handlers/get-nonce.test.ts b/test/handlers/get-nonce.test.ts index aa2b88e7..573b61d8 100644 --- a/test/handlers/get-nonce.test.ts +++ b/test/handlers/get-nonce.test.ts @@ -60,7 +60,7 @@ describe('Testing get nonce handler.', () => { [{ address: '' }, '"address\\" is not allowed to be empty"'], [{ address: '0xF53bDa7e0337BD456cDcDab0Ab24Db43E738065' }, 'VALIDATION ERROR: Invalid address'], [{}, '"address\\" is required'], - [{ address: MOCK_ADDRESS, chainId: 'foo' }, '\\"chainId\\" must be one of [1, 5, 137, 12341234]'], + [{ address: MOCK_ADDRESS, chainId: 'foo' }, '\\"chainId\\" must be one of [1, 5, 137]'], ])('Throws 400 with invalid query param %p', async (invalidQueryParam, bodyMsg) => { const invalidEvent = { ...event, diff --git a/test/handlers/get-orders.test.ts b/test/handlers/get-orders.test.ts index 6f577654..bf73a3bd 100644 --- a/test/handlers/get-orders.test.ts +++ b/test/handlers/get-orders.test.ts @@ -125,7 +125,7 @@ describe('Testing get orders handler.', () => { [{ sort: 'foo(bar)' }, '"foo(bar)\\" fails to match the required pattern'], [{ cursor: 1 }, 'must be a string'], [{ sort: 'gt(4)' }, '{"detail":"\\"sortKey\\" is required","errorCode":"VALIDATION_ERROR"}'], - [{ chainId: 420 }, '{"detail":"\\"chainId\\" must be one of [1, 5, 137, 12341234]","errorCode":"VALIDATION_ERROR"}'], + [{ chainId: 420 }, '{"detail":"\\"chainId\\" must be one of [1, 5, 137]","errorCode":"VALIDATION_ERROR"}'], [{ desc: true }, '{"detail":"\\"sortKey\\" is required","errorCode":"VALIDATION_ERROR"}'], [ { desc: 'yes', sortKey: 'createdAt', orderStatus: 'expired' }, diff --git a/test/handlers/post-order.test.ts b/test/handlers/post-order.test.ts index bf86ef93..790061fe 100644 --- a/test/handlers/post-order.test.ts +++ b/test/handlers/post-order.test.ts @@ -9,7 +9,7 @@ import { ErrorCode } from '../../lib/handlers/base' import { PostOrderHandler } from '../../lib/handlers/post-order/handler' const MOCK_ARN_1 = 'MOCK_ARN_1' -const MOCK_ARN_12341234 = 'MOCK_ARN_12341234' +const MOCK_ARN_5 = 'MOCK_ARN_5' const MOCK_HASH = '0xhash' const MOCK_START_EXECUTION_INPUT = JSON.stringify({ orderHash: MOCK_HASH, @@ -28,7 +28,7 @@ mockSfnClient mockSfnClient .on(StartExecutionCommand, { - stateMachineArn: MOCK_ARN_12341234, + stateMachineArn: MOCK_ARN_5, name: MOCK_HASH, input: MOCK_START_EXECUTION_INPUT, }) @@ -148,7 +148,7 @@ describe('Testing post order handler.', () => { 1: { validate: onchainValidationSucceededMock, }, - 12341234: { + 5: { validate: onchainValidationSucceededMock, }, 137: { @@ -164,7 +164,7 @@ describe('Testing post order handler.', () => { beforeAll(() => { process.env['STATE_MACHINE_ARN_1'] = MOCK_ARN_1 - process.env['STATE_MACHINE_ARN_12341234'] = MOCK_ARN_12341234 + process.env['STATE_MACHINE_ARN_5'] = MOCK_ARN_5 process.env['REGION'] = 'region' parserMock.mockImplementation((_order: any, chainId: number) => ({ ...DECODED_ORDER, chainId })) }) @@ -204,17 +204,17 @@ describe('Testing post order handler.', () => { const postOrderResponse = await postOrderHandler.handler( { queryStringParameters: {}, - body: JSON.stringify({ ...postRequestBody, chainId: 12341234 }), + body: JSON.stringify({ ...postRequestBody, chainId: 5 }), } as any, {} as any ) - expect(putOrderAndUpdateNonceTransactionMock).toBeCalledWith({ ...ORDER, chainId: 12341234 }) + expect(putOrderAndUpdateNonceTransactionMock).toBeCalledWith({ ...ORDER, chainId: 5 }) expect(onchainValidationSucceededMock).toBeCalled() - expect(validatorMock).toBeCalledWith({ ...DECODED_ORDER, chainId: 12341234 }) + expect(validatorMock).toBeCalledWith({ ...DECODED_ORDER, chainId: 5 }) expect(mockSfnClient.calls()).toHaveLength(1) expect(mockSfnClient.call(0).args[0].input).toMatchObject({ - stateMachineArn: MOCK_ARN_12341234, + stateMachineArn: MOCK_ARN_5, }) expect(postOrderResponse).toEqual({ body: JSON.stringify({ hash: '0x0000000000000000000000000000000000000000000000000000000000000006' }), @@ -305,7 +305,7 @@ describe('Testing post order handler.', () => { { signature: '0xbad_signature' }, '{"detail":"\\"signature\\" with value \\"0xbad_signature\\" fails to match the required pattern: /^0x[0-9,a-z,A-Z]{130}$/","errorCode":"VALIDATION_ERROR"}', ], - [{ chainId: 0 }, `{"detail":"\\"chainId\\" must be one of [1, 5, 137, 12341234]","errorCode":"VALIDATION_ERROR"}`], + [{ chainId: 0 }, `{"detail":"\\"chainId\\" must be one of [1, 5, 137]","errorCode":"VALIDATION_ERROR"}`], [{ quoteId: 'not_UUIDV4' }, '{"detail":"\\"quoteId\\" must be a valid GUID","errorCode":"VALIDATION_ERROR"}'], ])('Throws 400 with invalid field %p', async (invalidBodyField, bodyMsg) => { const invalidEvent = { diff --git a/test/util/field-validator.test.ts b/test/util/field-validator.test.ts index eefcd5aa..f3eef538 100644 --- a/test/util/field-validator.test.ts +++ b/test/util/field-validator.test.ts @@ -114,13 +114,13 @@ describe('Testing each field on the FieldValidator class.', () => { const chainId = 'MAINNET' const validatedField = FieldValidator.isValidChainId().validate(chainId) expect(validatedField.error).toBeTruthy() - expect(validatedField.error?.details[0].message).toEqual(`"value" must be one of [1, 5, 137, 12341234]`) + expect(validatedField.error?.details[0].message).toEqual(`"value" must be one of [1, 5, 137]`) }) it('should invalidate unsupported chain.', async () => { const chainId = ChainId.ARBITRUM_ONE const validatedField = FieldValidator.isValidChainId().validate(chainId) expect(validatedField.error).toBeTruthy() - expect(validatedField.error?.details[0].message).toEqual(`"value" must be one of [1, 5, 137, 12341234]`) + expect(validatedField.error?.details[0].message).toEqual(`"value" must be one of [1, 5, 137]`) }) }) describe('Testing nonce field.', () => {