Commit 1860493
refactor: migrate
## Explanation
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
This PR migrates the `ApprovalController`, `TransactionController`,
`GasFeeController`, `NetworkController`, `AssetsContractController`,
`TokensController` and `NftController` classes to the new
`@metamask/messenger` comm system along with their tests, as opposed to
the one exported from `@metamask/base-controller`.
The three packages are being migrated together because the
`TransactionControllerIntegration.test.ts` file ties them together.
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
* Related to #5626
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Migrates major controllers to the new @metamask/messenger with updated
state metadata and tests, adds StaticIntervalPollingControllerNext, and
updates package configs and changelogs (breaking).
>
> - **Messaging/Controllers (BREAKING)**:
> - Migrate `ApprovalController`, `TransactionController`,
`NetworkController`, `GasFeeController`, `AssetsContractController`,
`NftController`, `TokensController` from `RestrictedMessenger` to new
`@metamask/messenger`.
> - Replace `@metamask/base-controller` APIs with
`@metamask/base-controller/next` where applicable; update state metadata
keys (`anonymous` -> `includeInDebugSnapshot`).
> - Update controller messenger types, action/event registrations
(`this.messenger.registerActionHandler/subscribe/publish/call`).
> - Refactor tests to use root and namespaced messengers with delegated
actions/events.
> - **Gas Fee/Pooling**:
> - Add `StaticIntervalPollingControllerNext`; `GasFeeController` now
extends it.
> - Export `GasFeeMessenger` type.
> - **Configs/Deps**:
> - Add `@metamask/messenger` dependency and TS project references
across affected packages; adjust imports to `/next` variants.
> - Update README controller dependency graph to include `messenger`
links.
> - **Changelogs**:
> - Note BREAKING changes for the controllers above; document new export
in gas-fee-controller.
> - **Misc**:
> - Minor eslint threshold tweak; yarn.lock updates.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c2dee6e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Mark Stacey <markjstacey@gmail.com>{Approval,Transaction,Network,GasFee,AssetsContract,Nft,Tokens}Controller messengers (#6386)1 parent 8f2acc5 commit 1860493
File tree
44 files changed
+859
-621
lines changed- packages
- approval-controller
- src
- assets-controllers
- src
- base-controller/src/next
- gas-fee-controller
- src
- network-controller
- src
- tests
- polling-controller
- src
- transaction-controller
- src
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+859
-621
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| 280 | + | |
278 | 281 | | |
279 | 282 | | |
280 | 283 | | |
| |||
333 | 336 | | |
334 | 337 | | |
335 | 338 | | |
| 339 | + | |
336 | 340 | | |
337 | 341 | | |
338 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
Lines changed: 52 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
| |||
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| 19 | + | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
| |||
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
| |||
223 | 237 | | |
224 | 238 | | |
225 | 239 | | |
226 | | - | |
| 240 | + | |
227 | 241 | | |
228 | | - | |
| 242 | + | |
229 | 243 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
239 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
240 | 260 | | |
241 | 261 | | |
242 | 262 | | |
| |||
250 | 270 | | |
251 | 271 | | |
252 | 272 | | |
253 | | - | |
| 273 | + | |
254 | 274 | | |
255 | 275 | | |
256 | 276 | | |
| |||
445 | 465 | | |
446 | 466 | | |
447 | 467 | | |
448 | | - | |
| 468 | + | |
449 | 469 | | |
450 | 470 | | |
451 | 471 | | |
| |||
638 | 658 | | |
639 | 659 | | |
640 | 660 | | |
641 | | - | |
| 661 | + | |
642 | 662 | | |
643 | 663 | | |
644 | 664 | | |
| |||
678 | 698 | | |
679 | 699 | | |
680 | 700 | | |
681 | | - | |
| 701 | + | |
682 | 702 | | |
683 | 703 | | |
684 | 704 | | |
| |||
1269 | 1289 | | |
1270 | 1290 | | |
1271 | 1291 | | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
| 1292 | + | |
1276 | 1293 | | |
1277 | 1294 | | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
| 1295 | + | |
1283 | 1296 | | |
1284 | 1297 | | |
1285 | 1298 | | |
1286 | 1299 | | |
1287 | 1300 | | |
1288 | | - | |
| 1301 | + | |
1289 | 1302 | | |
1290 | 1303 | | |
1291 | 1304 | | |
| |||
1295 | 1308 | | |
1296 | 1309 | | |
1297 | 1310 | | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
| 1311 | + | |
1302 | 1312 | | |
1303 | 1313 | | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
| 1314 | + | |
1309 | 1315 | | |
1310 | 1316 | | |
1311 | 1317 | | |
1312 | 1318 | | |
1313 | 1319 | | |
1314 | | - | |
| 1320 | + | |
1315 | 1321 | | |
1316 | 1322 | | |
1317 | 1323 | | |
| |||
1321 | 1327 | | |
1322 | 1328 | | |
1323 | 1329 | | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
| 1330 | + | |
1328 | 1331 | | |
1329 | 1332 | | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
| 1333 | + | |
1335 | 1334 | | |
1336 | 1335 | | |
1337 | 1336 | | |
| |||
1344 | 1343 | | |
1345 | 1344 | | |
1346 | 1345 | | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1351 | 1353 | | |
1352 | 1354 | | |
1353 | 1355 | | |
| |||
1719 | 1721 | | |
1720 | 1722 | | |
1721 | 1723 | | |
1722 | | - | |
| 1724 | + | |
1723 | 1725 | | |
1724 | 1726 | | |
1725 | 1727 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
5 | | - | |
6 | | - | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | | - | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | | - | |
141 | | - | |
142 | | - | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
413 | 414 | | |
414 | 415 | | |
415 | 416 | | |
416 | | - | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
421 | | - | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| |||
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
431 | | - | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
436 | | - | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | | - | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | 446 | | |
446 | | - | |
| 447 | + | |
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
451 | | - | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
456 | | - | |
| 457 | + | |
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
461 | | - | |
| 462 | + | |
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
466 | | - | |
| 467 | + | |
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
471 | | - | |
| 472 | + | |
472 | 473 | | |
473 | 474 | | |
474 | 475 | | |
| |||
0 commit comments