feat: asset-controller tempo adjustments before migration#8638
feat: asset-controller tempo adjustments before migration#8638
Conversation
a8b2d27 to
3c5a04a
Compare
3c5a04a to
5d3fb3f
Compare
5d3fb3f to
d8ff44d
Compare
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 d8ff44d. Configure here.
| if (!shouldSkipNativeForCaipChainId(chainId)) { | ||
| // Build a single AssetFetchEntry[] for native + custom ERC-20s | ||
| assetsToFetch.push({ assetId: nativeAssetId, address: ZERO_ADDRESS }); | ||
| } |
There was a problem hiding this comment.
Error path reintroduces native token for skipped chains
Medium Severity
The happy path now correctly skips adding the native asset to assetsToFetch for Tempo chains via shouldSkipNativeForCaipChainId, but the catch block unconditionally writes nativeAssetId back into assetsBalance (with amount '0') and assetsInfo (with type: 'native'). When fetchBalancesForAssets fails on a Tempo chain (e.g., network error fetching custom ERC-20s), native token data is reintroduced into state despite being intentionally excluded. While #shouldHideNativeToken filters at display time, this leaks inconsistent data into controller state.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d8ff44d. Configure here.
|
@metamaskbot preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |


Explanation
References
Checklist
Note
Medium Risk
Changes balance-fetch inputs and price-support mappings for specific chains; risk is limited in scope but could affect Tempo balance/price display and any code assuming a native entry is always fetched.
Overview
Adjusts Tempo chain handling so native assets are no longer treated as fetchable/priced tokens.
RpcDataSourcenow conditionally omits the nativegetEthBalancerequest for chains inCHAIN_IDS_WITH_NO_NATIVE_TOKEN(via newshouldSkipNativeForCaipChainIdhelper), andAssetsControlleruses the same helper when deciding whether to hide native tokens. Inassets-controllers, Tempo entries inSPOT_PRICES_SUPPORT_INFOare updated to indicate no native asset and the pseudo-native address mappings are removed.Reviewed by Cursor Bugbot for commit d8ff44d. Bugbot is set up for automated code reviews on this repo. Configure here.