Remove safeguards and fix small bugs to allow running otterscan against testnets; testing on goerli

This commit is contained in:
Willian Mitsuda 2021-07-24 00:21:15 -03:00
parent fd96c4e854
commit 76182a4efe
3 changed files with 11 additions and 8 deletions

View File

@ -67,8 +67,12 @@ const Block: React.FC = () => {
const _block = provider.formatter.block(_rawBlock); const _block = provider.formatter.block(_rawBlock);
const extBlock: ExtendedBlock = { const extBlock: ExtendedBlock = {
blockReward: provider.formatter.bigNumber(_rawIssuance.blockReward), blockReward: provider.formatter.bigNumber(
unclesReward: provider.formatter.bigNumber(_rawIssuance.uncleReward), _rawIssuance.blockReward ?? 0
),
unclesReward: provider.formatter.bigNumber(
_rawIssuance.uncleReward ?? 0
),
feeReward: fees, feeReward: fees,
size: provider.formatter.number(_rawBlock.size), size: provider.formatter.number(_rawBlock.size),
sha3Uncles: _rawBlock.sha3Uncles, sha3Uncles: _rawBlock.sha3Uncles,

View File

@ -1,9 +1,11 @@
import React, { useState, useRef } from "react"; import React, { useState, useRef, useContext } from "react";
import { Link, useHistory } from "react-router-dom"; import { Link, useHistory } from "react-router-dom";
import useKeyboardShortcut from "use-keyboard-shortcut"; import useKeyboardShortcut from "use-keyboard-shortcut";
import PriceBox from "./PriceBox"; import PriceBox from "./PriceBox";
import { RuntimeContext } from "./useRuntime";
const Title: React.FC = () => { const Title: React.FC = () => {
const { provider } = useContext(RuntimeContext);
const [search, setSearch] = useState<string>(); const [search, setSearch] = useState<string>();
const [canSubmit, setCanSubmit] = useState<boolean>(false); const [canSubmit, setCanSubmit] = useState<boolean>(false);
const history = useHistory(); const history = useHistory();
@ -43,7 +45,7 @@ const Title: React.FC = () => {
</div> </div>
</Link> </Link>
<div className="flex items-baseline space-x-3"> <div className="flex items-baseline space-x-3">
<PriceBox /> {provider?.network.chainId === 1 && <PriceBox />}
<form <form
className="flex" className="flex"
onSubmit={handleSubmit} onSubmit={handleSubmit}

View File

@ -33,10 +33,7 @@ export const useProvider = (
setConnStatus(ConnectionStatus.CONNECTING); setConnStatus(ConnectionStatus.CONNECTING);
const tryToConnect = async () => { const tryToConnect = async () => {
const provider = new ethers.providers.JsonRpcProvider( const provider = new ethers.providers.JsonRpcProvider(erigonURL);
erigonURL,
"mainnet"
);
// Check if it is at least a regular ETH node // Check if it is at least a regular ETH node
let blockNumber: number = 0; let blockNumber: number = 0;