aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-02-01 12:02:38 +0800
committerkumavis <aaron@kumavis.me>2017-02-01 12:02:38 +0800
commitc0d3db6a8ce2fe0522fa4e3cba1e01d10469280f (patch)
tree252d5235f19bd10800150bae2af4663249226628 /app/scripts/metamask-controller.js
parent82578538198de74955d7bc5cfd3c9a02d1b69a6d (diff)
downloadtangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.tar
tangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.tar.gz
tangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.tar.bz2
tangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.tar.lz
tangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.tar.xz
tangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.tar.zst
tangerine-wallet-browser-c0d3db6a8ce2fe0522fa4e3cba1e01d10469280f.zip
keyring - synchronous getState
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js38
1 files changed, 16 insertions, 22 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 2c379f8d9..17b5683a1 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -169,22 +169,19 @@ module.exports = class MetamaskController extends EventEmitter {
//
getState () {
- return this.keyringController.getState()
- .then((keyringControllerState) => {
- return extend(
- this.state,
- this.ethStore.getState(),
- this.configManager.getConfig(),
- this.txManager.getState(),
- keyringControllerState,
- this.preferencesController.store.getState(),
- this.noticeController.getState(),
- {
- shapeShiftTxList: this.configManager.getShapeShiftTxList(),
- lostAccounts: this.configManager.getLostAccounts(),
- }
- )
- })
+ return extend(
+ this.state,
+ this.ethStore.getState(),
+ this.configManager.getConfig(),
+ this.txManager.getState(),
+ this.keyringController.getState(),
+ this.preferencesController.store.getState(),
+ this.noticeController.getState(),
+ {
+ shapeShiftTxList: this.configManager.getShapeShiftTxList(),
+ lostAccounts: this.configManager.getLostAccounts(),
+ }
+ )
}
//
@@ -199,7 +196,7 @@ module.exports = class MetamaskController extends EventEmitter {
return {
// etc
- getState: nodeify(this.getState.bind(this)),
+ getState: (cb) => cb(null, this.getState()),
setRpcTarget: this.setRpcTarget.bind(this),
setProviderType: this.setProviderType.bind(this),
useEtherscanProvider: this.useEtherscanProvider.bind(this),
@@ -295,11 +292,8 @@ module.exports = class MetamaskController extends EventEmitter {
)
}
- sendUpdate () {
- this.getState()
- .then((state) => {
- this.emit('update', state)
- })
+ sendUpdate () {
+ this.emit('update', this.getState())
}
//