diff options
Make default providers more easiliy configurable for metamask devs
No longer do our `mainnet` and `testnet` buttons set specific RPC urls. Now they set `provider.type`, which gets interpreted with code.
Currently the provider types of `mainnet` and `testnet` point to our new scalable backends, but these could be re-interpreted to use any other provider, be it etherscan, peer to peer, or otherwise.
Makes it easier for us to upgrade our infrastructure without incorporating migration logic into the program.
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 5c5805c29..dbcf3e577 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -77,10 +77,12 @@ var actions = { // config screen SHOW_CONFIG_PAGE: 'SHOW_CONFIG_PAGE', SET_RPC_TARGET: 'SET_RPC_TARGET', + SET_PROVIDER_TYPE: 'SET_PROVIDER_TYPE', USE_ETHERSCAN_PROVIDER: 'USE_ETHERSCAN_PROVIDER', useEtherscanProvider: useEtherscanProvider, showConfigPage: showConfigPage, setRpcTarget: setRpcTarget, + setProviderType: setProviderType, // hacky - need a way to get a reference to account manager _setAccountManager: _setAccountManager, // loading overlay @@ -369,6 +371,14 @@ function setRpcTarget(newRpc) { } } +function setProviderType(type) { + _accountManager.setProviderType(type) + return { + type: this.SET_PROVIDER_TYPE, + value: type, + } +} + function useEtherscanProvider() { _accountManager.useEtherscanProvider() return { |