feat: use migration selectors for new assets controller#26975
feat: use migration selectors for new assets controller#26975bergarces wants to merge 66 commits into
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. |
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.
f3d2958 to
0246d21
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The PR refactors state access patterns in three key areas:
The Tag justification:
Performance Test Selection: |
|



Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes how EVM native balances are sourced for multiple consumers when
assetsUnifyStateis enabled, which could affect balance-dependent UI/metrics if the derived mapping is wrong. Also bumps@metamask/assets-controller(and transitive deps), increasing integration risk.Overview
selectAccountsByChainIdis refactored to support the Assets Unify State migration. A new selector (getAccountTrackerControllerAccountsByChainId) returns the legacyAccountTrackerController.accountsByChainIdwhen theassetsUnifyStateflag is off, but when on it derives anaccountsByChainId-shaped map fromAssetsControllernative balances (keyed by CAIP asset ids) andAccountsControllerinternal accounts.Transaction gas metrics (
metrics_properties/gas.ts) now read native balance viaselectAccountsByChainIdinstead of directly accessing engine background state, and the account-tracker selectors are updated to use/re-export the new migration selector.@metamask/assets-controlleris upgraded to^2.2.0(with correspondingyarn.lockupdates).Written by Cursor Bugbot for commit 1413fd1. This will update automatically on new commits. Configure here.