-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Parameterize TokenListController
by NetworkClientId
+ Integrate PollingController
#1763
Merged
Conversation
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
adonesky1
force-pushed
the
tokenlistcontroller-multichain
branch
2 times, most recently
from
October 3, 2023 19:18
c9b92b0
to
07bc063
Compare
adonesky1
force-pushed
the
tokenlistcontroller-multichain
branch
from
October 6, 2023 16:42
1b8bf7f
to
57b2884
Compare
adonesky1
changed the title
WIP Multichainify TokenListController
Parameterize Oct 6, 2023
TokenListController
by NetworkClientId
+ Integrate PollingController
adonesky1
force-pushed
the
tokenlistcontroller-multichain
branch
from
October 6, 2023 17:06
c29085d
to
e10b445
Compare
jiexi
reviewed
Oct 6, 2023
jiexi
previously approved these changes
Oct 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
adonesky1
force-pushed
the
tokenlistcontroller-multichain
branch
from
October 6, 2023 22:24
73ff166
to
3ff7eee
Compare
jiexi
approved these changes
Oct 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM again. If you could add a changelog to the PR description, I'm sure the person who cuts the next core release would greatly appreciate that.
shanejonas
approved these changes
Oct 10, 2023
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
…PollingController` (#1763) Resolves: MetaMask/MetaMask-planning#1032 Integrates new `PollingController` abstraction into the `TokenListController`, implements the `executePoll` method and parameterizes the `fetchTokenList` method by `networkClientId` such that tokenLists can be fetched and cached for different networks via concurrent polling sessions. **A note:** As is our current controller refactor strategy, these changes are additive, backwards compatible and coexist alongside the existing globally selected network pattern. Once we fully adopt this polling pattern we should no longer access the root `tokenList` state but rather access from the cache with a chainId selector.
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
…PollingController` (#1763) Resolves: MetaMask/MetaMask-planning#1032 Integrates new `PollingController` abstraction into the `TokenListController`, implements the `executePoll` method and parameterizes the `fetchTokenList` method by `networkClientId` such that tokenLists can be fetched and cached for different networks via concurrent polling sessions. **A note:** As is our current controller refactor strategy, these changes are additive, backwards compatible and coexist alongside the existing globally selected network pattern. Once we fully adopt this polling pattern we should no longer access the root `tokenList` state but rather access from the cache with a chainId selector.
MajorLift
pushed a commit
that referenced
this pull request
Oct 12, 2023
…PollingController` (#1763) Resolves: MetaMask/MetaMask-planning#1032 Integrates new `PollingController` abstraction into the `TokenListController`, implements the `executePoll` method and parameterizes the `fetchTokenList` method by `networkClientId` such that tokenLists can be fetched and cached for different networks via concurrent polling sessions. **A note:** As is our current controller refactor strategy, these changes are additive, backwards compatible and coexist alongside the existing globally selected network pattern. Once we fully adopt this polling pattern we should no longer access the root `tokenList` state but rather access from the cache with a chainId selector.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: https://github.com/MetaMask/MetaMask-planning/issues/1032
Integrates new
PollingController
abstraction into theTokenListController
, implements theexecutePoll
method and parameterizes thefetchTokenList
method bynetworkClientId
such that tokenLists can be fetched and cached for different networks via concurrent polling sessions.A note: As is our current controller refactor strategy, these changes are additive, backwards compatible and coexist alongside the existing globally selected network pattern. Once we fully adopt this polling pattern we should no longer access the root
tokenList
state but rather access from the cache with a chainId selector.Added
PollingController
mixin into theTokenListController
and implements the abstractexecutePoll
method.Changed
networkClientId
argument tofetchTokenList
method onTokenListController
which, if passed, is used fetch the chainId that corresponds to thenetworkClientId
and is then used to fetch and cache the appropriatetokenList
.