Skip to content

Convert TokenRatesController from BaseControllerV1 to BaseControllerV2 #4076

Closed

Description

@desi

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

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.

Activity

  1. changed the title [-](`assets-controllers`) TokenRatesController[/-] [+]Convert TokenRatesController from BaseControllerV1 to BaseControllerV2[/+] on Mar 18, 2024
  2. mikesposito commented on Apr 17, 2024

    @mikesposito
    Member
    • The TokenRatesController class can extend the StaticIntervalPollingController “mixin” type, which extends BaseControllerV2.
    • StaticIntervalPollingController will accept type parameters needed for BaseControllerV2 (name, state and messenger types)
      • We can rename TokenRatesConfig to TokenRatesControllerConfig
      • We can rename TokenRatesState to TokenRatesControllerState
      • We should add types for actions and events needed by the TokenRatesController messengers
        • It would be useful for external clients to have access to a start and a stop action to toggle the polling
    • Since we can now use the messenger, we can remove these constructor options in favour of messenger events or actions:
      • getNetworkClientById
      • onPreferencesStateChange
      • onTokensStateChange
      • onNetworkStateChange
    • Tests should be refactored to support the new controller version
      • In addition to that, we can create a withController helper to make tests more readable and easier to be maintained
  3. self-assigned this
    on Apr 29, 2024
  4. added a commit that references this issue on Jun 8, 2024
    4d77dde
  5. moved this from Needs dev review to Merged, Closed or Archived in PR review queueon Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

team-wallet-frameworkDeprecated: Please use `team-core-platform` instead.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions