diff options
author | kumavis <aaron@kumavis.me> | 2016-04-09 05:24:10 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2016-04-09 05:24:10 +0800 |
commit | 266e3c7ddb920c933355d559144bab6c633a65fb (patch) | |
tree | ce57869cb3f9eed23c6ff717004668a366a315dc /app/scripts/popup.js | |
parent | 379294f16415a6ca112c590b1bcc12448189d245 (diff) | |
download | tangerine-wallet-browser-266e3c7ddb920c933355d559144bab6c633a65fb.tar.gz tangerine-wallet-browser-266e3c7ddb920c933355d559144bab6c633a65fb.tar.zst tangerine-wallet-browser-266e3c7ddb920c933355d559144bab6c633a65fb.zip |
popup - fix web3 plumbing
Diffstat (limited to 'app/scripts/popup.js')
-rw-r--r-- | app/scripts/popup.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/scripts/popup.js b/app/scripts/popup.js index cfb3c95e0..e6dae0d81 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -9,6 +9,8 @@ const MetaMaskUiCss = require('metamask-ui/css') const injectCss = require('inject-css') const PortStream = require('./lib/port-stream.js') const StreamProvider = require('./lib/stream-provider.js') +const jsonParseStream = require('./lib/stream-utils.js').jsonParseStream +const jsonStringifyStream = require('./lib/stream-utils.js').jsonStringifyStream // setup app var css = MetaMaskUiCss() @@ -42,7 +44,11 @@ function connectToAccountManager(cb){ function linkWeb3(stream){ var remoteProvider = new StreamProvider() - remoteProvider.pipe(stream).pipe(remoteProvider) + remoteProvider + .pipe(jsonStringifyStream()) + .pipe(stream) + .pipe(jsonParseStream()) + .pipe(remoteProvider) stream.on('error', console.error.bind(console)) remoteProvider.on('error', console.error.bind(console)) global.web3 = new Web3(remoteProvider) |