From d8bee4f5992c5a1d0851e87c49e13c97d9279411 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 10 May 2016 15:37:13 -0700 Subject: 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. --- ui/app/reducers/metamask.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ui/app/reducers/metamask.js') diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 2fe96c453..9398f1497 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -38,7 +38,17 @@ function reduceMetamask(state, action) { case actions.SET_RPC_TARGET: return extend(metamaskState, { - rpcTarget: action.value, + provider: { + type: 'rpc', + rpcTarget: action.value, + }, + }) + + case actions.SET_PROVIDER_TYPE: + return extend(metamaskState, { + provider: { + type: action.value, + }, }) case actions.COMPLETED_TX: -- cgit v1.2.3