aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/network.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2018-01-16 07:25:14 +0800
committerGitHub <noreply@github.com>2018-01-16 07:25:14 +0800
commitf18ed8bfd43874065d19bdbf5f5513f5facb9061 (patch)
tree07285d554dc9c29033ff0d8c77c63e4168c13938 /app/scripts/controllers/network.js
parent724197b95f30931e17edaf86c7391687b2922457 (diff)
parenta18524300a1d95f9e118660115f5284f14a89f61 (diff)
downloadtangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.tar
tangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.tar.gz
tangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.tar.bz2
tangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.tar.lz
tangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.tar.xz
tangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.tar.zst
tangerine-wallet-browser-f18ed8bfd43874065d19bdbf5f5513f5facb9061.zip
Merge branch 'master' into open-popup
Diffstat (limited to 'app/scripts/controllers/network.js')
-rw-r--r--app/scripts/controllers/network.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js
index 377ba6eca..a1db8946a 100644
--- a/app/scripts/controllers/network.js
+++ b/app/scripts/controllers/network.js
@@ -1,6 +1,7 @@
const assert = require('assert')
const EventEmitter = require('events')
const createMetamaskProvider = require('web3-provider-engine/zero.js')
+const SubproviderFromProvider = require('web3-provider-engine/subproviders/web3.js')
const createInfuraProvider = require('eth-json-rpc-infura/src/createProvider')
const ObservableStore = require('obs-store')
const ComposedStore = require('obs-store/lib/composed')
@@ -133,15 +134,17 @@ module.exports = class NetworkController extends EventEmitter {
_configureInfuraProvider (opts) {
log.info('_configureInfuraProvider', opts)
- const blockTrackerProvider = createInfuraProvider({
+ const infuraProvider = createInfuraProvider({
network: opts.type,
})
+ const infuraSubprovider = new SubproviderFromProvider(infuraProvider)
const providerParams = extend(this._baseProviderParams, {
rpcUrl: opts.rpcUrl,
engineParams: {
pollingInterval: 8000,
- blockTrackerProvider,
+ blockTrackerProvider: infuraProvider,
},
+ dataSubprovider: infuraSubprovider,
})
const provider = createMetamaskProvider(providerParams)
this._setProvider(provider)