Commit 8f0baff
authored
fix(assets-controllers): revert Snap account-asset enrichment added in 109.3.0 (#9454)
## 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?
-->
## 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
-->
## 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/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **High Risk**
> Marked **BREAKING** in the changelog: removes exported types, changes
messenger event payloads, and alters balance merge semantics—consumers
relying on 109.3.0 enrichment or `refreshed` must migrate.
>
> **Overview**
> **Breaking revert** of the 109.3.0 Snap `getAccountAssetInfo` flow:
multichain balance rows are again `{ amount, unit }` only, with
enrichment expected in the unified assets controller on the client.
>
> `MultichainBalancesController` drops snap enrichment calls, the
`account-asset-info` module, and exported types `AccountAssetInfo` /
`MultichainAccountBalance`. Asset-list handling no longer treats
`refreshed` assets (only `added` / `removed`), and balance merges on
updates are simplified (e.g. full replace on `updateBalance`, shallow
assign on `accountBalancesUpdated`).
>
> `MultichainAssetsController:accountAssetListUpdated` no longer emits a
`refreshed` list for snap adds that are already tracked; its payload
aligns with `AccountsController:accountAssetListUpdated`. Token
selectors stop exposing `accountAssetInfo` on `Asset` items. Tests and
changelog document the breaking removals; balance tests add coverage for
pruning stale balances when assets are removed.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2263d69. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 658c577 commit 8f0baff
10 files changed
Lines changed: 144 additions & 991 deletions
File tree
- packages/assets-controllers
- src
- MultichainAssetsController
- MultichainBalancesController
- selectors
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
Lines changed: 0 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | 799 | | |
844 | 800 | | |
845 | 801 | | |
| |||
Lines changed: 7 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 64 | | |
82 | 65 | | |
83 | | - | |
| 66 | + | |
84 | 67 | | |
85 | 68 | | |
86 | 69 | | |
| |||
468 | 451 | | |
469 | 452 | | |
470 | 453 | | |
471 | | - | |
472 | | - | |
473 | | - | |
| 454 | + | |
474 | 455 | | |
475 | 456 | | |
476 | 457 | | |
| |||
487 | 468 | | |
488 | 469 | | |
489 | 470 | | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | 471 | | |
498 | 472 | | |
499 | 473 | | |
| |||
507 | 481 | | |
508 | 482 | | |
509 | 483 | | |
510 | | - | |
| 484 | + | |
511 | 485 | | |
512 | 486 | | |
513 | 487 | | |
514 | 488 | | |
515 | 489 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | 490 | | |
531 | 491 | | |
532 | 492 | | |
| |||
541 | 501 | | |
542 | 502 | | |
543 | 503 | | |
544 | | - | |
| 504 | + | |
545 | 505 | | |
546 | 506 | | |
547 | 507 | | |
| |||
558 | 518 | | |
559 | 519 | | |
560 | 520 | | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
566 | 524 | | |
567 | 525 | | |
568 | 526 | | |
| |||
0 commit comments