Commit 2eacab6
authored
fix: max button 7702 re-enable cp-7.69.0 (MetaMask#27373)
<!--
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**
Fixes a bug where the max button was no longer showing on select
networks.
<!--
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: null
## **Related issues**
Fixes: MetaMask#27381
## **Manual testing steps**
```gherkin
Feature: swap max button
Scenario: user is using the swaps experience
Given the chain they are on supports gasless
When user selects tokens
Then the max button should be visible
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **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**
> Changes the gating logic for showing the Bridge/Swap “Max” option for
native assets, so regressions could hide/show the button on certain
networks depending on `gasIncluded`/`gasIncluded7702` selector outputs.
>
> **Overview**
> Updates `useShouldRenderMaxOption` to **stop depending on Smart
Transactions/send-bundle support and quote sponsorship** and instead
show the Max option for native assets when
`selectGasIncludedQuoteParams` indicates `gasIncluded` or
`gasIncluded7702`.
>
> Refactors the corresponding hook tests to mock the new selector shape
and to cover gas-included vs 7702-enabled vs disabled scenarios
(including non‑EVM native tokens), removing the old STX/send-bundle
assertions.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e2b4a06. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 3ac4c6e commit 2eacab6
2 files changed
Lines changed: 46 additions & 98 deletions
File tree
- app/components/UI/Bridge/hooks/useShouldRenderMaxOption
Lines changed: 6 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | | - | |
| 2 | + | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 5 | + | |
12 | 6 | | |
13 | | - | |
14 | 7 | | |
15 | 8 | | |
16 | 9 | | |
17 | 10 | | |
18 | | - | |
| 11 | + | |
19 | 12 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 13 | + | |
| 14 | + | |
38 | 15 | | |
39 | 16 | | |
40 | 17 | | |
| |||
50 | 27 | | |
51 | 28 | | |
52 | 29 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 30 | + | |
59 | 31 | | |
Lines changed: 40 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
12 | | - | |
13 | 8 | | |
14 | 9 | | |
15 | 10 | | |
| |||
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 17 | | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
30 | | - | |
31 | 21 | | |
32 | | - | |
33 | 22 | | |
34 | 23 | | |
35 | 24 | | |
36 | 25 | | |
37 | 26 | | |
38 | 27 | | |
39 | 28 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 29 | | |
48 | 30 | | |
49 | 31 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 32 | | |
54 | 33 | | |
55 | 34 | | |
| |||
65 | 44 | | |
66 | 45 | | |
67 | 46 | | |
68 | | - | |
69 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
70 | 55 | | |
71 | 56 | | |
72 | 57 | | |
73 | 58 | | |
74 | 59 | | |
75 | 60 | | |
76 | | - | |
| 61 | + | |
77 | 62 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 63 | | |
83 | | - | |
84 | 64 | | |
85 | 65 | | |
86 | 66 | | |
| |||
109 | 89 | | |
110 | 90 | | |
111 | 91 | | |
112 | | - | |
113 | | - | |
| 92 | + | |
| 93 | + | |
114 | 94 | | |
115 | 95 | | |
116 | | - | |
117 | 96 | | |
118 | 97 | | |
119 | 98 | | |
| |||
122 | 101 | | |
123 | 102 | | |
124 | 103 | | |
125 | | - | |
126 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
127 | 109 | | |
128 | 110 | | |
129 | | - | |
130 | 111 | | |
131 | 112 | | |
132 | 113 | | |
133 | 114 | | |
134 | 115 | | |
135 | | - | |
| 116 | + | |
136 | 117 | | |
137 | 118 | | |
138 | | - | |
139 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
140 | 124 | | |
141 | 125 | | |
142 | | - | |
143 | 126 | | |
144 | 127 | | |
145 | 128 | | |
| |||
148 | 131 | | |
149 | 132 | | |
150 | 133 | | |
151 | | - | |
152 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
153 | 139 | | |
154 | 140 | | |
155 | | - | |
156 | 141 | | |
157 | 142 | | |
158 | 143 | | |
159 | 144 | | |
160 | 145 | | |
161 | | - | |
| 146 | + | |
162 | 147 | | |
163 | 148 | | |
164 | | - | |
165 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
166 | 154 | | |
167 | 155 | | |
168 | 156 | | |
169 | 157 | | |
170 | 158 | | |
171 | 159 | | |
172 | 160 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 161 | + | |
187 | 162 | | |
188 | 163 | | |
189 | | - | |
| 164 | + | |
190 | 165 | | |
191 | 166 | | |
192 | 167 | | |
193 | 168 | | |
194 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
195 | 174 | | |
196 | 175 | | |
197 | | - | |
198 | | - | |
199 | 176 | | |
200 | 177 | | |
201 | 178 | | |
202 | 179 | | |
203 | 180 | | |
204 | | - | |
205 | 181 | | |
206 | 182 | | |
207 | 183 | | |
0 commit comments