Commit 8a53979
release(runway): cherry-pick fix: patch TokenBalancesController to resolve missing balance state (#38140)
- fix: cp-13.10.1 patch TokenBalancesController to resolve missing
balance state (#38126)
## **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?
-->
[](https://codespaces.new/MetaMask/metamask-extension/pull/38126?quickstart=1)
## **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: fix missing native token balances in wallet balance
## **Related issues**
Fixes: #38114
## **Manual testing steps**
Onboard or existing user with AccountsAPI enabled
1. Go to a network with native + erc tokens
2. Notice aggregated wallet balance - it should have both native + erc
tokens aggregated together for the balance.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
https://www.loom.com/share/aeccc8e3cef4479da0e9d44fc5ebf4fa
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/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]
> Patches `TokenBalancesController` to use lowercase account addresses
for balance reads/writes and wires the patched
`@metamask/[email protected]` via Yarn patch.
>
> - **Assets Controllers Patch
(`@metamask/[email protected]`)**:
> - Normalize `account` to lowercase in `TokenBalancesController` when
reading/updating `d.tokenBalances` (cjs/mjs builds), ensuring balance
updates are applied.
> - **Dependencies**:
> - Switch `@metamask/assets-controllers` in `package.json` to a Yarn
patch source and add patched entry in `yarn.lock`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
75c9d95. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[a2fe8c4](a2fe8c4)
Co-authored-by: Prithpal Sooriya <[email protected]>1 parent 8f631e6 commit 8a53979
File tree
3 files changed
+103
-3
lines changed- .yarn/patches
3 files changed
+103
-3
lines changedLines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5591 | 5591 | | |
5592 | 5592 | | |
5593 | 5593 | | |
5594 | | - | |
| 5594 | + | |
5595 | 5595 | | |
5596 | 5596 | | |
5597 | 5597 | | |
| |||
5643 | 5643 | | |
5644 | 5644 | | |
5645 | 5645 | | |
| 5646 | + | |
| 5647 | + | |
| 5648 | + | |
| 5649 | + | |
| 5650 | + | |
| 5651 | + | |
| 5652 | + | |
| 5653 | + | |
| 5654 | + | |
| 5655 | + | |
| 5656 | + | |
| 5657 | + | |
| 5658 | + | |
| 5659 | + | |
| 5660 | + | |
| 5661 | + | |
| 5662 | + | |
| 5663 | + | |
| 5664 | + | |
| 5665 | + | |
| 5666 | + | |
| 5667 | + | |
| 5668 | + | |
| 5669 | + | |
| 5670 | + | |
| 5671 | + | |
| 5672 | + | |
| 5673 | + | |
| 5674 | + | |
| 5675 | + | |
| 5676 | + | |
| 5677 | + | |
| 5678 | + | |
| 5679 | + | |
| 5680 | + | |
| 5681 | + | |
| 5682 | + | |
| 5683 | + | |
| 5684 | + | |
| 5685 | + | |
| 5686 | + | |
| 5687 | + | |
| 5688 | + | |
| 5689 | + | |
| 5690 | + | |
| 5691 | + | |
| 5692 | + | |
| 5693 | + | |
| 5694 | + | |
| 5695 | + | |
| 5696 | + | |
| 5697 | + | |
5646 | 5698 | | |
5647 | 5699 | | |
5648 | 5700 | | |
| |||
32492 | 32544 | | |
32493 | 32545 | | |
32494 | 32546 | | |
32495 | | - | |
| 32547 | + | |
32496 | 32548 | | |
32497 | 32549 | | |
32498 | 32550 | | |
| |||
0 commit comments