-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Feat/hip 3 fees #21798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Feat/hip 3 fees #21798
+24,973
−1,805
Conversation
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
<!--
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 test is to increase predictions e2e coverage by
adding a cash out position test. Scenario 4 from Test Plan
## **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 an end-to-end cash-out flow test with comprehensive Polymarket
API/RPC/order-book mocks and new testIDs to enable stable UI automation.
>
> - **E2E Tests**:
> - Add `predict-cash-out.spec.ts` covering cash-out flow (balances
update, activity entry, position removal) and related page objects.
> - Update `predict-api-down.spec.ts` to use new Polymarket mocks path.
> - **Mocks (Polymarket)**:
> - Introduce detailed mocks: event details (dynamic by `eventId`),
current/resolved positions (with optional winnings), order book per
`token_id`, activity, UpNL, and complete setup helpers.
> - Add post-action helpers: `POLYMARKET_POST_CASH_OUT_MOCKS`,
`POLYMARKET_FORCE_BALANCE_REFRESH_MOCKS`,
`POLYMARKET_REMOVE_CASHED_OUT_POSITION_MOCKS`, and post-claim mocks.
> - New constants for USDC balances (initial/post-claim/post-cash-out)
and addresses; track dynamic USDC balance in RPC mocks.
> - Remove legacy `polymarket-mocks.ts` and split into organized files.
> - **General Mocks**:
> - Expand price API defaults and add `polygon-rpc.com` default RPC
mock.
> - **Selectors & Pages**:
> - Add Predict Activity Details selectors and page; extend
ActivitiesView with predictions tab and helpers; refine predictions
selectors (stable position card IDs).
> - **App UI (testIDs)**:
> - Add `testID`s to `PredictActivityDetail` (back, title, amount,
container).
> - Add `testID` to market details cash-out Button.
> - Adjust position components’ `testID`s for stable selection.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
02b594f. 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]
> Replace hardcoded fingerprint with `yarn fingerprint:generate` in
`.github/workflows/build-android-e2e.yml` to compute the cache key
dynamically.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
47f5d9a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: metamaskbot <[email protected]>
<!-- 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 fixes a critical bug in the GitHub Actions workflow that was preventing native code changes from triggering E2E test rebuilds. **Problem:** The negation pattern `!scripts/build.sh` in the paths filter was breaking the entire filtering logic, causing the dorny/paths-filter action to incorrectly treat all files (including native Android and iOS code) as ignored. This meant that PRs with only native code changes would not trigger app rebuilds, potentially running E2E tests against stale builds. **Solution:** 1. Moved `scripts/build.sh` from the `ignore` section (with problematic negation) to the `shared` section 2. Added comprehensive documentation explaining the intended filter logic 3. Ensured native code changes (`android/**`, `ios/**`) properly trigger platform-specific rebuilds This fix ensures the CI workflow correctly identifies when rebuilds are needed while maintaining the intended optimization of avoiding unnecessary rebuilds for documentation-only changes. ## **Changelog** CHANGELOG entry: null ## **Related issues** ## **Manual testing steps** 1. Create a test PR with only Android native code changes (e.g., modify a file in `android/app/src/`) 2. Verify the `needs_e2e_build` job outputs `android_changed: true` and `builds: true` 3. Create a test PR with only iOS native code changes (e.g., modify a file in `ios/`) 4. Verify the `needs_e2e_build` job outputs `ios_changed: true` and `builds: true` 5. Create a test PR with only documentation changes (e.g., modify `README.md`) 6. Verify the `needs_e2e_build` job outputs `builds: false` (no unnecessary rebuilds) 7. Create a test PR that modifies `scripts/build.sh` 8. Verify it triggers rebuilds for both platforms (`android_changed: true`, `ios_changed: true`) ## **Screenshots/Recordings** ### **Before** Native code changes were incorrectly flagged as ignored: ### **After** Native code changes now properly trigger the appropriate platform builds. ## **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)). ## **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] > Refines path filters in `needs-e2e-build.yml` by moving `scripts/build.sh` to `shared`, clarifying ignore rules, and adding clear documentation to ensure correct Android/iOS rebuild triggers. > > - **CI Workflow (`.github/workflows/needs-e2e-build.yml`)**: > - **Path filtering**: > - Move `scripts/build.sh` from `ignore` to `shared` to trigger rebuilds on changes. > - Keep native paths `android/**` and `ios/**` as platform-specific triggers; group common/dependency files under `shared`. > - Maintain `ignore` for docs/workflow and utility scripts; refine patterns and comments for clarity. > - Preserve `catch_all` fallback and output listing configuration. > - **Documentation**: Add detailed comments explaining filter intent and key points. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ddc5d0b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
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.
Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist