diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-09-26 05:39:22 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-09-26 05:39:54 +0800 |
commit | 674aac83ce49d21606be7be7afdf1b6a8ceb386f (patch) | |
tree | ab09091de9e27ea1505c35869e8699618b8f8a95 | |
parent | d9c92cdbd170e40622f081c2d45edaf970280954 (diff) | |
download | tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.tar tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.tar.gz tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.tar.bz2 tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.tar.lz tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.tar.xz tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.tar.zst tangerine-wallet-browser-674aac83ce49d21606be7be7afdf1b6a8ceb386f.zip |
Make blockTracker an independent param
-rw-r--r-- | app/scripts/controllers/balance.js | 5 | ||||
-rw-r--r-- | app/scripts/controllers/computed-balances.js | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js index 9b2566852..ab0cfe907 100644 --- a/app/scripts/controllers/balance.js +++ b/app/scripts/controllers/balance.js @@ -5,10 +5,11 @@ const BN = require('ethereumjs-util').BN class BalanceController { constructor (opts = {}) { - const { address, accountTracker, txController } = opts + const { address, accountTracker, txController, blockTracker } = opts this.address = address this.accountTracker = accountTracker this.txController = txController + this.blockTracker = blockTracker const initState = { ethBalance: undefined, @@ -36,7 +37,7 @@ class BalanceController { this.txController.on('confirmed', update) this.txController.on('failed', update) this.accountTracker.subscribe(update) - this.txController.blockTracker.on('block', update) + this.blockTracker.on('block', update) } async _getBalance () { diff --git a/app/scripts/controllers/computed-balances.js b/app/scripts/controllers/computed-balances.js index 576746164..2b27d128d 100644 --- a/app/scripts/controllers/computed-balances.js +++ b/app/scripts/controllers/computed-balances.js @@ -5,9 +5,10 @@ const BalanceController = require('./balance') class ComputedbalancesController { constructor (opts = {}) { - const { accountTracker, txController } = opts + const { accountTracker, txController, blockTracker } = opts this.accountTracker = accountTracker this.txController = txController + this.blockTracker = blockTracker const initState = extend({ computedBalances: {}, @@ -50,6 +51,7 @@ class ComputedbalancesController { address, accountTracker: this.accountTracker, txController: this.txController, + blockTracker: this.blockTracker, }) updater.store.subscribe((accountBalance) => { let newState = this.store.getState() |