diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-09-23 05:13:56 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-09-23 05:13:56 +0800 |
commit | f01b0a818ba67c2549f14382056534768a255e5b (patch) | |
tree | 4e9baaee28b9aefbf7f44c5229cfe5309e75e6f9 | |
parent | f9d2f523c628228a77c28e7d46d08151453a47bc (diff) | |
download | tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.tar tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.tar.gz tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.tar.bz2 tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.tar.lz tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.tar.xz tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.tar.zst tangerine-wallet-browser-f01b0a818ba67c2549f14382056534768a255e5b.zip |
Fix account-tracker references
-rw-r--r-- | app/scripts/controllers/balance.js | 6 | ||||
-rw-r--r-- | app/scripts/controllers/computed-balances.js | 10 | ||||
-rw-r--r-- | app/scripts/keyring-controller.js | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js index b4e72e751..ddeb06cf9 100644 --- a/app/scripts/controllers/balance.js +++ b/app/scripts/controllers/balance.js @@ -5,9 +5,9 @@ const BN = require('ethereumjs-util').BN class BalanceController { constructor (opts = {}) { - const { address, ethStore, txController } = opts + const { address, accountTracker, txController } = opts this.address = address - this.ethStore = ethStore + this.accountTracker = accountTracker this.txController = txController const initState = { @@ -39,7 +39,7 @@ class BalanceController { } _getBalance () { - const store = this.ethStore.getState() + const store = this.accountTracker.getState() const balances = store.accounts const entry = balances[this.address] const balance = entry.balance diff --git a/app/scripts/controllers/computed-balances.js b/app/scripts/controllers/computed-balances.js index a85eb5590..576746164 100644 --- a/app/scripts/controllers/computed-balances.js +++ b/app/scripts/controllers/computed-balances.js @@ -5,8 +5,8 @@ const BalanceController = require('./balance') class ComputedbalancesController { constructor (opts = {}) { - const { ethStore, txController } = opts - this.ethStore = ethStore + const { accountTracker, txController } = opts + this.accountTracker = accountTracker this.txController = txController const initState = extend({ @@ -25,9 +25,9 @@ class ComputedbalancesController { } _initBalanceUpdating () { - const store = this.ethStore.getState() + const store = this.accountTracker.getState() this.addAnyAccountsFromStore(store) - this.ethStore.subscribe(this.addAnyAccountsFromStore.bind(this)) + this.accountTracker.subscribe(this.addAnyAccountsFromStore.bind(this)) } addAnyAccountsFromStore(store) { @@ -48,7 +48,7 @@ class ComputedbalancesController { trackAddress (address) { let updater = new BalanceController({ address, - ethStore: this.ethStore, + accountTracker: this.accountTracker, txController: this.txController, }) updater.store.subscribe((accountBalance) => { diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index fd57fac70..fa470dd89 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -35,7 +35,7 @@ class KeyringController extends EventEmitter { keyrings: [], identities: {}, }) - this.ethStore = opts.ethStore + this.accountTracker = opts.accountTracker this.encryptor = encryptor this.keyrings = [] this.getNetwork = opts.getNetwork @@ -338,7 +338,7 @@ class KeyringController extends EventEmitter { // // Initializes the provided account array // Gives them numerically incremented nicknames, - // and adds them to the ethStore for regular balance checking. + // and adds them to the accountTracker for regular balance checking. setupAccounts (accounts) { return this.getAccounts() .then((loadedAccounts) => { @@ -361,7 +361,7 @@ class KeyringController extends EventEmitter { throw new Error('Problem loading account.') } const address = normalizeAddress(account) - this.ethStore.addAccount(address) + this.accountTracker.addAccount(address) return this.createNickname(address) } @@ -567,12 +567,12 @@ class KeyringController extends EventEmitter { clearKeyrings () { let accounts try { - accounts = Object.keys(this.ethStore.getState()) + accounts = Object.keys(this.accountTracker.getState()) } catch (e) { accounts = [] } accounts.forEach((address) => { - this.ethStore.removeAccount(address) + this.accountTracker.removeAccount(address) }) // clear keyrings from memory |