feat: source GasFeeController from @metamask/wallet#33430
Conversation
TEMP: pins the core#9527 (draft) preview builds so mobile can source GasFeeController from @metamask/wallet before a real release ships. Revert before marking the PR ready. - @metamask/wallet -> @metamask-previews/wallet@7.0.1-preview-7ed2770ae - @metamask/gas-fee-controller -> @metamask-previews/gas-fee-controller@26.2.4-preview-7ed2770ae - @metamask/account-tree-controller -> @metamask-previews/account-tree-controller@7.5.5-preview-7ed2770ae - @metamask/accounts-controller -> ^39.0.5 (required by the wallet preview) Preview aliases are added to both dependencies and resolutions so the wallet's real-range transitive deps collapse onto the single preview copy (keeps `yarn dedupe --check` clean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adopt the wallet-owned GasFeeController (core#9527) in place of mobile's local controller-init wiring, mirroring the previous controller adoptions. - Add wallet-init/instance-options/gas-fee-controller.ts (+ test) supplying the mobile client options (clientId, API endpoints, legacy-gas API compatibility). The wallet builds getProvider and the EIP-1559 callback from NetworkController and constructs GasFeeController after it. - Wire it into wallet-init/initialization.ts. - Delete the local gas-fee-controller-init and messenger (+ tests + barrels). - Resolve GasFeeController via this.#wallet.getInstance in Engine.ts; drop it from the init registry, MESSENGER_FACTORIES, and the MessengerClientsToInitialize union (kept in MessengerClients / EngineState / actions / events / BACKGROUND_STATE_CHANGE_EVENT_NAMES). - Update CODEOWNERS and remove the stale eslint burndown entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The initializeWallet test asserted an exact instanceOptions object that omitted gasFeeController, so the newly wired builder output failed the toHaveBeenCalledWith match. Mock the builder to a sentinel and assert its slot, matching the sibling builders. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
⚡ Performance Test Results
❌ 1 test failed · 2 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ❌ Failed Tests (1)@swap-bridge-dev-team
✅ Passed Tests (1)
Branch: |



Description
Sources mobile's
GasFeeControllerfrom@metamask/walletinstead of the localcontroller-initwiring, continuing the shared controller-integration migration (@metamask/walletis the layer that extension, mobile, and wallet-cli all adopt).This integrates MetaMask/core#9527, which wires
GasFeeControllerinto the defaultWalletinitialization set. Because that PR is still a draft, the wallet and its sibling packages are pinned to preview builds (core commit7ed2770ae) in a separate, revert-before-readychore:commit.What changed:
wallet-init/instance-options/gas-fee-controller.ts(+ test) supplying only the mobile-specific options:clientId, the EIP-1559/legacy gas API endpoints, andgetCurrentNetworkLegacyGasAPICompatibility(mainnet ‖ BSC ‖ Polygon). The wallet now buildsgetProviderandgetCurrentNetworkEIP1559CompatibilityfromNetworkControlleritself and constructsGasFeeControllerafterNetworkControllervia core#9527's new dependency ordering.gas-fee-controller-initandgas-fee-controller-messenger(+ tests + barrels).this.#wallet.getInstance('GasFeeController')inEngine.tsand drops it from the init registry,MESSENGER_FACTORIES, and theMessengerClientsToInitializeunion (it remains inMessengerClients/EngineState/ actions / events /BACKGROUND_STATE_CHANGE_EVENT_NAMES, matching the already-migratedNetworkController/TransactionController).The chosen preview (
7ed2770ae) wires exactly mobile's already-adopted controller set plusGasFeeController— it does not wire any controller mobile still inits locally, so there is no double-registration at boot.Changelog
CHANGELOG entry: null
Related issues
Refs: MetaMask/core#9527
Manual testing steps
A handler for GasFeeController:* has already been registerederror.Screenshots/Recordings
N/A — no UI changes; this is an internal controller-wiring refactor.
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
🤖 Generated with Claude Code