aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-01-16 04:13:59 +0800
committerGitHub <noreply@github.com>2018-01-16 04:13:59 +0800
commitbfa10e29a151dc65b0a184a134c1ba9dd2c59d8d (patch)
treee98c5d7f27ba4b074f9d983fa9362f8a5727e88c /app
parent20981f655b5bb6a070a40d1c064afea3cbf0a9e5 (diff)
parentcf60b23eec4fc5204e15ae5efbb501d372137a02 (diff)
downloadtangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.tar
tangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.tar.gz
tangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.tar.bz2
tangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.tar.lz
tangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.tar.xz
tangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.tar.zst
tangerine-wallet-browser-bfa10e29a151dc65b0a184a134c1ba9dd2c59d8d.zip
Merge pull request #2900 from MetaMask/infura-rest-api
Provider - Use Infura rest api for infura networks
Diffstat (limited to 'app')
-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)