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 7bc2370be5 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-09 09:59:14 +00:00
..
__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-09 09:59:14 +00:00
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 avoid mutation of state in signTransaction action (#17772) 2023-03-02 10:54:55 +00:00
helpers UX: Icons: Stop using fa-address-book (#17761) 2023-03-02 12:40:20 +00:00
hooks Cleanup: clearTimeout on useEffect for gas estimation and prevent state update on unmounted ConfirmTransactionBase (#17804) 2023-03-02 11:38:42 +00:00
pages Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-09 09:59:14 +00:00
selectors fix(17857): show correctly converted account balance in sign&encrypt windows (#17973) 2023-03-06 11:24:14 +00:00
store Disable eth_sign by default, allow users to toggle it back on (#17308) 2023-02-06 13:17:50 -03:30
index.js initialize currentLocale in the locale slice upon app start (#17579) 2023-02-02 15:24:48 -06:00
index.test.js Remove related UI code from the app dir (#15384) 2022-09-16 14:05:21 -05:00