aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-01-31 15:35:52 +0800
committerkumavis <aaron@kumavis.me>2016-01-31 15:35:52 +0800
commitc46eb816114ba7bb7760dda092b9efeb655cc3f8 (patch)
treebe751a02632263e65b01533f7a6a2f603f752b30 /app
parentcd4d76101ccb61a374d5ca8379c1eaa263eb5ec5 (diff)
downloadtangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.tar
tangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.tar.gz
tangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.tar.bz2
tangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.tar.lz
tangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.tar.xz
tangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.tar.zst
tangerine-wallet-browser-c46eb816114ba7bb7760dda092b9efeb655cc3f8.zip
rpc - sync - add warning for unsupported eth_accounts
Diffstat (limited to 'app')
-rw-r--r--app/scripts/inpage.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 2d872e08e..8e60c54f9 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -13,7 +13,20 @@ remoteProvider.pipe(pluginStream).pipe(remoteProvider)
// handle synchronous methods remotely
var syncProvider = new Web3.providers.HttpProvider('https://rawtestrpc.metamask.io/')
-remoteProvider.send = syncProvider.send.bind(syncProvider)
+var unsupportedMethods = ['eth_accounts']
+remoteProvider.send = function(payload){
+
+ var payloads = Array.isArray(payload) ? payload : [payload]
+ payloads.forEach(function(payload){
+ if (-1 !== unsupportedMethods.indexOf(payload.method)) {
+ console.error('MetaMask - Unsupported synchronous call "'+payload.method+'".')
+ }
+ })
+
+ return syncProvider.send(payload)
+
+}
+
// create web3
var web3 = new Web3(remoteProvider)