Skip to content

Commit

Permalink
Fix account tracker optimization
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gudahtt committed Jul 7, 2020
1 parent 472ee89 commit 4c9f306
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/scripts/lib/account-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4c9f306

Please sign in to comment.