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

feat: migrate TokensController to BaseControllerV2 #4304

Merged

Conversation

cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented May 22, 2024

Explanation

The TokensController has been migrated to BaseControllerV2. As part of this migration, the deprecated config property has been removed and has been replaced with flatten properties on the controller constructor (chainId, selectedAddress and provider).

PS: A migration is needed when using a new release of this controller.

References

Changelog

@metamask/assets-controllers

Changed

  • BREAKING: Convert TokensController to BaseControllerV2
    • The constructor parameters have changed; rather than accepting a "config" parameter, it takesselectedAddress and provider parameters.
  • BREAKING: Convert Token object in TokenBalancesController to a type instead of interface and replace the balanceError property with hasBalanceError flag.

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

Copy link
Contributor

@kanthesha kanthesha left a comment

Choose a reason for hiding this comment

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

Overall LGTM. I have added some small suggestions.

@cryptodev-2s cryptodev-2s requested review from kanthesha, tommasini and a team May 24, 2024 13:41
kanthesha
kanthesha previously approved these changes May 29, 2024
Copy link
Contributor

@kanthesha kanthesha left a comment

Choose a reason for hiding this comment

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

LGTM.

@cryptodev-2s cryptodev-2s merged commit 8fbe6f8 into main May 29, 2024
147 checks passed
@cryptodev-2s cryptodev-2s deleted the feature/migrate-tokens-controller-to-base-controller-v2 branch May 29, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
4 participants