fix: check chainRanking for enabled swaps networks#25765
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokeTrade is selected because it tests swap and bridge functionality directly affected by these changes. SmokeConfirmations is required as a dependent tag since swap/bridge flows require transaction confirmations. The risk is medium because while the logic change could affect which chains appear as available for bridging, the removed selectors are unused and the test file is properly updated to match the new logic. Performance Test Selection: |
|



Description
The
isActiveSrcandisActiveDestproperties on thechainsfeature flag are being deprecated. If a chain exists in thechainRankingarray, it is now assumed to be enabled as both source and destination. This PR migrates all selectors that previously checkedchains[chainId].isActiveSrc/chains[chainId].isActiveDestto instead check for the chain's presence inchainRanking.This eliminates a pain point where adding a new network required an entry in both
chainRankingandchains— nowchainRankingis the single source of truth for whether a network is enabled.Changes:
selectIsBridgeEnabledSourceFactory— checkschainRankingpresence instead ofchains[chainId].isActiveSrcselectEnabledSourceChains— same migrationselectEnabledDestChains,selectIsBridgeEnabledDest, andselectIsSwapsLiveselectors (no longer needed with the new model)PopularList,selectHasCreatedSolanaMainnetAccount)chainRankingChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Not applicable — no UI changes.
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes core selector logic that gates which networks appear/enabled for bridge/swap, and removes selectors that may have downstream callers if not fully migrated.
Overview
Switches bridge/swap network enablement checks to rely solely on feature-flag
chainRankingmembership, replacing deprecatedchains[caipId].isActiveSrc/isActiveDestlookups.Removes destination/live enablement selectors (
selectEnabledDestChains,selectIsBridgeEnabledDest,selectIsSwapsLive) and related imports, and updates unit tests to reflect the new behavior (a chain is disabled by removing it fromchainRanking, and unknown chains now returnfalserather thanundefined).Written by Cursor Bugbot for commit f9591fd. This will update automatically on new commits. Configure here.