diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2017-05-26 06:04:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 06:04:50 +0800 |
commit | 8f9a230d8d2c8351cd325bddf3c2ca04f06c9619 (patch) | |
tree | e56a2bea800fa1aca8cd83afc7c5b07a3df30d3b /app/scripts/lib | |
parent | 3724754dcc9ba528d30a7e9e8cb7f99189f6f1e2 (diff) | |
parent | 606416121508342bd6eb0c2f40f6c482bc7d3fa0 (diff) | |
download | tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.tar tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.tar.gz tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.tar.bz2 tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.tar.lz tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.tar.xz tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.tar.zst tangerine-wallet-browser-8f9a230d8d2c8351cd325bddf3c2ca04f06c9619.zip |
Merge pull request #1500 from MetaMask/RemoveStreamingSubprovider
Remove streaming subprovider
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 39196e240..8b8623974 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,7 +1,5 @@ const pipe = require('pump') -const ProviderEngine = require('web3-provider-engine') -const FilterSubprovider = require('web3-provider-engine/subproviders/filters') -const StreamSubprovider = require('web3-provider-engine/subproviders/stream') +const StreamProvider = require('web3-stream-provider') const LocalStorageStore = require('obs-store') const ObjectMultiplex = require('./obj-multiplex') const createRandomId = require('./random-id') @@ -29,24 +27,14 @@ function MetamaskInpageProvider (connectionStream) { ) // connect to async provider - const engine = new ProviderEngine() - - const filterSubprovider = new FilterSubprovider() - engine.addProvider(filterSubprovider) - - const streamSubprovider = new StreamSubprovider() - engine.addProvider(streamSubprovider) - + const asyncProvider = self.asyncProvider = new StreamProvider() pipe( - streamSubprovider, + asyncProvider, multiStream.createStream('provider'), - streamSubprovider, + asyncProvider, (err) => logStreamDisconnectWarning('MetaMask RpcProvider', err) ) - // start and stop polling to unblock first block lock - engine.start() - engine.once('latest', () => engine.stop()) self.idMap = {} // handle sendAsync requests via asyncProvider @@ -59,7 +47,7 @@ function MetamaskInpageProvider (connectionStream) { return message }) // forward to asyncProvider - engine.sendAsync(request, function (err, res) { + asyncProvider.sendAsync(request, function (err, res) { if (err) return cb(err) // transform messages to original ids eachJsonMessage(res, (message) => { |