diff --git a/packages/taco/src/conditions/base/rpc.ts b/packages/taco/src/conditions/base/rpc.ts index f84821743..5a6b5fa68 100644 --- a/packages/taco/src/conditions/base/rpc.ts +++ b/packages/taco/src/conditions/base/rpc.ts @@ -1,20 +1,18 @@ import { z } from 'zod'; import { Condition } from '../condition'; -import { SUPPORTED_CHAIN_IDS } from '../const'; import { EthAddressOrUserAddressSchema, OmitConditionType, paramOrContextParamSchema, returnValueTestSchema, } from '../shared'; -import createUnionSchema from '../zod'; export const RpcConditionType = 'rpc'; export const rpcConditionSchema = z.object({ conditionType: z.literal(RpcConditionType).default(RpcConditionType), - chain: createUnionSchema(SUPPORTED_CHAIN_IDS), + chain: z.number(), method: z.enum(['eth_getBalance']), parameters: z.union([ z.array(EthAddressOrUserAddressSchema).nonempty(), diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts index 4cb67d6c2..5d4b66dc8 100644 --- a/packages/taco/src/conditions/const.ts +++ b/packages/taco/src/conditions/const.ts @@ -1,4 +1,3 @@ -import { ChainId } from '@nucypher/shared'; import { USER_ADDRESS_PARAM_DEFAULT, USER_ADDRESS_PARAM_EXTERNAL_EIP4361, @@ -9,13 +8,6 @@ export const CONTEXT_PARAM_REGEXP = new RegExp('^:[a-zA-Z_][a-zA-Z0-9_]*$'); export const CONTEXT_PARAM_PREFIX = ':'; -export const SUPPORTED_CHAIN_IDS = [ - ChainId.POLYGON, - ChainId.AMOY, - ChainId.SEPOLIA, - ChainId.ETHEREUM_MAINNET, -]; - export const USER_ADDRESS_PARAMS = [ USER_ADDRESS_PARAM_EXTERNAL_EIP4361, // Ordering matters, this should always be last diff --git a/packages/taco/test/conditions/compound-condition.test.ts b/packages/taco/test/conditions/compound-condition.test.ts index 0d349b0b4..826d09058 100644 --- a/packages/taco/test/conditions/compound-condition.test.ts +++ b/packages/taco/test/conditions/compound-condition.test.ts @@ -1,3 +1,4 @@ +import { ChainId } from '@nucypher/shared'; import { describe, expect, it } from 'vitest'; import { ContractCondition } from '../../src/conditions/base/contract'; @@ -8,7 +9,6 @@ import { compoundConditionSchema, CompoundConditionType, } from '../../src/conditions/compound-condition'; -import { SUPPORTED_CHAIN_IDS } from '../../src/conditions/const'; import { testContractConditionObj, testRpcConditionObj, @@ -135,7 +135,7 @@ describe('validation', () => { const multichainCondition: CompoundConditionProps = { conditionType: CompoundConditionType, operator: 'and', - operands: SUPPORTED_CHAIN_IDS.map((chain) => ({ + operands: [ChainId.SEPOLIA, ChainId.AMOY].map((chain) => ({ ...testRpcConditionObj, chain, })), diff --git a/packages/taco/test/conditions/conditions.test.ts b/packages/taco/test/conditions/conditions.test.ts index 3be3f664a..6c80d6142 100644 --- a/packages/taco/test/conditions/conditions.test.ts +++ b/packages/taco/test/conditions/conditions.test.ts @@ -5,7 +5,6 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { initialize } from '../../src'; import { CompoundCondition } from '../../src/conditions/compound-condition'; -import { SUPPORTED_CHAIN_IDS } from '../../src/conditions/const'; import { ConditionContext } from '../../src/conditions/context'; describe('conditions', () => { @@ -53,10 +52,4 @@ describe('conditions', () => { expect(asObj).toBeDefined(); expect(asObj[':time']).toBe(100); }); - - it('has supported chains consistent with shared', async () => { - const chainIdsAndNames = Object.values(ChainId); - const chainIds = chainIdsAndNames.filter((id) => typeof id === 'number'); - expect(SUPPORTED_CHAIN_IDS).toEqual(chainIds); - }); });