Merge branch 'release/v2021.07.05-3-otterscan'

This commit is contained in:
Willian Mitsuda 2021-08-05 10:02:26 -03:00
commit 63a80995b5
3 changed files with 15 additions and 15 deletions

View File

@ -21,7 +21,7 @@ const BlockRow: React.FC<BlockRowProps> = ({ now, block, baseFeeDelta }) => {
const totalReward = block.blockReward.add(netFeeReward ?? 0); const totalReward = block.blockReward.add(netFeeReward ?? 0);
return ( return (
<div className="grid grid-cols-8 gap-x-2 px-3 py-2 hover:bg-gray-100"> <div className="grid grid-cols-9 gap-x-2 px-3 py-2 hover:bg-gray-100">
<div> <div>
<BlockLink blockTag={block.number} /> <BlockLink blockTag={block.number} />
</div> </div>
@ -41,21 +41,18 @@ const BlockRow: React.FC<BlockRowProps> = ({ now, block, baseFeeDelta }) => {
</div> </div>
<div className="text-right"> <div className="text-right">
<div className="relative"> <div className="relative">
<span>{block.baseFeePerGas?.toString()} wei</span> <span>{block.baseFeePerGas?.div(1e9).toString()} Gwei</span>
<Blip value={baseFeeDelta} /> <Blip value={baseFeeDelta} />
</div> </div>
</div> </div>
<div className="text-right col-span-2"> <div className="text-right col-span-2">
{ethers.utils.commify(ethers.utils.formatEther(totalReward))} Ether {ethers.utils.commify(ethers.utils.formatEther(totalReward))} Ether
</div> </div>
<div className="text-right line-through text-orange-500"> <div className="text-right col-span-2 line-through text-orange-500">
{ethers.utils.commify( {ethers.utils.commify(
ethers.utils.formatUnits( ethers.utils.formatEther(block.gasUsed.mul(block.baseFeePerGas!))
block.gasUsed.mul(block.baseFeePerGas!).toString(),
9
)
)}{" "} )}{" "}
Gwei ETH
</div> </div>
<div className="text-right text-gray-400"> <div className="text-right text-gray-400">
<TimestampAge now={now / 1000} timestamp={block.timestamp} /> <TimestampAge now={now / 1000} timestamp={block.timestamp} />

View File

@ -125,7 +125,7 @@ const Blocks: React.FC<BlocksProps> = ({ latestBlock, targetBlockNumber }) => {
<div> <div>
<Line data={data} height={100} options={chartOptions} /> <Line data={data} height={100} options={chartOptions} />
</div> </div>
<div className="mt-5 grid grid-cols-8 gap-x-2 px-3 py-2"> <div className="mt-5 grid grid-cols-9 gap-x-2 px-3 py-2">
<div className="flex space-x-1 items-baseline"> <div className="flex space-x-1 items-baseline">
<span className="text-gray-500"> <span className="text-gray-500">
<FontAwesomeIcon icon={faCube} /> <FontAwesomeIcon icon={faCube} />
@ -146,7 +146,7 @@ const Blocks: React.FC<BlocksProps> = ({ latestBlock, targetBlockNumber }) => {
</span> </span>
<span>Rewards</span> <span>Rewards</span>
</div> </div>
<div className="text-right flex space-x-1 justify-end items-baseline"> <div className="text-right col-span-2 flex space-x-1 justify-end items-baseline">
<span className="text-orange-500"> <span className="text-orange-500">
<FontAwesomeIcon icon={faBurn} /> <FontAwesomeIcon icon={faBurn} />
</span> </span>
@ -176,7 +176,10 @@ const Blocks: React.FC<BlocksProps> = ({ latestBlock, targetBlockNumber }) => {
block={b} block={b}
baseFeeDelta={ baseFeeDelta={
i < all.length - 1 i < all.length - 1
? b.baseFeePerGas!.sub(all[i + 1].baseFeePerGas!).toNumber() ? b
.baseFeePerGas!.sub(all[i + 1].baseFeePerGas!)
.div(1e9)
.toNumber()
: 0 : 0
} }
/> />

View File

@ -25,7 +25,7 @@ export const burntFeesChartOptions: ChartOptions = {
text: "Burnt fees", text: "Burnt fees",
}, },
ticks: { ticks: {
callback: (v) => `${v} Gwei`, callback: (v) => `${(v as number) / 1e9} ETH`,
}, },
}, },
yBaseFee: { yBaseFee: {
@ -36,7 +36,7 @@ export const burntFeesChartOptions: ChartOptions = {
text: "Base fee", text: "Base fee",
}, },
ticks: { ticks: {
callback: (v) => `${v} wei`, callback: (v) => `${(v as number) / 1e9} Gwei`,
}, },
grid: { grid: {
drawOnChartArea: false, drawOnChartArea: false,
@ -51,7 +51,7 @@ export const burntFeesChartData = (blocks: ExtendedBlock[]): ChartData => ({
{ {
label: "Burnt fees (Gwei)", label: "Burnt fees (Gwei)",
data: blocks data: blocks
.map((b) => b.gasUsed.mul(b.baseFeePerGas!).toNumber() / 1e9) .map((b) => b.gasUsed.mul(b.baseFeePerGas!).div(1e9).toNumber())
.reverse(), .reverse(),
fill: true, fill: true,
backgroundColor: "#FDBA7470", backgroundColor: "#FDBA7470",
@ -103,7 +103,7 @@ export const gasChartOptions: ChartOptions = {
text: "Base fee", text: "Base fee",
}, },
ticks: { ticks: {
callback: (v) => `${v} wei`, callback: (v) => `${(v as number) / 1e9} Gwei`,
}, },
grid: { grid: {
drawOnChartArea: false, drawOnChartArea: false,