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 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
..
account-import-strategies Use async/await instead of Promise.resolve (#16221) 2023-01-20 14:20:18 -06:00
constants Convert app/scripts/constants -> Typescript (#17327) 2023-01-20 13:33:01 -07:00
controllers Expand network controller unit test coverage (#17498) 2023-02-08 13:10:04 -07:00
lib remove siwe feature flag (#17690) 2023-02-10 02:05:16 +07:00
migrations Update the PhishingController to v2 tests 2023-03-06 18:53:30 +00:00
platforms Convert Transaction constants to typescript (#17149) 2023-01-18 08:47:29 -06:00
app-init.js Keep memstore contents after service worker restarts (#15913) 2022-11-22 20:56:26 +04:00
background.js Restore support for Chromium v78 (#17251) 2023-01-23 12:36:48 -03:30
contentscript.js Update the PhishingController to v2 and update phishing warning page (#17835) 2023-03-06 18:34:18 +00:00
detect-multiple-instances.js Warn about multiple MetaMask instances running (#13836) 2022-04-27 20:14:10 +02:00
detect-multiple-instances.test.js Warn about multiple MetaMask instances running (#13836) 2022-04-27 20:14:10 +02:00
disable-console.js Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
first-time-state.js remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
init-globals.js MV3: fix injection of applyLavamoat variable in service worker (#14920) 2022-06-18 12:40:30 +05:30
inpage.js MV3: contentscript.js - re-activate streams when Service Worker terminates and then resets (#15494) 2022-09-13 14:20:08 -07:00
lockdown-more.js Activate LavaMoat scuttling security feature (#17276) 2023-01-24 19:00:35 +02:00
lockdown-run.js lockdown - breakout making globalThis properties non-writable (#12258) 2021-10-01 08:53:12 -10:00
metamask-controller.actions.test.js Update the PhishingController to v2 and update phishing warning page (#17835) 2023-03-06 18:34:18 +00:00
metamask-controller.js Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-09 09:59:14 +00:00
metamask-controller.test.js Use tokenList to get token details, when available, in getTokenStanda… (#17891) 2023-03-09 09:59:14 +00:00
sentry-install.js refactor sentryHooks object (#16435) 2022-11-09 19:28:32 +00:00
ui.js scripts/ui: add tabs.query promise error handler (#16915) 2022-12-14 01:21:32 +07:00
use-snow.js patch lavamoat files to make v10.26.0 compatible with v78 of chrome (#18053) 2023-03-08 14:08:24 -03:30