Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #10 from etclabscore/fix/multi-geth-version
Browse files Browse the repository at this point in the history
fix: mutli-geth version
  • Loading branch information
shanejonas authored Jun 28, 2019
2 parents 25f6ba3 + a9aa572 commit 94e8805
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/containers/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const unit = require("ethjs-unit");

export default function Address({ match }: { match: { params: { address: string } } }) {
const { address } = match.params;
const [erpc] = useMultiGeth("1.9.1", "mainnet");
const [erpc] = useMultiGeth("1.9.0", "mainnet");
const [blockNumber] = useBlockNumber(erpc);
const [transactionCount, setTransactionCount] = React.useState();
const [balance, setBalance] = React.useState();
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useMultiGeth from "../erpc";

export default function Block(props: any) {
const { match: { params: { hash } } } = props;
const [erpc] = useMultiGeth("1.9.1", "mainnet");
const [erpc] = useMultiGeth("1.9.0", "mainnet");
const [block, setBlock] = React.useState();
React.useEffect(() => {
if (!erpc) { return; }
Expand Down
2 changes: 1 addition & 1 deletion src/containers/BlockList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IProps {

export default function BlockListContainer(props: IProps) {
const { from, to } = props;
const [erpc] = useMultiGeth("1.9.1", "mainnet");
const [erpc] = useMultiGeth("1.9.0", "mainnet");
const [blocks, setBlocks] = React.useState();
React.useEffect(() => {
if (!erpc) { return; }
Expand Down
21 changes: 12 additions & 9 deletions src/containers/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import HashRate from "../components/HashRate";
import useMultiGeth from "../erpc";
import getBlocks, { useBlockNumber } from "../helpers";
import BlockList from "./BlockList";
import useInterval from "use-interval";

const useState = React.useState;

Expand Down Expand Up @@ -58,7 +59,7 @@ const getStyles = () => {

export default (props: any) => {
const styles = getStyles();
const [erpc] = useMultiGeth("1.9.1", "mainnet");
const [erpc] = useMultiGeth("1.9.0", "mainnet");
const [blockNumber] = useBlockNumber(erpc);
const [chainId, setChainId] = useState();
const [block, setBlock] = useState();
Expand Down Expand Up @@ -88,10 +89,12 @@ export default (props: any) => {
});
}, [blockNumber, erpc]);

React.useEffect(() => {
useInterval(() => {
if (!erpc) { return; }

erpc.eth_syncing().then(setSyncing);
}, [erpc]);
}, 10000, true);


React.useEffect(() => {
if (!erpc) { return; }
Expand Down Expand Up @@ -181,12 +184,12 @@ export default (props: any) => {
<VictoryBar data={blocks.map(blockMapUncles)} />
</VictoryChart>
</Grid>
{blockNumber &&
<Grid item={true} key={"blocks"}>
<Button href={"/blocks"}>View All Blocks</Button>
<BlockList from={Math.max(blockNumber - 11, 0)} to={blockNumber} erpc={erpc} />
</Grid>
}

<Grid item={true} key={"blocks"}>
<Button href={"/blocks"}>View All Blocks</Button>
<BlockList from={Math.max(blockNumber - 11, 0)} to={blockNumber} erpc={erpc} />
</Grid>

</Grid>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/NodeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useBlockNumber } from "../helpers";
import BlockList from "./BlockList";

export default function NodeView(props: any) {
const [erpc] = useMultiGeth("1.9.1", "mainnet");
const [erpc] = useMultiGeth("1.9.0", "mainnet");
const [blockNumber] = useBlockNumber(erpc);
if (!blockNumber) {
return (<CircularProgress />);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useMultiGeth from "../erpc";

export default function TransactionContainer(props: any) {
const hash = props.match.params.hash;
const [erpc] = useMultiGeth("1.9.1", "mainnet");
const [erpc] = useMultiGeth("1.9.0", "mainnet");
const [transaction, setTransaction] = React.useState();
const [receipt, setReceipt] = React.useState();

Expand Down

0 comments on commit 94e8805

Please sign in to comment.