Commit 1919f0f
authored
feat(perps): align PerpsController with core PR MetaMask#8633 (isInternal flag) (MetaMask#30413)
## **Description**
Mirrors the change from
[MetaMask/core#8633](MetaMask/core#8633) into
mobile ahead of the full migration to core, so the mobile copy of
`PerpsController` stays in sync with the upstream controller. The single
substantive change forwards `isInternal: true` in the `options` payload
when `PerpsController` submits a transaction via the
`TransactionController` messenger, matching the new core behavior that
flags controller-originated transactions as internal.
This keeps both codebases behaviorally identical until mobile retires
its local `PerpsController` in favor of the core package.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: Perps internal transaction flag parity
Scenario: user submits a perps transaction routed through PerpsController
Given the Perps feature is enabled and the wallet is unlocked
When user initiates a perps action that triggers PerpsController to submit a transaction
Then the resulting TransactionController entry is marked as an internal transaction (isInternal: true)
And the transaction completes with the same UX as before this change
```
## **Screenshots/Recordings**
### **Before**
N/A — behavioral parity change, no user-visible UI difference.
### **After**
N/A — behavioral parity change, no user-visible UI difference.
## **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.
#### Performance checks (if applicable)
- [x] I've tested on Android
- [x] I've tested with a power user scenario
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
## **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 options passed to `TransactionController:addTransaction`
for perps flows, which could affect how transactions are
classified/handled downstream (e.g., UI filtering or telemetry). Scope
is small and covered by updated unit tests.
>
> **Overview**
> Perps transactions submitted via `PerpsController` now always forward
`isInternal: true` when calling `TransactionController:addTransaction`,
aligning mobile behavior with the upstream core controller.
>
> Tests for `depositWithConfirmation` (including the `perpsDeposit` and
`perpsDepositAndOrder` paths) are updated to assert the new `isInternal`
flag in the messenger call options.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
93a877e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 3bc2d99 commit 1919f0f
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2715 | 2715 | | |
2716 | 2716 | | |
2717 | 2717 | | |
| 2718 | + | |
2718 | 2719 | | |
2719 | 2720 | | |
2720 | 2721 | | |
| |||
3106 | 3107 | | |
3107 | 3108 | | |
3108 | 3109 | | |
| 3110 | + | |
3109 | 3111 | | |
3110 | 3112 | | |
3111 | 3113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
1368 | | - | |
| 1368 | + | |
1369 | 1369 | | |
1370 | 1370 | | |
1371 | 1371 | | |
| |||
0 commit comments