1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui
Dan J Miller efaaf4fab2
Use tokenList to get token details, when available, in getTokenStanda… (#17891)
* Use tokenList to get token details, when available, in getTokenStandardAndDetails

Previously, every call to getTokenStandardAndDetails would fetch data via the provider.
This would result in at least 3 network requests whenever that method is called for an
ERC20 token, contributing to unneccesary loading and lagging in multiple places.
This commit takes advantage of stored data we already have available to avoid the unnecessary
loading.

* Lint fix

* Fix build-quote test

* bump coverage targets

* Pass provider to token-util, for use in ethers Contract module

* Check all possible sources of ERC20 token data before async call to assetsContractController

* Add and update tests

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* Remove unnecessary this.ethQuery changes

* Use metamask-eth-abis instead of human-standard-token-abi in token-util.ts

* Add explanatory comments to getTokenStandardAndDetails

* lint fix

* Cleanup

* fix test

* Update app/scripts/metamask-controller.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* update error message

---------

Co-authored-by: Alex Donesky <adonesky@gmail.com>
2023-03-08 14:05:45 -03:30
..
__mocks__ Refactoring isManifestV3 variable (#15568) 2022-08-16 20:51:42 +05:30
components Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30
contexts i18n: fix missing locale for "en" error (#17014) 2022-12-22 00:31:06 +07:00
css Added padding/margin inline support to the Box component (#17134) 2023-01-14 10:54:25 +05:30
ducks Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
helpers Avoid blob url for files downloads (#17986) 2023-03-07 12:47:45 +02:00
hooks Buy crypto by redirecting to onramp experience on pdapp instead of deposit popover (#17689) 2023-03-01 12:45:27 +04:00
pages Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30
selectors Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
store Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
index.js Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
index.test.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00