1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix account tracker optimization (#8936)

An optimization in `account-tracker.js` was being skipped consistently
due to a type error (a number was being compared to a string).

The optimization in this case was to update the balances for all
accounts with a single request, rather than one request per account.
This commit is contained in:
Mark Stacey 2020-07-07 19:16:38 -03:00 committed by GitHub
parent 15d713f0ee
commit 429af23ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,19 +191,19 @@ export default class AccountTracker {
const currentNetwork = this.network.getNetworkState()
switch (currentNetwork) {
case MAINNET_NETWORK_ID:
case MAINNET_NETWORK_ID.toString():
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS)
break
case RINKEBY_NETWORK_ID:
case RINKEBY_NETWORK_ID.toString():
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS_RINKEBY)
break
case ROPSTEN_NETWORK_ID:
case ROPSTEN_NETWORK_ID.toString():
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN)
break
case KOVAN_NETWORK_ID:
case KOVAN_NETWORK_ID.toString():
await this._updateAccountsViaBalanceChecker(addresses, SINGLE_CALL_BALANCES_ADDRESS_KOVAN)
break