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

refactor: update account tracker to use selected account #4225

Merged

Conversation

montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Apr 29, 2024

Explanation

This PR updates the AccountTrackerController to use selectedAccount and InternalAccounts. The callbacks of the preferences controller are removed and replaced by actions to the controller messenger. The subscription of onPreferencesStateChange has been replaced with a subscription to the controller messenger.

References

Fixes https://github.com/MetaMask/accounts-planning/issues/381

Changelog

@metamask/assets-controllers

  • CHANGED: Removed getIdentities, getSelectedAddress and onPreferencesStateChange from the constructor arguments of the AccountTrackerController
  • BREAKING: Require a controller messenger in the constructor of the AccountTrackerController

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

@montelaidev montelaidev force-pushed the fix/ap381/update-account-tracker-to-use-selectedAccountId branch from a9ec2a0 to 043c08f Compare June 3, 2024 14:48
@montelaidev montelaidev force-pushed the fix/ap381/update-account-tracker-to-use-selectedAccountId branch from 043c08f to 0407197 Compare June 5, 2024 04:08
@montelaidev montelaidev changed the title Fix/ap381/update account tracker to use selected account refactor: update account tracker to use selected account Jun 5, 2024
@montelaidev montelaidev requested a review from a team June 6, 2024 08:56
@montelaidev montelaidev marked this pull request as ready for review June 6, 2024 08:57
@montelaidev montelaidev requested a review from a team as a code owner June 6, 2024 08:57
@ccharly ccharly merged commit f986626 into main Jun 7, 2024
113 checks passed
@ccharly ccharly deleted the fix/ap381/update-account-tracker-to-use-selectedAccountId branch June 7, 2024 11:38
legobeat pushed a commit that referenced this pull request Jun 11, 2024
## Explanation

This PR updates the `AccountTrackerController` to use `selectedAccount`
and InternalAccounts. The callbacks of the preferences controller are
removed and replaced by actions to the controller messenger. The
subscription of `onPreferencesStateChange` has been replaced with a
subscription to the controller messenger.

## References

Fixes https://github.com/MetaMask/accounts-planning/issues/381

## Changelog

### `@metamask/assets-controllers`

- **CHANGED**: Removed `getIdentities`, `getSelectedAddress` and
`onPreferencesStateChange` from the constructor arguments of the
`AccountTrackerController`
- **BREAKING**: Require a controller messenger in the constructor of the
`AccountTrackerController`

## 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
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
legobeat pushed a commit that referenced this pull request Jun 11, 2024
## Explanation

This PR updates the `AccountTrackerController` to use `selectedAccount`
and InternalAccounts. The callbacks of the preferences controller are
removed and replaced by actions to the controller messenger. The
subscription of `onPreferencesStateChange` has been replaced with a
subscription to the controller messenger.

## References

Fixes https://github.com/MetaMask/accounts-planning/issues/381

## Changelog

### `@metamask/assets-controllers`

- **CHANGED**: Removed `getIdentities`, `getSelectedAddress` and
`onPreferencesStateChange` from the constructor arguments of the
`AccountTrackerController`
- **BREAKING**: Require a controller messenger in the constructor of the
`AccountTrackerController`

## 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
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate

---------

Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants