-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Consolidate token list controller data #527
Consolidate token list controller data #527
Conversation
…rn same token type regardless of static or dynamic from token list controller.
…r tests. Add util test for converting logo to URL.
…eturn with ABSOLUTE file paths. Client side will need to be aware of that.
…nflict with TokenRateController.
…mprovement/consolidate-token-list-controller-data
…mprovement/consolidate-token-list-controller-data
a17df03
to
6ef6fbe
Compare
f62e3b7
to
f2fb9e8
Compare
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.
on small nit re: pinning dep, but otherwise LGTM
2227f55
to
b90f0e2
Compare
…ttps://github.com/MetaMask/controllers into improvement/consolidate-token-list-controller-data
…mprovement/consolidate-token-list-controller-data
…mprovement/consolidate-token-list-controller-data
…mprovement/consolidate-token-list-controller-data
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.
I noticed two minor issues, but this looks good once the extraneous stuff is removed!
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!
* Add utils function to convert contract metadata logo to iconUrl. Return same token type regardless of static or dynamic from token list controller. * Provide ContractMap type for legacy tokens. Update TokenListController tests. Add util test for converting logo to URL. * Provide root path for TokenListController. NOTE: Static tokens will return with ABSOLUTE file paths. Client side will need to be aware of that. * Export Token as TokenListToken from TokenListController to prevent conflict with TokenRateController. * Clean up TokenListController. Update static logo path. * Clean up TokenListController. Fix TokenListController tests. * Fix github actions linting * Fix more github actions linting * Fix even more github actions linting * Fix last github actions linting * Allow for more time for token list controller API calls before timeout * Fix linting error * Add back newline to EOF package.json * Update contract metadata version * Up token list timeout to 10s * Update split logic * Add getFileExt utility and test * Add back caret to contract-metadata * Update description for fetchFromCache function * Remove iconPath * Remove unused enum & comment Co-authored-by: Ricky Miller <ricky.miller@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* Add utils function to convert contract metadata logo to iconUrl. Return same token type regardless of static or dynamic from token list controller. * Provide ContractMap type for legacy tokens. Update TokenListController tests. Add util test for converting logo to URL. * Provide root path for TokenListController. NOTE: Static tokens will return with ABSOLUTE file paths. Client side will need to be aware of that. * Export Token as TokenListToken from TokenListController to prevent conflict with TokenRateController. * Clean up TokenListController. Update static logo path. * Clean up TokenListController. Fix TokenListController tests. * Fix github actions linting * Fix more github actions linting * Fix even more github actions linting * Fix last github actions linting * Allow for more time for token list controller API calls before timeout * Fix linting error * Add back newline to EOF package.json * Update contract metadata version * Up token list timeout to 10s * Update split logic * Add getFileExt utility and test * Add back caret to contract-metadata * Update description for fetchFromCache function * Remove iconPath * Remove unused enum & comment Co-authored-by: Ricky Miller <ricky.miller@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Issue
TokenListController
should consolidate all tokens regardless of static or dynamic into one data type:TokenListToken
TokenListController
returns a file name from static tokens and URLs from dynamic tokens.TokenListController
should split the images field into two separate propertiesiconPath
for static tokens andiconUrl
for dynamic tokens.Resolves/Changes
TokenListToken
type. The idea was already there but I mapped it more, addedaddress
,occurrences
, andaggregators
.TokenListToken
type fromTokenListController
for use in the appsTokenListController
tests