Update testnet detection (#4746)
This commit is contained in:
parent
ec0e8f9dd6
commit
9b6170a37b
@ -37,10 +37,11 @@ export const setIsTestnet = (isTestnet) => ({ type: 'set isTestnet', isTestnet }
|
|||||||
export const fetchIsTestnet = () => (dispatch) =>
|
export const fetchIsTestnet = () => (dispatch) =>
|
||||||
api.net.version()
|
api.net.version()
|
||||||
.then((netVersion) => {
|
.then((netVersion) => {
|
||||||
dispatch(setIsTestnet(
|
dispatch(setIsTestnet([
|
||||||
netVersion === '2' || // morden
|
'2', // morden
|
||||||
netVersion === '3' // ropsten
|
'3', // ropsten
|
||||||
));
|
'42' // kovan
|
||||||
|
].includes(netVersion)));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error('could not check if testnet');
|
console.error('could not check if testnet');
|
||||||
|
@ -122,7 +122,7 @@ export function attachInstances () {
|
|||||||
.then(([registryAddress, netChain]) => {
|
.then(([registryAddress, netChain]) => {
|
||||||
const registry = api.newContract(abis.registry, registryAddress).instance;
|
const registry = api.newContract(abis.registry, registryAddress).instance;
|
||||||
|
|
||||||
isTest = ['morden', 'ropsten', 'testnet'].includes(netChain);
|
isTest = ['kovan', 'morden', 'ropsten', 'testnet'].includes(netChain);
|
||||||
|
|
||||||
console.log(`contract was found at registry=${registryAddress}`);
|
console.log(`contract was found at registry=${registryAddress}`);
|
||||||
console.log(`running on ${netChain}, isTest=${isTest}`);
|
console.log(`running on ${netChain}, isTest=${isTest}`);
|
||||||
|
@ -290,9 +290,11 @@ export default class Status {
|
|||||||
.then(([
|
.then(([
|
||||||
netPeers, clientVersion, netVersion, defaultExtraData, netChain, netPort, rpcSettings, enode, upgradeStatus
|
netPeers, clientVersion, netVersion, defaultExtraData, netChain, netPort, rpcSettings, enode, upgradeStatus
|
||||||
]) => {
|
]) => {
|
||||||
const isTest =
|
const isTest = [
|
||||||
netVersion === '2' || // morden
|
'2', // morden
|
||||||
netVersion === '3'; // ropsten
|
'3', // ropsten
|
||||||
|
'42' // kovan
|
||||||
|
].includes(netVersion);
|
||||||
|
|
||||||
const longStatus = {
|
const longStatus = {
|
||||||
netPeers,
|
netPeers,
|
||||||
|
Loading…
Reference in New Issue
Block a user