1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/app/scripts
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
..
account-import-strategies Upgrading the Import Account modal (#17763) 2023-03-06 09:48:28 -08:00
constants
controllers fix issue with fragment messageIds (#17949) 2023-03-07 09:46:41 -06:00
lib delay chain validation (#17413) 2023-03-08 16:33:27 +00:00
migrations Change migration 78 version to 79, 79 to 80 and 80 to 78 (so that the… (#17980) 2023-03-06 10:06:01 -03:30
platforms
app-init.js
background.js Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
contentscript.js Update the PhishingController to v2 and update phishing warning page (#17835) 2023-02-24 11:39:00 -03:30
detect-multiple-instances.js
detect-multiple-instances.test.js [MMI] Prevent multiple instances of MM at the same browser (#17856) 2023-03-02 10:17:45 -06:00
disable-console.js
first-time-state.js
init-globals.js
inpage.js
lockdown-more.js
lockdown-run.js
metamask-controller.actions.test.js Update the PhishingController to v2 and update phishing warning page (#17835) 2023-02-24 11:39:00 -03:30
metamask-controller.js Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30
metamask-controller.test.js Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-08 14:05:45 -03:30
sentry-install.js
ui.js Move desktop code to flask build type (#17960) 2023-03-06 19:35:00 +00:00
use-snow.js