aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-02-10 11:03:22 +0800
committerGitHub <noreply@github.com>2017-02-10 11:03:22 +0800
commit01e43c789c29668dafb718aa68d9eee76788298b (patch)
tree7eb792bc88a6b2c3425c54e56d358c24e7bf7e04
parent2f6bf1c074fc49fd0354380c24e07eb9aa2a5ec2 (diff)
parentd1a6b8c8ed023671d9d934be26921136f9af3756 (diff)
downloadtangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.tar
tangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.tar.gz
tangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.tar.bz2
tangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.tar.lz
tangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.tar.xz
tangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.tar.zst
tangerine-wallet-browser-01e43c789c29668dafb718aa68d9eee76788298b.zip
Merge pull request #1101 from MetaMask/i1085-synchronousnet
Allowed net_version to be called synchronously
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/lib/inpage-provider.js5
-rw-r--r--app/scripts/metamask-controller.js3
3 files changed, 8 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 55c60e185..1d1a2370b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## Current Master
+- net_version has been made synchronous.
## 3.2.1 2017-2-8
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js
index faecac137..92936de2f 100644
--- a/app/scripts/lib/inpage-provider.js
+++ b/app/scripts/lib/inpage-provider.js
@@ -84,6 +84,11 @@ MetamaskInpageProvider.prototype.send = function (payload) {
result = true
break
+ case 'net_version':
+ let networkVersion = self.publicConfigStore.getState().networkVersion
+ result = networkVersion
+ break
+
// throw not-supported Error
default:
var link = 'https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client'
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index fb2040c63..33c51dc07 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -178,7 +178,7 @@ module.exports = class MetamaskController extends EventEmitter {
// sync publicConfigStore with transform
pipe(
this.store,
- storeTransform(selectPublicState),
+ storeTransform(selectPublicState.bind(this)),
publicConfigStore
)
@@ -186,6 +186,7 @@ module.exports = class MetamaskController extends EventEmitter {
const result = { selectedAddress: undefined }
try {
result.selectedAddress = state.PreferencesController.selectedAddress
+ result.networkVersion = this.getNetworkState()
} catch (_) {}
return result
}