core
core copied to clipboard
Feat/preferences controller smart tx opt in
Explanation
This PR introduces a new state property smartTransactionsOptInStatus to the PreferencesController. This property allows the user to opt in or opt out of smart transactions.
This is to match changes introduced by the patch in Mobile https://github.com/MetaMask/metamask-mobile/pull/9448
Changes:
- Added
smartTransactionsOptInStatusto thePreferencesControllerstate. - Added a new method
smartTransactionsOptInStatusto update thesmartTransactionsOptInStatusstate. - Updated the
PreferencesControllertests to include tests forsmartTransactionsOptInStatusand to check the default state ofsmartTransactionsOptInStatus.
Test Plan:
- Run the updated tests for
PreferencesControllerusing the commandyarn workspace @metamask/preferences-controller run test. - Ensure all tests pass successfully.
References
Related to https://github.com/MetaMask/metamask-mobile/pull/8337
Changelog
@metamask/preferences-controller
- <ADDED> Added preference to enable smart transactions
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