aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2017-05-26 06:04:50 +0800
committerGitHub <noreply@github.com>2017-05-26 06:04:50 +0800
commit8f9a230d8d2c8351cd325bddf3c2ca04f06c9619 (patch)
treee56a2bea800fa1aca8cd83afc7c5b07a3df30d3b
parent3724754dcc9ba528d30a7e9e8cb7f99189f6f1e2 (diff)
parent606416121508342bd6eb0c2f40f6c482bc7d3fa0 (diff)
downloadtangerine-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
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/lib/inpage-provider.js22
2 files changed, 6 insertions, 17 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b755e3999..4ad1b2f50 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@
- Cleanup decimal bugs in our gas inputs.
- Fix bug where submit button was enabled for invalid gas inputs.
- Now enforce 95% of block's gasLimit to protect users.
+- Removing provider-engine from the inpage provider. This fixes some error handling inconsistencies introduced in 3.7.0.
## 3.7.0 2017-5-23
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) => {