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

upgrade address book controller to base controller v2 #4392

Merged
merged 5 commits into from
Jun 11, 2024

Conversation

kanthesha
Copy link
Contributor

Explanation

In this, the AddressBookController has been upgraded to BaseControllerV2. The upgrade includes AddressBookController inheriting BaseController v2 instead of BaseController v1. This affects the constructor and the also the way state is updated inside the controller.

References

Fixes #4070

Changelog

@metamask/address-book-controller

Added

  • New types for AddressBookController messenger actions
    • AddressBookControllerGetStateAction
    • AddressBookControllerActions
  • New types for AddressBookController messenger events
    • AddressBookControllerStateChangeEvent
    • AddressBookControllerEvents
  • New AddressBookControllerMessenger type
  • New getDefaultAddressBookControllerState function to get the default state of the controller

Changed

  • BREAKING: Changed superclass of AddressBookController from BaseController v1 to BaseController v2
  • BREAKING: Renamed AddressBookState to AddressBookControllerState
  • BREAKING: Changed constructor arguments. Removed config and added messenger for communication.

Removed

  • BREAKING: Removed AddressBookConfig type

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

@kanthesha kanthesha marked this pull request as ready for review June 7, 2024 14:05
@kanthesha kanthesha requested a review from a team as a code owner June 7, 2024 14:05
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.

Had some suggestions but this otherwise looks great!

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.

LGTM!

@kanthesha kanthesha merged commit 42a5a25 into main Jun 11, 2024
113 checks passed
@kanthesha kanthesha deleted the upgrade-address-book-controller-to-base-controller-v2 branch June 11, 2024 08:13
@MajorLift
Copy link
Contributor

@metamaskbot publish-preview

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.

Convert AddressBookController from BaseControllerV1 to BaseControllerV2
3 participants