From 1f857037bdeb73af14dc8388c5ec161c885278c1 Mon Sep 17 00:00:00 2001 From: Vadim Date: Wed, 10 Oct 2018 18:55:10 +0300 Subject: [PATCH 1/3] (Update) Add support of a new version of MetaMask Solves https://github.com/poanetwork/poa-dapps-validators/issues/85 --- src/App.js | 4 +- src/Footer.js | 4 +- src/Header.js | 13 +- src/Loading.js | 13 +- src/constants.js | 30 ++- src/contracts/KeysManager.contract.js | 4 +- src/contracts/Metadata.contract.js | 4 +- src/contracts/PoaConsensus.contract.js | 7 +- .../ProofOfPhysicalAddress.contract.js | 7 +- src/contracts/addresses.js | 20 +- src/contracts/helpers.js | 18 +- src/getWeb3.js | 171 ++++++++---------- src/helpers.js | 12 +- src/index.js | 85 ++++----- 14 files changed, 182 insertions(+), 210 deletions(-) diff --git a/src/App.js b/src/App.js index 1c75333..d950cea 100644 --- a/src/App.js +++ b/src/App.js @@ -152,7 +152,7 @@ class App extends Component { const isValid = await this.getKeysManager().isVotingActive(votingKey) console.log(isValid) if (isValid) { - // // add loading screen + // add loading screen await this.sendTxToContract() } else { this.setState({ loading: false }) @@ -203,7 +203,7 @@ class App extends Component { } render() { const { netId } = this.props.web3Config - const classNameHiddenIfNotCoreNetwork = netId !== constants.NETID_CORE ? 'display-none' : '' + const classNameHiddenIfNotCoreNetwork = netId !== helpers.netIdByName('core') ? 'display-none' : '' if (!this.isValidVotingKey) { return null diff --git a/src/Footer.js b/src/Footer.js index 6dc923e..29746f4 100644 --- a/src/Footer.js +++ b/src/Footer.js @@ -1,10 +1,10 @@ import React from 'react' import moment from 'moment' import Socials from './Socials' -import { isTestnet } from './helpers' +import { constants } from './constants' const Footer = ({ netId }) => { - const footerClassName = isTestnet(netId) ? 'sokol' : '' + const footerClassName = netId in constants.NETWORKS && constants.NETWORKS[netId].TESTNET ? 'sokol' : '' return (