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) =>
|
||||
api.net.version()
|
||||
.then((netVersion) => {
|
||||
dispatch(setIsTestnet(
|
||||
netVersion === '2' || // morden
|
||||
netVersion === '3' // ropsten
|
||||
));
|
||||
dispatch(setIsTestnet([
|
||||
'2', // morden
|
||||
'3', // ropsten
|
||||
'42' // kovan
|
||||
].includes(netVersion)));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('could not check if testnet');
|
||||
|
@ -122,7 +122,7 @@ export function attachInstances () {
|
||||
.then(([registryAddress, netChain]) => {
|
||||
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(`running on ${netChain}, isTest=${isTest}`);
|
||||
|
@ -290,9 +290,11 @@ export default class Status {
|
||||
.then(([
|
||||
netPeers, clientVersion, netVersion, defaultExtraData, netChain, netPort, rpcSettings, enode, upgradeStatus
|
||||
]) => {
|
||||
const isTest =
|
||||
netVersion === '2' || // morden
|
||||
netVersion === '3'; // ropsten
|
||||
const isTest = [
|
||||
'2', // morden
|
||||
'3', // ropsten
|
||||
'42' // kovan
|
||||
].includes(netVersion);
|
||||
|
||||
const longStatus = {
|
||||
netPeers,
|
||||
|
Loading…
Reference in New Issue
Block a user