Skip to content

Commit 3e950b4

Browse files
authored
chore: Default Perps local and production builds to mainnet (#21650)
## **Description** Quality of life change to default local environments to run Perps on mainnet. Devs can still go into Developer options and toggle to testnet if they wish. ## **Changelog** CHANGELOG entry: default perps controller to mainnet ## **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] > Sets `isTestnet` default to `false` (mainnet) in `PerpsController` and updates tests to reflect the new default. > > - **PerpsController** (`app/components/UI/Perps/controllers/PerpsController.ts`): > - Change default `isTestnet` to `false` in `getDefaultPerpsControllerState`. > - **Tests** (`app/components/UI/Perps/controllers/PerpsController.test.ts`): > - Update constructor test to assert `isTestnet` defaults to `false`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d419c14. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 4d9c9af commit 3e950b4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/components/UI/Perps/controllers/PerpsController.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ describe('PerpsController', () => {
158158
expect(controller.state.accountState).toBeNull();
159159
expect(controller.state.connectionStatus).toBe('disconnected');
160160
expect(controller.state.isEligible).toBe(false);
161+
expect(controller.state.isTestnet).toBe(false); // Default to mainnet
161162
});
162163

163164
it('should read current RemoteFeatureFlagController state during construction', () => {

app/components/UI/Perps/controllers/PerpsController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export type PerpsControllerState = {
254254
*/
255255
export const getDefaultPerpsControllerState = (): PerpsControllerState => ({
256256
activeProvider: 'hyperliquid',
257-
isTestnet: __DEV__, // Default to testnet in dev
257+
isTestnet: false, // Default to mainnet
258258
connectionStatus: 'disconnected',
259259
accountState: null,
260260
positions: [],

0 commit comments

Comments
 (0)