aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-08 08:01:51 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-08 08:01:51 +0800
commite7e024bcdd2c93b34a0baf8bc27e6c571c098476 (patch)
tree26ab0b013f3c10d0db040aeea3baac798e3bb390 /app/scripts/metamask-controller.js
parent08ca7dac5a15e104084c6da3eb6015136b316809 (diff)
downloadtangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar
tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.gz
tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.bz2
tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.lz
tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.xz
tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.tar.zst
tangerine-wallet-browser-e7e024bcdd2c93b34a0baf8bc27e6c571c098476.zip
Refactor of code into separate reducers and actions.
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index f6dbf899d..3b3329b58 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -244,7 +244,8 @@ module.exports = class MetamaskController extends EventEmitter {
return {
// etc
getState: (cb) => cb(null, this.getState()),
- setRpcTarget: this.setRpcTarget.bind(this),
+ setDefaultRpc: this.setDefaultRpc.bind(this),
+ setCustomRpc: this.setCustomRpc.bind(this),
setProviderType: this.setProviderType.bind(this),
useEtherscanProvider: this.useEtherscanProvider.bind(this),
setCurrentCurrency: this.setCurrentCurrency.bind(this),
@@ -265,7 +266,6 @@ module.exports = class MetamaskController extends EventEmitter {
// PreferencesController
setSelectedAddress: nodeify(preferencesController.setSelectedAddress).bind(preferencesController),
- updateFrequentRpcList: nodeify(preferencesController.updateFrequentRpcList).bind(preferencesController),
// KeyringController
setLocked: nodeify(keyringController.setLocked).bind(keyringController),
@@ -662,12 +662,21 @@ module.exports = class MetamaskController extends EventEmitter {
if (this.isNetworkLoading()) this.lookupNetwork()
}
- setRpcTarget (rpcTarget) {
- this.configManager.setRpcTarget(rpcTarget)
+ setDefaultRpc () {
+ this.configManager.setRpcTarget('http://localhost:8545')
extension.runtime.reload()
this.lookupNetwork()
}
+ setCustomRpc (rpcTarget, rpcList) {
+ this.configManager.setRpcTarget(rpcTarget)
+ return this.preferencesController.updateFrequentRpcList(rpcTarget)
+ .then(() => {
+ extension.runtime.reload()
+ this.lookupNetwork()
+ })
+ }
+
setProviderType (type) {
this.configManager.setProviderType(type)
extension.runtime.reload()