You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: drop isSupported gate; trust boundary SUPPORTED_CHAINS validation
The HTTP request boundary already enforces chainId ∈ SUPPORTED_CHAINS
via Joi (lib/util/field-validator.ts:59, CHAIN_ID_JOI). Step Functions
events in check-order-status are seeded by post-order, which inherits
that validation. With the boundary trusted, the duplicated isSupported
predicates in OnChainValidatorMap factories and the supported set in
LazyProviderMap were dead weight.
- OnChainValidatorMap: drop OnChainValidatorMapOptions and the has()
method. Factory now passed positionally; get() always calls it on
cache miss. has() had a single caller (V4 quoter check in
UniswapXOrderService) handled below.
- LazyProviderMap: drop the supported constructor param and getOrThrow().
get() now constructs+caches unconditionally and returns a
StaticJsonRpcProvider non-null. The ProviderMap structural interface
still allows undefined for Map<> compatibility.
- UniswapXOrderService: replace this.onChainV4ValidatorMap?.has(chainId)
with a direct UNISWAPX_V4_ORDER_QUOTER_MAPPING[chainId] lookup. The V4
quoter mapping is a property of the SDK + per-chain reactor deploys,
not of the validator-map abstraction — keeping it at the call site
removes the abstraction's only V4-specific concern.
- Handlers: drop the supportedChainSet/isSupportedChain boilerplate;
factory closures pass providerMap.get(chainId) directly.
Net: -37 lines, no remaining duplicate "is this chain supported" logic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments