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 missing resetState methods to 4 assets-controllers #4880

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Oct 31, 2024

Explanation

Add the missingresetState method to NftController, TokensController, TokenBalancesController, and TokenRatesController. These methods are needed on mobile and are currently patched here: MetaMask Mobile Patch.

References

Changelog

@metamask/assets-controllers

  • Added: Add resetState method to NftController, TokensController, TokenBalancesController and TokenRatesController to reset the controller's state back to their initial state

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

@cryptodev-2s cryptodev-2s requested a review from a team as a code owner October 31, 2024 10:36
@cryptodev-2s cryptodev-2s changed the title fix: add missing resetState methods fix: add missingresetState methods to some assets-controllers Oct 31, 2024
@cryptodev-2s cryptodev-2s changed the title fix: add missingresetState methods to some assets-controllers fix: add missing resetState methods to some assets-controllers Oct 31, 2024
@cryptodev-2s cryptodev-2s changed the title fix: add missing resetState methods to some assets-controllers fix: add missing resetState methods to 4 assets-controllers Oct 31, 2024
sahar-fehri
sahar-fehri previously approved these changes Oct 31, 2024
@cryptodev-2s cryptodev-2s requested a review from a team October 31, 2024 16:40
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to reset the controller state to default state rather than initial state?

packages/assets-controllers/src/NftController.ts Outdated Show resolved Hide resolved
packages/assets-controllers/src/TokenBalancesController.ts Outdated Show resolved Hide resolved
packages/assets-controllers/src/TokenRatesController.ts Outdated Show resolved Hide resolved
packages/assets-controllers/src/TokensController.ts Outdated Show resolved Hide resolved
packages/assets-controllers/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@cryptodev-2s cryptodev-2s merged commit 674fa0b into main Oct 31, 2024
119 checks passed
@cryptodev-2s cryptodev-2s deleted the cryptodev2s/add-missing-reset-state-functions-assets-controllers branch October 31, 2024 20:14
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.

[assets-controllers] add missing resetState method to 4 controllers
3 participants