diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-06-28 04:10:56 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-06-28 04:10:56 +0800 |
commit | 847a4282a2c0db6561972147bd366622424f5d28 (patch) | |
tree | 2eefd2831cb627b9fd41e8858fe82714d85d399b /app/scripts/metamask-controller.js | |
parent | abbbe1156c03700c4476d0618e65aa2eed2c264e (diff) | |
parent | 48f7cff8c0e765e85532c860c5f3061ca1d6deb7 (diff) | |
download | tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.gz tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.bz2 tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.lz tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.xz tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.tar.zst tangerine-wallet-browser-847a4282a2c0db6561972147bd366622424f5d28.zip |
Merge branch 'master' into nonce-tracker
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 755bf3289..be64a45c7 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -15,6 +15,7 @@ const CurrencyController = require('./controllers/currency') const NoticeController = require('./notice-controller') const ShapeShiftController = require('./controllers/shapeshift') const AddressBookController = require('./controllers/address-book') +const InfuraController = require('./controllers/infura') const MessageManager = require('./lib/message-manager') const PersonalMessageManager = require('./lib/personal-message-manager') const TransactionController = require('./controllers/transactions') @@ -44,8 +45,8 @@ module.exports = class MetamaskController extends EventEmitter { this.store = new ObservableStore(initState) // network store - this.networkController = new NetworkController(initState.NetworkController) + // config manager this.configManager = new ConfigManager({ store: this.store, @@ -63,6 +64,13 @@ module.exports = class MetamaskController extends EventEmitter { this.currencyController.updateConversionRate() this.currencyController.scheduleConversionInterval() + // infura controller + this.infuraController = new InfuraController({ + initState: initState.InfuraController, + }) + this.infuraController.scheduleInfuraNetworkCheck() + + // rpc provider this.provider = this.initializeProvider() @@ -147,6 +155,9 @@ module.exports = class MetamaskController extends EventEmitter { this.networkController.store.subscribe((state) => { this.store.updateState({ NetworkController: state }) }) + this.infuraController.store.subscribe((state) => { + this.store.updateState({ InfuraController: state }) + }) // manual mem state subscriptions this.networkController.store.subscribe(this.sendUpdate.bind(this)) @@ -160,6 +171,7 @@ module.exports = class MetamaskController extends EventEmitter { this.currencyController.store.subscribe(this.sendUpdate.bind(this)) this.noticeController.memStore.subscribe(this.sendUpdate.bind(this)) this.shapeshiftController.store.subscribe(this.sendUpdate.bind(this)) + this.infuraController.store.subscribe(this.sendUpdate.bind(this)) } // @@ -237,6 +249,7 @@ module.exports = class MetamaskController extends EventEmitter { this.addressBookController.store.getState(), this.currencyController.store.getState(), this.noticeController.memStore.getState(), + this.infuraController.store.getState(), // config manager this.configManager.getConfig(), this.shapeshiftController.store.getState(), @@ -280,6 +293,7 @@ module.exports = class MetamaskController extends EventEmitter { // PreferencesController setSelectedAddress: nodeify(preferencesController.setSelectedAddress).bind(preferencesController), + setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab).bind(preferencesController), setDefaultRpc: nodeify(this.setDefaultRpc).bind(this), setCustomRpc: nodeify(this.setCustomRpc).bind(this), |