Commit 20b69b3
authored
fix: do not display Snap account dialogs for multichain wallet Snaps (MetaMask#23218)
## **Description**
Similar fix (technical details on this PR too):
- MetaMask/metamask-extension#38061
## **Changelog**
CHANGELOG entry: Prevent any dialogs for multichain wallet Snaps
(Solana, Bitcoin, Tron)
## **Related issues**
Fixes:
- MetaMask#22465
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
### **Before**
### **After**
## **Pre-merge author checklist**
- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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]
> Skip Snap account dialogs and naming for preinstalled multichain
wallet Snaps under state 2, with E2E-safe fallback and updated tests.
>
> - **Core/SnapKeyring**:
> - Enhance `addAccount` flow to auto-skip dialogs for preinstalled
multichain wallet Snaps when multichain accounts state 2 is enabled.
> - Introduce `isMultichainWalletSnap` and `isE2E` checks; derive
`skipAll` to bypass confirmation, name suggestion, and selection steps.
> - Set `accountNameSuggestion` to ``''`` when skipping to avoid race
conditions; update `skipApprovalFlow` logic accordingly.
> - Preserve legacy behavior in E2E runs by disabling skips.
> - **Tests**:
> - Mock `isMultichainWalletSnap` and extend scenarios for state 2,
verifying dialog skipping and naming behavior.
> - Minor adjustments to expectations around flows and account
naming/selection.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
fd81303. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 451d0b9 commit 20b69b3
2 files changed
Lines changed: 35 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
249 | 271 | | |
250 | 272 | | |
251 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
252 | 279 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 280 | + | |
256 | 281 | | |
257 | 282 | | |
258 | 283 | | |
259 | 284 | | |
260 | 285 | | |
261 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
262 | 290 | | |
263 | 291 | | |
264 | 292 | | |
265 | 293 | | |
266 | 294 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | 295 | | |
272 | 296 | | |
273 | 297 | | |
| |||
0 commit comments