aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-09-08 01:08:07 +0800
committerkumavis <aaron@kumavis.me>2017-09-08 01:08:07 +0800
commit440a42bbc38ed53b64dc017fd56bd3281355df33 (patch)
tree08ed4b7411bebdec31e53279cc7e1fa66db75bf8
parentcc56d0d2f61da576acc72b1e7f63df4015469267 (diff)
downloadtangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.tar
tangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.tar.gz
tangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.tar.bz2
tangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.tar.lz
tangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.tar.xz
tangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.tar.zst
tangerine-wallet-browser-440a42bbc38ed53b64dc017fd56bd3281355df33.zip
inpage - add idRemapMiddleware
-rw-r--r--app/scripts/lib/inpage-provider.js4
-rw-r--r--package.json1
2 files changed, 4 insertions, 1 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js
index de6e8b811..c095846e1 100644
--- a/app/scripts/lib/inpage-provider.js
+++ b/app/scripts/lib/inpage-provider.js
@@ -1,5 +1,6 @@
const pipe = require('pump')
const RpcEngine = require('json-rpc-engine')
+const createIdRemapMiddleware = require('json-rpc-engine/src/idRemapMiddleware')
const createStreamMiddleware = require('json-rpc-middleware-stream')
const LocalStorageStore = require('obs-store')
const ObjectMultiplex = require('./obj-multiplex')
@@ -27,7 +28,7 @@ function MetamaskInpageProvider (connectionStream) {
)
// ignore phishing warning message (handled elsewhere)
- multiStream.ignoreStream('phishing')
+ multiStream.ignoreStream('phishing')
// connect to async provider
const streamMiddleware = createStreamMiddleware()
@@ -41,6 +42,7 @@ function MetamaskInpageProvider (connectionStream) {
// handle sendAsync requests via dapp-side rpc engine
const engine = new RpcEngine()
+ engine.push(createIdRemapMiddleware())
engine.push(streamMiddleware)
self.sendAsync = engine.handle.bind(engine)
diff --git a/package.json b/package.json
index a0d241341..7712707c6 100644
--- a/package.json
+++ b/package.json
@@ -93,6 +93,7 @@
"iframe-stream": "^3.0.0",
"inject-css": "^0.1.1",
"jazzicon": "^1.2.0",
+ "json-rpc-engine": "^3.1.0",
"json-rpc-middleware-stream": "^1.0.0",
"loglevel": "^1.4.1",
"metamask-logo": "^2.1.2",