From 4c9f306799cd1a6eb0c6717fa17958221285106e Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 7 Jul 2020 17:29:32 -0300 Subject: [PATCH] Fix account tracker optimization 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. --- app/scripts/lib/account-tracker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index d1ab1e583544..dd8a2a4799b1 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -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