Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add useMultiRpcMigration to PreferencesController (#4732)
## Explanation **Current state:** The `PreferencesController` does not include support for two new features related to network validation and multi-RPC migration behavior. Specifically, there is no existing functionality to: 1. Control the display of the multi-RPC migration modal (`useMultiRpcMigration`). **Solution:** This PR adds two new properties to the `PreferencesController` state: - `useMultiRpcMigration`: Controls whether the multi-RPC migration modal is displayed. Along with these additions, corresponding setter methods ( `setUseMultiRpcMigration`) have been implemented. These methods allow for toggling the state of the new properties. **Additional details:** - Test cases have been added to ensure that the new properties are correctly updated in the state when their respective setter methods are invoked. - The default values for these properties have been set to `true` to maintain expected functionality for users. There were no additional package updates or dependency changes required in this PR. ## References - No specific issues or pull requests tied to this change. ## Changelog ### `@metamask/preferences-controller` - **ADDED**: Added `useMultiRpcMigration` property to the `PreferencesController` state, controlling the display of the multi-RPC migration modal. - **ADDED**: Implemented `setUseMultiRpcMigration` method to toggle the `useMultiRpcMigration` property. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes (N/A)
- Loading branch information