Commit 8de24e5
chore(runway): cherry-pick feat: integrate earn-controller 12.0.0 to fix broken pooled-staking deposits and withdrawals (#28819)
- feat: integrate earn-controller 12.0.0 to fix broken pooled-staking
deposits and withdrawals cp-7.73.0 (#28737)
<!--
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**
This PR bumps the `@metamask/earn-controller` dependency to version
`12.0.0`. This is required to address a release blocking bug where
pooled-staking deposits and withdrawals are blocked.
<!--
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?
-->
## **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: bumped @metamask/earn-controller to 12.0.0 and fixed
breaking changes
## **Related issues**
Fixes:
- [MUSD-619: Users are unable to stake ETH or lend from token details
page](https://consensyssoftware.atlassian.net/browse/MUSD-619)
## **Manual testing steps**
```gherkin
Feature: Ethereum Pooled-Staking
Scenario: user wants to stake ETH
Given user has no staked ETH
When user visits Ethereum's asset details screen
Then the "Stake" button is rendered in the empty state CTA
Scenario: user wants to unstake ETH
Given user has staked ETH
When user visits Ethereum's asset details screen
Then the "Unstake" button is rendered in the empty state CTA
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
The Stake and Unstake buttons would not render due to EarnController
initialization failures.
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/ba0d15a5-d95a-47c6-8809-0bd64c4a4626
## **Pre-merge author checklist**
- [x] 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).
- [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-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**
> Medium risk because it upgrades a core dependency
(`@metamask/earn-controller`) and changes EarnController
initialization/messenger delegation, which can affect staking/lending
flows at runtime.
>
> **Overview**
> Upgrades `@metamask/earn-controller` from `^10.0.0` to `^12.0.0`
(lockfile updated accordingly).
>
> Updates EarnController wiring to match the new API: removes the
dedicated init messenger, delegates `NetworkController:getState` (and
`AccountTreeController:stateChange`) through the main EarnController
messenger, and changes `earnControllerInit` to construct the controller
without `selectedNetworkClientId` and explicitly call
`controller.init()`.
>
> Adjusts mocks/fixtures/snapshots to include the new `EarnController`
state key `tron_staking: null` so tests and initial background state
stay in sync.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
da2c3bf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[0770e7b](0770e7b)
---------
Co-authored-by: Matthew Grainger <46547583+Matt561@users.noreply.github.com>
Co-authored-by: Matthew Grainger <matthew.grainger@consensys.net>1 parent 5720a29 commit 8de24e5
11 files changed
Lines changed: 45 additions & 104 deletions
File tree
- app
- components/UI/Earn
- __mocks__
- hooks
- core/Engine
- controllers
- messengers
- util
- logs/__snapshots__
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
9 | 4 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 5 | + | |
14 | 6 | | |
15 | 7 | | |
16 | 8 | | |
17 | 9 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 10 | + | |
21 | 11 | | |
22 | 12 | | |
23 | 13 | | |
24 | 14 | | |
25 | 15 | | |
26 | 16 | | |
27 | 17 | | |
28 | | - | |
29 | 18 | | |
30 | 19 | | |
31 | 20 | | |
| |||
39 | 28 | | |
40 | 29 | | |
41 | 30 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 31 | | |
48 | 32 | | |
49 | 33 | | |
| |||
60 | 44 | | |
61 | 45 | | |
62 | 46 | | |
63 | | - | |
64 | 47 | | |
65 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
66 | 54 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 16 | + | |
| 17 | + | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
29 | 25 | | |
30 | 26 | | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
Lines changed: 2 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
13 | 9 | | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | | - | |
18 | | - | |
| 13 | + | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
| |||
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 114 | + | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
| |||
194 | 191 | | |
195 | 192 | | |
196 | 193 | | |
197 | | - | |
| 194 | + | |
198 | 195 | | |
199 | 196 | | |
200 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
967 | 968 | | |
968 | 969 | | |
969 | 970 | | |
| 971 | + | |
970 | 972 | | |
971 | 973 | | |
972 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
| 698 | + | |
| 699 | + | |
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
0 commit comments