core icon indicating copy to clipboard operation
core copied to clipboard

Feat/preferences controller smart tx opt in

Open infiniteflower opened this issue 2 years ago • 0 comments

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:

  1. Added smartTransactionsOptInStatus to the PreferencesController state.
  2. Added a new method smartTransactionsOptInStatus to update the smartTransactionsOptInStatus state.
  3. Updated the PreferencesController tests to include tests for smartTransactionsOptInStatus and to check the default state of smartTransactionsOptInStatus.

Test Plan:

  1. Run the updated tests for PreferencesController using the command yarn workspace @metamask/preferences-controller run test.
  2. 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

infiniteflower avatar Jan 22 '24 21:01 infiniteflower