chore: remove tokensChainsCache from assets selectors, transactions utils, and test fixtures#28925
Conversation
…tils, and test fixtures
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fb8f6ea. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The PR removes deprecated
SmokeTrade is included because swap/bridge flows use token metadata (including aggregators) for token selection and display, and the SmokeConfirmations is included because SmokeWalletPlatform is included because token list display and transaction history rely on No dependency tags needed beyond these three based on the tag descriptions (SmokeTrade + SmokeConfirmations are already paired per tag description). Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
Removes all usages of the deprecated
tokensChainsCachefield fromTokenListControlleracross the codebase.This includes:
app/selectors/tokenListController.tswhich exposedselectTokenList,selectERC20TokensByChain, andselectERC20TokensByChainInternal— all deprecated selectors that read fromtokensChainsCacheselectAssetandassetToTokeninassets-list.tsto sourceaggregatorsdirectly from the token stored inallTokens(viaTokensController) instead of looking it up intokensChainsCacheisSmartContractAddressthat checkedtokensChainsCachebefore querying the networkTokenListController.tokensChainsCachemask from the Sentry state filtertokensChainsCacheChangelog
CHANGELOG entry: remove tokensChainsCache from assets selectors, transactions utils, and test fixtures
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3058
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches asset-to-token mapping and contract-address detection behavior; mistakes could cause missing token metadata (e.g.,
aggregators) or extra network calls/perf regressions from removing the cache short-circuit.Overview
Removes the deprecated
TokenListControllerselectors (selectTokenList,selectERC20TokensByChain) and updates callers/tests to no longer mock or depend on them.Updates
selectAssetinassets-listto stop readingTokenListController.tokensChainsCache;aggregators(andrwaData) are now sourced fromTokensController.allTokens, and related state fixtures/tests are adjusted accordingly.Simplifies
isSmartContractAddressinutil/transactionsby dropping the mainnet token-cache short-circuit, and cleans up Sentry state masking to no longer referenceTokenListController.tokensChainsCache.Reviewed by Cursor Bugbot for commit 016a367. Bugbot is set up for automated code reviews on this repo. Configure here.