diff options
author | kumavis <aaron@kumavis.me> | 2017-10-11 08:26:44 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2017-10-11 08:26:44 +0800 |
commit | 0f8d7dacb1bada269f38b3f0f73df9e8347bc492 (patch) | |
tree | 18df8aa42bd4f3a5e599956874e52c97ae14ba42 /app | |
parent | 7d50a56198f2992e908bc97b871210ec2b52123a (diff) | |
download | tangerine-wallet-browser-0f8d7dacb1bada269f38b3f0f73df9e8347bc492.tar.gz tangerine-wallet-browser-0f8d7dacb1bada269f38b3f0f73df9e8347bc492.tar.zst tangerine-wallet-browser-0f8d7dacb1bada269f38b3f0f73df9e8347bc492.zip |
network-controller - use obj-proxy for providerProxy
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/controllers/network.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js index f4665baf8..64ed4b7c2 100644 --- a/app/scripts/controllers/network.js +++ b/app/scripts/controllers/network.js @@ -6,6 +6,7 @@ const extend = require('xtend') const EthQuery = require('eth-query') const createEthRpcClient = require('eth-rpc-client') const createEventEmitterProxy = require('../lib/events-proxy.js') +const createObjectProxy = require('../lib/obj-proxy.js') const RPC_ADDRESS_LIST = require('../config.js').network const DEFAULT_RPC = RPC_ADDRESS_LIST['rinkeby'] @@ -17,7 +18,7 @@ module.exports = class NetworkController extends EventEmitter { this.networkStore = new ObservableStore('loading') this.providerStore = new ObservableStore(config.provider) this.store = new ComposedStore({ provider: this.providerStore, network: this.networkStore }) - this.providerProxy = createEventEmitterProxy() + this.providerProxy = createObjectProxy() this.blockTrackerProxy = createEventEmitterProxy() this.on('networkDidChange', this.lookupNetwork) @@ -27,8 +28,8 @@ module.exports = class NetworkController extends EventEmitter { this._baseProviderParams = _providerParams const rpcUrl = this.getCurrentRpcAddress() this._configureStandardClient({ rpcUrl }) - this.providerProxy.on('block', this._logBlock.bind(this)) - this.providerProxy.on('error', this.verifyNetwork.bind(this)) + this.blockTrackerProxy.on('block', this._logBlock.bind(this)) + this.blockTrackerProxy.on('error', this.verifyNetwork.bind(this)) this.ethQuery = new EthQuery(this.providerProxy) this.lookupNetwork() } |