fix: migrate hype slip44 correct value NE ctrl#26231
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. |
50949ce to
ba86523
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26231 +/- ##
==========================================
+ Coverage 81.12% 81.14% +0.02%
==========================================
Files 4404 4412 +8
Lines 114202 114563 +361
Branches 24577 24661 +84
==========================================
+ Hits 92643 92964 +321
- Misses 15138 15160 +22
- Partials 6421 6439 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ba86523 to
f78b782
Compare
f78b782 to
fb14fbd
Compare
87e8b48 to
99910f9
Compare
99910f9 to
b4cdc15
Compare
b4cdc15 to
5969ed6
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
Context: HYPE token (
eip155:999/slip44:2457) was incorrectly set toeip155:999/slip44:1(1instead of2457)for some users in NetworkEnablementController.nativeAssetIdentifiers state.
This is because https://chainid.network/chains.json is fetched to populate this state,
and that chainId "999" references a "WanChain testnet" instead of HyperEVM.
PR MetaMask/core#7975 addresses future population by forcing an
override at fetch-time.
However such fetching is not always triggered if an user had already added the network,
hence the need for this migration that - ontop of the PR above - will migrate the incorrect
entry ('eip155:999/slip44:1') to the correct one ('eip155:999/slip44:2457').
This migration will operate only if an entry already exists AND is not 'eip155:999/slip44:2457'.
Changelog
CHANGELOG entry: migrates
NetworkEnablementController.nativeAssetIdentifiers['eip155:999']to valueeip155:999/slip44:2457if applicable.Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/NEB-574
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches persisted migration logic and mutates controller state in-place for affected users, so a bug could impact stored network asset identifiers. Scope is narrowly targeted to one key/value and is covered by focused unit tests and defensive guards.
Overview
Adds migration
121to correct the persistedNetworkEnablementController.nativeAssetIdentifiers['eip155:999']value toeip155:999/slip44:2457only when the key exists and is set incorrectly; invalid/missing controller shapes are detected and reported viacaptureExceptionwithout mutating state.Introduces
121_utils.tsfor type-guard/validation logic (with Sentry reporting) and adds Jest coverage for the main success path and all early-return/error conditions. Registers the new migration inmigrations/index.tsand bumps@metamask/network-enablement-controllerfrom^4.1.0to^4.1.1.Written by Cursor Bugbot for commit 5969ed6. This will update automatically on new commits. Configure here.