[pull] main from MetaMask:main#291
Merged
Merged
Conversation
…ring social login rehydration (#21903) ## **Description** This PR adds MetaMetrics tracking for when users click the "Use a different login method" button during social login rehydration flow **What is the reason for the change?** We need to track when users decide to switch login methods during the rehydration phase **What is the improvement/solution?** Added a new MetaMetrics event `UseDifferentLoginMethodClicked` that fires when: - User is in social login flow - Onboarding is not completed (rehydration phase) - User clicks "Use a different login method" on the welcome back screen ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/SL-241 ## **Manual testing steps** 1. Start a social login import flow (Google or Apple) 2. Complete authentication with the provider 3. Navigate to the unlock/rehydration screen 4. Click "Use a different login method" button 5. Verify the `USE_DIFFERENT_LOGIN_METHOD_CLICKED` event is tracked with `account_type: 'social'` ## **Screenshots/Recordings** ### **Before** No MetaMetrics event tracked when clicking "Use a different login method" during rehydration ### **After** `USE_DIFFERENT_LOGIN_METHOD_CLICKED` event tracked with proper account_type property ## **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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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] > Adds a new MetaMetrics event and triggers it when users in OAuth rehydration click "Use a different login method". > > - **Analytics** > - Add `USE_DIFFERENT_LOGIN_METHOD_CLICKED` to `EVENT_NAME` and expose via `MetaMetricsEvents` in `app/core/Analytics/MetaMetrics.events.ts`. > - **Login** > - In `app/components/Views/Login/index.tsx`, fire `MetaMetricsEvents.USE_DIFFERENT_LOGIN_METHOD_CLICKED` with `{ account_type: 'social' }` when `handleUseOtherMethod` is used during OAuth onboarding rehydration. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9951208. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…22047) <!-- 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** <!-- 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? --> This PR aims to make burn/null address sending alert to be a blocking alert. See the task details for further information ## **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: Make burn and null address sending a blocking alert ## **Related issues** Fixes: #22046 ## **Manual testing steps** N/A ## **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] > Make burn/null address alerts blocking and update tests accordingly. > > - **Alerts**: > - `useBurnAddressAlert`: Set `isBlocking: true` for `BurnAddress` alert in `Severity.Danger`. > - **Tests**: > - Update `useBurnAddressAlert.test.ts` to expect `isBlocking: true` for burn/null address cases (direct and nested recipients, mixed/uppercase casing). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9093654. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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** Remove not needed workaround for change password e2e test issue <!-- 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: #16758 ## **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** <!-- 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] > Remove iOS CI-specific workaround from the change-password flow in the delete wallet E2E test. > > - **E2E tests**: > - Remove iOS CI-specific workaround in `e2e/specs/settings/delete-wallet.spec.ts` that tapped `TabBarComponent.tapWallet()` after changing password. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e9f931. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
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**
We were not getting Tron addresses for all BIP44 accounts due to a
mismatch between what the `multichain-account-service`'s `TrxProvider`
called the Snap with and what the Snap's keyring handler expected. Both
of these dependencies have been fixed. This PR bumps the version of both
dependencies to a healthy one.
## **Changelog**
CHANGELOG entry: Bump `@metamask/multichain-account-service` to version
2.0.1
CHANGELOG entry: Bump `@metamask/tron-wallet-snap` to version 1.6.1
## **Related issues**
Fixes: NWNT-646
## **Manual testing steps**
```gherkin
Feature: Tron address generation
Scenario:
When user finishes onboarding with his Seed Phrase
Then we should have X accounts initialized and all of them should have a Tron address associated with them
When user finishes onboarding with his Seed Phrase and adds a new account
Then the new account should have a Tron address associated with it
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
n/a
### **After**
n/a
## **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]
> Bumps `@metamask/multichain-account-service` to ^2.0.1 and
`@metamask/tron-wallet-snap` to ^1.6.1 with corresponding lockfile
updates.
>
> - **Dependencies**:
> - Bump `@metamask/multichain-account-service` to `^2.0.1` in
`package.json` (updated `yarn.lock`).
> - Bump `@metamask/tron-wallet-snap` to `^1.6.1` in `package.json`
(updated `yarn.lock`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f7dc608. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
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**
<!--
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?
-->
- Add option to wait for the confirm button to disappear on Android,
addressing cases where the button may be obscured, this should force and
error and cause the action to be retried
## **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:
## **Related issues**
Fixes:
## **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**
<!-- 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
- [ ] 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]
> Updates the e2e confirm action to wait for the confirm button to
disappear on Android before proceeding.
>
> - **E2E / Browser Confirmations**
> - `e2e/pages/Browser/Confirmations/FooterActions.ts`
> - Update `tapConfirmButton()` to pass `waitForElementToDisappear`
(Android-only) to `Gestures.waitAndTap`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f51e416. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
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**
<!--
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?
-->
Adds a skeleton loader to hide the gas fees indicator until simulation
details are determined and gasUsed can be shown.
## **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:
## **Related issues**
Fixes:
## **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**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
<img width="419" height="895" alt="Screenshot 2025-10-31 at 15 51 06"
src="https://github.com/user-attachments/assets/1ba89f82-8398-4893-a084-a67b8ec2f651"
/>
## **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]
> Adds a skeleton loader and waits for simulation results before
showing/editing gas fees in confirmations.
>
> - **UI (Gas Fees)**
> - Adds `SkeletonPlaceholder` and `SkeletonEstimationInfo` and defers
gas fee display until simulation data is available
(`isSimulationLoading`).
> - Integrates `useBalanceChanges` with `simulationData`, `chainId`, and
`networkClientId` from `useTransactionMetadataRequest` to gate
rendering.
> - Updates `EstimationInfo`/`RenderEstimationInfo` logic to show
skeleton or "Paid by MetaMask" when sponsored; otherwise display
fiat/native and `SelectedGasFeeToken`.
> - Disables clickable edit state while simulation is loading.
> - **Tests**
> - Mocks `useBalanceChanges` and injects `simulationData` into test
state; adjusts expectations across gas-fee row tests.
> - Updates contract interaction test to mock `useBalanceChanges` and
maintain existing assertions.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ce0b2fb. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- 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** <!-- 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? --> Use new asset sorting when balances are the same (or $0): ETH Mainnet ETH Linea SOL Solana BTC Bitcoin TRX Tron ETH Base ETH Arbitrum BNB Binance ETH Optimism POL Polygon ## **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: Changed order of assets when their fiat balances are the same ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1259 ## **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** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/e8474a20-740f-4503-831f-17f0747d0183 ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/64b7f149-b5f5-45ca-9b68-fc9a4b23a417 ## **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] > Adds priority-based asset sorting (fiat desc with native/network tie-breakers) and integrates it into the assets selector with tests. > > - **Assets Sorting**: > - Introduces `sortAssetsWithPriority` with `compareFiatBalanceWithPriority` to sort by fiat desc, then prioritize native assets and a default native chain order; fall back to name. > - Defines `defaultNativeAssetOrder` (e.g., `POLYGON`, `OPTIMISM`, `BSC`, `ARBITRUM`, `BASE`, `TRX`, `BTC`, `SOL`, `LINEA_MAINNET`, `MAINNET`). > - **Integration**: > - Replaces `sortAssets` with `sortAssetsWithPriority` in `app/selectors/assets/assets-list.ts` when applying `tokenSortConfig`. > - **Tests**: > - Adds `sortAssetsWithPriority.test.ts` covering name sort, fiat balance sort, native vs token handling, and chain priority tie-breakers. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2f0a9dd. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
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**
The purpose of this PR is to add e2e coverage for the claim flow in
predictions.
## **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:
## **Related issues**
Fixes:
## **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**
<!-- 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**
- [ ] 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]
> Adds predictions claim E2E tests and overhauls Polymarket mocks
(resolved/winning positions, balance/receipt handling), plus testID
updates and Polygon gas fee mock.
>
> - **E2E Tests (Predictions)**:
> - New spec `predict-claim-positions.spec.ts` to validate claim flow
end-to-end.
> - Refines cash-out spec to use new helpers/method names.
> - Adds `PredictClaimPage` and `PredictHelpers` (Portugal location
setup).
> - **E2E Mocks/Fixtures (Polymarket)**:
> - Splits resolved positions into
`POLYMARKET_RESOLVED_LOST_POSITIONS_RESPONSE` and separate
`POLYMARKET_WINNING_POSITIONS_RESPONSE`; controllable inclusion via
`POLYMARKET_POSITIONS_WITH_WINNINGS_MOCKS`.
> - New balance update flow `POLYMARKET_UPDATE_USDC_BALANCE_MOCKS`
(handles USDC balance refresh, nonce, receipts) and removal of claimed
positions `POLYMARKET_REMOVE_CLAIMED_POSITIONS_MOCKS`.
> - Adds mock transaction receipts and priorities; enhances RPC mocks
(EIP-7702 code, transaction count, receipt).
> - Introduces Polygon gas fees mock (network 137) and updates default
gas API mocks.
> - Reorganizes/exports comprehensive `POLYMARKET_COMPLETE_MOCKS` and
`POLYMARKET_ALL_POSITIONS_MOCKS`.
> - **App Components/TestIDs**:
> - Replace dynamic selector usage with enum IDs in `PredictPosition`
and `PredictPositionResolved` (`CURRENT_POSITION_CARD`,
`RESOLVED_POSITION_CARD`).
> - Add testIDs to claim confirmation amount/footer (e.g.,
`CLAIM_AMOUNT_CONTAINER`, `CLAIM_CONFIRM_BUTTON`).
> - **Selectors/Pages Updates**:
> - New `PredictPositionSelectorsIDs`; cleanup of old helper.
> - Wallet/Activities pages: add getters (resolved card, claim button),
rename tap helpers (`tapPredictPosition`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e5f581e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
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**
<!--
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?
-->
This PR updates the Card Experimental Switch feature flag to include
version gating.
## **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:
## **Related issues**
Fixes:
## **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**
<!-- 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]
> Adds version-gated evaluation for the card experimental switch
(`cardExperimentalSwitch2`) using `validatedVersionGatedFeatureFlag`,
updates typing to `GateVersionedFeatureFlag`, and adjusts tests
accordingly.
>
> - **Feature Flags**:
> - Implement version-gated logic for `selectCardExperimentalSwitch`
using `validatedVersionGatedFeatureFlag` and new remote flag
`cardExperimentalSwitch2`.
> - Rename/standardize flag type to `GateVersionedFeatureFlag` and apply
to `displayCardButton` and experimental switch selectors.
> - **Tests**:
> - Add/adjust tests for version-gated behaviors
(enabled/disabled/version unmet/malformed) for both `displayCardButton`
and `cardExperimentalSwitch2`.
> - Mock `validatedVersionGatedFeatureFlag` and
`core/Engine/controllers/remote-feature-flag-controller` override.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
24824b0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
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**
<!--
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:
## **Related issues**
Fixes:
## **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**
<!-- 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**
- [ ] 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]
> Updates selectors and waits to stabilize Send and Bridge test flows,
including using `review-button`, simplifying iOS token selection, and
extending Solana confirmation wait.
>
> - **E2E/Tests**:
> - **Send flow**:
> - Use `review-button` ID for `SendScreen` review action and assert
visibility before tapping.
> - Solana test waits for `ConfirmationScreen.isVisible('Solana',
180000)` to allow longer confirmation time.
> - **Bridge flow**:
> - Simplify iOS token selection to use `getElementByID` for
`asset-<networkId>-<token>`.
> - **Selectors/UX waits**:
> - Add explicit visibility checks and logs to improve test reliability.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
79dbcee. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
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 adds the ability to send fixtures to `withFixtures` as a
function as some fixtures require dynamic ports and fixtures are
provided before having these ports.
<!--
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:
## **Related issues**
Fixes:
## **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**
<!-- 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**
- [ ] 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]
> withFixtures now accepts a fixture factory resolved after local nodes
start, enabling dynamic Anvil RPC ports; tests migrated from
withGanacheNetwork to withNetworkController; docs and types updated;
withGanacheNetwork deprecated.
>
> - **E2E Framework**:
> - `withFixtures` can now take a function `fixture(ctx)` and resolves
it after local nodes start so dynamic ports (`localNodes`) are
available.
> - Update `WithFixturesOptions` types and docs to accept
`FixtureBuilder | (ctx) => FixtureBuilder | Promise<...>`.
> - Resolve fixture in `FixtureHelper` post local-node startup; pass
`localNodes` to factory.
> - Add `AnvilManager#getPort()` for retrieving the actual RPC port.
> - Deprecate `FixtureBuilder.withGanacheNetwork` (adds optional `port =
AnvilPort()`); prefer `withNetworkController`.
> - Docs: README tables/examples updated; remove Ganache-specific
example.
> - **Test Migration**:
> - Replace `.withGanacheNetwork()` with function-based fixtures using
`.withNetworkController({ providerConfig: { chainId: '0x539', rpcUrl:
\`http://localhost:${rpcPort ?? AnvilPort()}\`, ... } })` across specs
in `e2e/specs/**`.
> - Import and use `AnvilManager`/`AnvilPort` to derive dynamic RPC
URLs; minor test tweaks (e.g., removed manual network selection, added
waits).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
16409c8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )