mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #1500 from MetaMask/RemoveStreamingSubprovider
Remove streaming subprovider
This commit is contained in:
commit
8f9a230d8d
@ -7,6 +7,7 @@
|
|||||||
- Cleanup decimal bugs in our gas inputs.
|
- Cleanup decimal bugs in our gas inputs.
|
||||||
- Fix bug where submit button was enabled for invalid gas inputs.
|
- Fix bug where submit button was enabled for invalid gas inputs.
|
||||||
- Now enforce 95% of block's gasLimit to protect users.
|
- 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
|
## 3.7.0 2017-5-23
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
const pipe = require('pump')
|
const pipe = require('pump')
|
||||||
const ProviderEngine = require('web3-provider-engine')
|
const StreamProvider = require('web3-stream-provider')
|
||||||
const FilterSubprovider = require('web3-provider-engine/subproviders/filters')
|
|
||||||
const StreamSubprovider = require('web3-provider-engine/subproviders/stream')
|
|
||||||
const LocalStorageStore = require('obs-store')
|
const LocalStorageStore = require('obs-store')
|
||||||
const ObjectMultiplex = require('./obj-multiplex')
|
const ObjectMultiplex = require('./obj-multiplex')
|
||||||
const createRandomId = require('./random-id')
|
const createRandomId = require('./random-id')
|
||||||
@ -29,24 +27,14 @@ function MetamaskInpageProvider (connectionStream) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// connect to async provider
|
// connect to async provider
|
||||||
const engine = new ProviderEngine()
|
const asyncProvider = self.asyncProvider = new StreamProvider()
|
||||||
|
|
||||||
const filterSubprovider = new FilterSubprovider()
|
|
||||||
engine.addProvider(filterSubprovider)
|
|
||||||
|
|
||||||
const streamSubprovider = new StreamSubprovider()
|
|
||||||
engine.addProvider(streamSubprovider)
|
|
||||||
|
|
||||||
pipe(
|
pipe(
|
||||||
streamSubprovider,
|
asyncProvider,
|
||||||
multiStream.createStream('provider'),
|
multiStream.createStream('provider'),
|
||||||
streamSubprovider,
|
asyncProvider,
|
||||||
(err) => logStreamDisconnectWarning('MetaMask RpcProvider', err)
|
(err) => logStreamDisconnectWarning('MetaMask RpcProvider', err)
|
||||||
)
|
)
|
||||||
|
|
||||||
// start and stop polling to unblock first block lock
|
// start and stop polling to unblock first block lock
|
||||||
engine.start()
|
|
||||||
engine.once('latest', () => engine.stop())
|
|
||||||
|
|
||||||
self.idMap = {}
|
self.idMap = {}
|
||||||
// handle sendAsync requests via asyncProvider
|
// handle sendAsync requests via asyncProvider
|
||||||
@ -59,7 +47,7 @@ function MetamaskInpageProvider (connectionStream) {
|
|||||||
return message
|
return message
|
||||||
})
|
})
|
||||||
// forward to asyncProvider
|
// forward to asyncProvider
|
||||||
engine.sendAsync(request, function (err, res) {
|
asyncProvider.sendAsync(request, function (err, res) {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
// transform messages to original ids
|
// transform messages to original ids
|
||||||
eachJsonMessage(res, (message) => {
|
eachJsonMessage(res, (message) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user