diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-12 04:17:17 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-12 04:17:17 +0800 |
commit | 0b59dafc344994838b3fbd146c55c73ce0cb76af (patch) | |
tree | 7b9dbdb7a1b79f0a5884da24d09b4398eff5e01b /app/scripts/metamask-controller.js | |
parent | 0fae263a9acb1f4023070b37ee1b91815e34de86 (diff) | |
parent | 479da078979f0eaee05b2e25e1bb7113a5a62d6d (diff) | |
download | tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.tar tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.tar.gz tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.tar.bz2 tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.tar.lz tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.tar.xz tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.tar.zst tangerine-wallet-browser-0b59dafc344994838b3fbd146c55c73ce0cb76af.zip |
Merge branch 'dev' into integrateTxManagerUI
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index ae7aee9e3..c0b9b753c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -13,6 +13,7 @@ const extension = require('./lib/extension') const autoFaucet = require('./lib/auto-faucet') const nodeify = require('./lib/nodeify') const IdStoreMigrator = require('./lib/idStore-migrator') +const version = require('../manifest.json').version module.exports = class MetamaskController extends EventEmitter { @@ -176,6 +177,10 @@ module.exports = class MetamaskController extends EventEmitter { const keyringController = this.keyringController var providerOpts = { + static: { + eth_syncing: false, + web3_clientVersion: `MetaMask/v${version}`, + }, rpcUrl: this.configManager.getCurrentRpcAddress(), // account mgmt getAccounts: (cb) => { @@ -224,37 +229,21 @@ module.exports = class MetamaskController extends EventEmitter { initPublicConfigStore () { // get init state - var initPublicState = extend( - keyringControllerToPublic(this.keyringController.getState()), - configToPublic(this.configManager.getConfig()) - ) - + var initPublicState = configToPublic(this.configManager.getConfig()) var publicConfigStore = new HostStore(initPublicState) // subscribe to changes this.configManager.subscribe(function (state) { storeSetFromObj(publicConfigStore, configToPublic(state)) }) - this.keyringController.on('update', () => { - const state = this.keyringController.getState() - storeSetFromObj(publicConfigStore, keyringControllerToPublic(state)) - this.sendUpdate() - }) this.keyringController.on('newAccount', (account) => { autoFaucet(account) }) - // keyringController substate - function keyringControllerToPublic (state) { - return { - selectedAccount: state.selectedAccount, - } - } // config substate function configToPublic (state) { return { - provider: state.provider, selectedAccount: state.selectedAccount, } } |