-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Keep
PreferencesController
in sync with keyring state
The `PreferencesController` now listens for `KeyringController` state changes, and updates its own state in response to account removals or additions. New accounts are added to the `identities` state and given default labels. Removed accounts are removed from the `identities` state, and the `selectedAddress` is updated if it was removed. The dependency between these two packages has been flipped; the `@metamask/preferences-controller` package now depends upon `@metamask/keyring-controller` rather than the other away around, so that the `KeyringController` state type and state change event can be accessed. The dependency the other way was just to get the types for the four `PreferencesController` methods that are passed into the `KeyringController` constructor. These types were easily inlined, and these methods will soon be removed anyway. A `getDefaultKeyringState` export was added to the `@metamask/keyring-controller` package to make it easier to write the necessary `PreferencesController` tests. Closes #3794
- Loading branch information
Showing
10 changed files
with
315 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.