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

Convert AccountTrackerController from BaseControllerV1 to BaseControllerV2 #4071

Closed
desi opened this issue Mar 18, 2024 · 1 comment · Fixed by #4407
Closed

Convert AccountTrackerController from BaseControllerV1 to BaseControllerV2 #4071

desi opened this issue Mar 18, 2024 · 1 comment · Fixed by #4407
Assignees

Comments

@desi
Copy link
Contributor

desi commented Mar 18, 2024

Considering that converting TokenDetectionController to BaseController v2 took longer than expected due to unforeseen changes, we want to be more conscientious about converting AccountTrackerController.

Figure out all of the changes we would want to make in upgrading this controller, outline those changes here and create new tickets if appropriate.

@desi desi changed the title (assets-controllers) AccountTrackerController Convert AccountTrackerController from BaseControllerV1 to BaseControllerV2 Mar 18, 2024
@desi
Copy link
Contributor Author

desi commented May 23, 2024

Convert to BaseControllerV2 and the improvements that come with it directly like using the messanger.

@cryptodev-2s cryptodev-2s self-assigned this Jun 5, 2024
cryptodev-2s added a commit that referenced this issue Jun 13, 2024
## Explanation

In this PR, the `AccountTrackerController` has been updated to
`BaseControllerV2`. The upgrade involves the `AccountTrackerController`
now inheriting from `StaticIntervalPollingController` instead of
`StaticIntervalPollingControllerV1`. This change affects the constructor
by removing deprecated `config` properties, keeping only the `interval`
option as a constructor parameter. Additionally, the `provider` property
has been removed, as it is now directly retrieved by actions from
NetworkState.

## References

Fixes #4071  

## Changelog

`@metamask/assets-controller`
### Added

- New types for `AccountTrackerController` messenger actions 
  - `AccountTrackerControllerGetStateAction`
- New types for `AccountTrackerController` messenger events
  - `AccountTrackerControllerStateChangeEvent`

### Changed

- **BREAKING:** Changed superclass of `AccountTrackerController` from
StaticIntervalPollingControllerV1 to StaticIntervalPollingController
- **BREAKING:** Renamed `AccountTrackerState` to
`AccountTrackerControllerState`

### Removed

- **BREAKING:** Removed `AccountTrackerConfig` type

## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants