Skip to content
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

fix: Add useMultiRpcMigration to PreferencesController #4732

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Sep 25, 2024

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

  • I've updated the test suite for new or updated code as appropriate
  • 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)

@salimtb salimtb force-pushed the salim/add-use-multi-rpc-preference branch from 9ec7355 to 8cce274 Compare September 25, 2024 14:08
@salimtb salimtb force-pushed the salim/add-use-multi-rpc-preference branch from 8cce274 to 9285d4e Compare October 9, 2024 13:32
@salimtb salimtb marked this pull request as ready for review October 9, 2024 13:33
@salimtb salimtb requested a review from a team as a code owner October 9, 2024 13:33
cryptodev-2s
cryptodev-2s previously approved these changes Oct 16, 2024
@salimtb salimtb changed the title fix: Add useSafeChainsListValidation and useMultiRpcMigration to PreferencesController fix: Add useMultiRpcMigration to PreferencesController Oct 23, 2024
@salimtb salimtb force-pushed the salim/add-use-multi-rpc-preference branch from 666e820 to 5edc644 Compare October 23, 2024 10:31
@salimtb salimtb merged commit e16afc3 into main Oct 23, 2024
119 checks passed
@salimtb salimtb deleted the salim/add-use-multi-rpc-preference branch October 23, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants