Commit 89d2744
authored
refactor: remove BIP-44 flag from network hooks (MetaMask#26192)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR is part of a series to remove the legacy code after BIP-44 was
shipped, several components, hooks, views, etc. still uses the remote
feature flag for BIP-44 causing an unnecessary overcomplexity that can
be easily removed.
The change includes updating the network hooks.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1461
## **Manual testing steps**
Not applicable
## **Screenshots/Recordings**
Not applicable
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> This removes feature-flag gating around network enablement/selection
hooks, so behavior now always follows the post-BIP-44 multichain path;
mistakes could impact which networks are considered enabled or how
enabling is applied. Changes are localized but touch core hooks used
across network selection UI.
>
> **Overview**
> **Network hooks no longer branch on the BIP-44/multichain state2
remote flag.** `useNetworksToUse` always derives `networksToUse` and the
combined “all selected” state from selected internal accounts and
per-namespace network lists, and drops the
`isMultichainAccountsState2Enabled` return value.
>
> `useNetworkEnablement` now always enables via
`NetworkEnablementController.enableNetwork` (no namespace-specific
fallback), and `useCurrentNetworkInfo` always flattens
`enabledNetworksByNamespace` when computing enabled networks.
>
> Tests were updated to remove flag mocks/expectations, a smoke test for
adding popular networks was temporarily skipped pending BIP-44 UI
updates, and a debounce wait comment/timeout rationale was clarified in
`MultichainAccountSelectorList` tests.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8276e02. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 03597ba commit 89d2744
10 files changed
Lines changed: 21 additions & 226 deletions
File tree
- app
- component-library/components-temp/MultichainAccounts/MultichainAccountSelectorList
- components
- UI
- CustomNetworkSelector
- NetworkMultiSelector
- Views/TrendingView
- hooks
- useNetworkEnablement
- useNetworkSelection
- useNetworksToUse
- tests/smoke/networks
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 2 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
133 | 129 | | |
134 | 130 | | |
135 | 131 | | |
136 | | - | |
137 | 132 | | |
138 | 133 | | |
139 | 134 | | |
| |||
175 | 170 | | |
176 | 171 | | |
177 | 172 | | |
178 | | - | |
179 | 173 | | |
180 | 174 | | |
181 | 175 | | |
| |||
214 | 208 | | |
215 | 209 | | |
216 | 210 | | |
217 | | - | |
218 | 211 | | |
219 | 212 | | |
220 | 213 | | |
| |||
296 | 289 | | |
297 | 290 | | |
298 | 291 | | |
299 | | - | |
300 | 292 | | |
301 | 293 | | |
302 | 294 | | |
| |||
310 | 302 | | |
311 | 303 | | |
312 | 304 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | 305 | | |
327 | 306 | | |
328 | 307 | | |
| |||
519 | 498 | | |
520 | 499 | | |
521 | 500 | | |
522 | | - | |
523 | 501 | | |
524 | 502 | | |
525 | 503 | | |
| |||
568 | 546 | | |
569 | 547 | | |
570 | 548 | | |
571 | | - | |
572 | 549 | | |
573 | 550 | | |
574 | 551 | | |
| |||
Lines changed: 2 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 194 | + | |
201 | 195 | | |
202 | 196 | | |
203 | 197 | | |
| |||
265 | 259 | | |
266 | 260 | | |
267 | 261 | | |
268 | | - | |
269 | 262 | | |
270 | 263 | | |
271 | 264 | | |
| |||
394 | 387 | | |
395 | 388 | | |
396 | 389 | | |
397 | | - | |
398 | 390 | | |
399 | 391 | | |
400 | 392 | | |
| |||
725 | 717 | | |
726 | 718 | | |
727 | 719 | | |
728 | | - | |
| 720 | + | |
729 | 721 | | |
730 | | - | |
731 | 722 | | |
732 | 723 | | |
733 | 724 | | |
| |||
793 | 784 | | |
794 | 785 | | |
795 | 786 | | |
796 | | - | |
797 | 787 | | |
798 | 788 | | |
799 | 789 | | |
| |||
879 | 869 | | |
880 | 870 | | |
881 | 871 | | |
882 | | - | |
883 | 872 | | |
884 | 873 | | |
885 | 874 | | |
| |||
958 | 947 | | |
959 | 948 | | |
960 | 949 | | |
961 | | - | |
962 | 950 | | |
963 | 951 | | |
964 | 952 | | |
| |||
1033 | 1021 | | |
1034 | 1022 | | |
1035 | 1023 | | |
1036 | | - | |
1037 | 1024 | | |
1038 | 1025 | | |
1039 | 1026 | | |
| |||
1161 | 1148 | | |
1162 | 1149 | | |
1163 | 1150 | | |
1164 | | - | |
1165 | 1151 | | |
1166 | 1152 | | |
1167 | 1153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
52 | 41 | | |
53 | 42 | | |
54 | 43 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 44 | + | |
60 | 45 | | |
61 | 46 | | |
62 | 47 | | |
| |||
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 64 | | |
70 | 65 | | |
71 | 66 | | |
| |||
91 | 86 | | |
92 | 87 | | |
93 | 88 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 89 | + | |
99 | 90 | | |
100 | | - | |
| 91 | + | |
101 | 92 | | |
102 | 93 | | |
103 | 94 | | |
| |||
Lines changed: 1 addition & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 99 | | |
108 | 100 | | |
109 | 101 | | |
| |||
319 | 311 | | |
320 | 312 | | |
321 | 313 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | 314 | | |
326 | 315 | | |
327 | 316 | | |
| |||
673 | 662 | | |
674 | 663 | | |
675 | 664 | | |
676 | | - | |
677 | | - | |
| 665 | + | |
678 | 666 | | |
679 | 667 | | |
680 | | - | |
681 | 668 | | |
682 | 669 | | |
683 | 670 | | |
| |||
976 | 963 | | |
977 | 964 | | |
978 | 965 | | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | 966 | | |
983 | 967 | | |
984 | 968 | | |
| |||
1208 | 1192 | | |
1209 | 1193 | | |
1210 | 1194 | | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | 1195 | | |
1215 | 1196 | | |
1216 | 1197 | | |
| |||
1243 | 1224 | | |
1244 | 1225 | | |
1245 | 1226 | | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | 1227 | | |
1250 | 1228 | | |
1251 | 1229 | | |
| |||
1825 | 1803 | | |
1826 | 1804 | | |
1827 | 1805 | | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | 1806 | | |
1832 | 1807 | | |
1833 | 1808 | | |
| |||
1857 | 1832 | | |
1858 | 1833 | | |
1859 | 1834 | | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | 1835 | | |
1864 | 1836 | | |
1865 | 1837 | | |
| |||
0 commit comments