|
|
@ -112,11 +112,13 @@ var actions = { |
|
|
|
// config screen
|
|
|
|
// config screen
|
|
|
|
SHOW_CONFIG_PAGE: 'SHOW_CONFIG_PAGE', |
|
|
|
SHOW_CONFIG_PAGE: 'SHOW_CONFIG_PAGE', |
|
|
|
SET_RPC_TARGET: 'SET_RPC_TARGET', |
|
|
|
SET_RPC_TARGET: 'SET_RPC_TARGET', |
|
|
|
|
|
|
|
SET_DEFAULT_RPC_TARGET: 'SET_DEFAULT_RPC_TARGET', |
|
|
|
SET_PROVIDER_TYPE: 'SET_PROVIDER_TYPE', |
|
|
|
SET_PROVIDER_TYPE: 'SET_PROVIDER_TYPE', |
|
|
|
USE_ETHERSCAN_PROVIDER: 'USE_ETHERSCAN_PROVIDER', |
|
|
|
USE_ETHERSCAN_PROVIDER: 'USE_ETHERSCAN_PROVIDER', |
|
|
|
useEtherscanProvider: useEtherscanProvider, |
|
|
|
useEtherscanProvider: useEtherscanProvider, |
|
|
|
showConfigPage: showConfigPage, |
|
|
|
showConfigPage: showConfigPage, |
|
|
|
setRpcTarget: setRpcTarget, |
|
|
|
setRpcTarget: setRpcTarget, |
|
|
|
|
|
|
|
setDefaultRpcTarget: setDefaultRpcTarget, |
|
|
|
setProviderType: setProviderType, |
|
|
|
setProviderType: setProviderType, |
|
|
|
// loading overlay
|
|
|
|
// loading overlay
|
|
|
|
SHOW_LOADING: 'SHOW_LOADING_INDICATION', |
|
|
|
SHOW_LOADING: 'SHOW_LOADING_INDICATION', |
|
|
@ -669,18 +671,34 @@ function markAccountsFound() { |
|
|
|
// config
|
|
|
|
// config
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// default rpc target refers to localhost:8545 in this instance.
|
|
|
|
|
|
|
|
function setDefaultRpcTarget (rpcList) { |
|
|
|
|
|
|
|
log.debug(`background.setDefaultRpcTarget`) |
|
|
|
|
|
|
|
background.setRpcTarget('http://localhost:8545') |
|
|
|
|
|
|
|
return (dispatch) => { |
|
|
|
|
|
|
|
dispatch({ |
|
|
|
|
|
|
|
type: actions.SET_RPC_TARGET, |
|
|
|
|
|
|
|
value: 'http://localhost:8545', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
dispatch({ |
|
|
|
|
|
|
|
type: actions.SET_RPC_LIST, |
|
|
|
|
|
|
|
value: rpcList, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function setRpcTarget (newRpc) { |
|
|
|
function setRpcTarget (newRpc) { |
|
|
|
return (dispatch) => { |
|
|
|
return (dispatch) => { |
|
|
|
log.debug(`background.setRpcTarget`) |
|
|
|
log.debug(`background.setRpcTarget`) |
|
|
|
background.setRpcTarget(newRpc) |
|
|
|
background.setRpcTarget(newRpc) |
|
|
|
background.updateFrequentRpcList(newRpc, (frequentRpcList) => { |
|
|
|
background.updateFrequentRpcList(newRpc, (rpcList) => { |
|
|
|
const value = { |
|
|
|
|
|
|
|
rpcTarget: newRpc, |
|
|
|
|
|
|
|
frequentRpcList, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
dispatch({ |
|
|
|
dispatch({ |
|
|
|
type: actions.SET_RPC_TARGET, |
|
|
|
type: actions.SET_RPC_TARGET, |
|
|
|
value, |
|
|
|
value: newRpc, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
dispatch({ |
|
|
|
|
|
|
|
type: actions.SET_RPC_LIST, |
|
|
|
|
|
|
|
value: rpcList, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|