diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-27 07:22:08 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-27 07:22:08 +0800 |
commit | 1e9c0a9db2d58e61361bff7430d3a74006ef131c (patch) | |
tree | 1d1f09bfe2e1985c42d5a117e8e63d19c71a360b /app/scripts/controllers/balance.js | |
parent | a387def701303e56f721fdc7c716e72641bfaf8f (diff) | |
parent | 19afb638194a11367250153a710d77011665132a (diff) | |
download | tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.tar tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.tar.gz tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.tar.bz2 tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.tar.lz tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.tar.xz tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.tar.zst tangerine-wallet-browser-1e9c0a9db2d58e61361bff7430d3a74006ef131c.zip |
Resolve merge conflicts
Diffstat (limited to 'app/scripts/controllers/balance.js')
-rw-r--r-- | app/scripts/controllers/balance.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js index 4fa4c78fe..f83f294cc 100644 --- a/app/scripts/controllers/balance.js +++ b/app/scripts/controllers/balance.js @@ -5,7 +5,9 @@ const BN = require('ethereumjs-util').BN class BalanceController { constructor (opts = {}) { + this._validateParams(opts) const { address, accountTracker, txController, blockTracker } = opts + this.address = address this.accountTracker = accountTracker this.txController = txController @@ -65,6 +67,14 @@ class BalanceController { return pending } + _validateParams (opts) { + const { address, accountTracker, txController, blockTracker } = opts + if (!address || !accountTracker || !txController || !blockTracker) { + const error = 'Cannot construct a balance checker without address, accountTracker, txController, and blockTracker.' + throw new Error(error) + } + } + } module.exports = BalanceController |