Merge tag 'v2021.07.05-5-otterscan' into develop

Hotfix v2021.07.05-5
This commit is contained in:
Willian Mitsuda 2021-08-05 15:24:31 -03:00
commit b18ea03e24
3 changed files with 19 additions and 8 deletions

View File

@ -23,7 +23,7 @@ const Blip: React.FC<BlipProps> = ({ value }) => {
value > 0 ? "text-green-500" : "text-red-500"
} text-3xl`}
>
{value > 0 ? `+${value}` : `-${value}`}
{value > 0 ? `+${value}` : `${value}`}
</div>
)}
</Transition>

View File

@ -1,5 +1,5 @@
import React from "react";
import { ethers } from "ethers";
import { ethers, FixedNumber } from "ethers";
import BlockLink from "../../components/BlockLink";
import TimestampAge from "../../components/TimestampAge";
import { ExtendedBlock } from "../../useErigonHooks";
@ -41,7 +41,13 @@ const BlockRow: React.FC<BlockRowProps> = ({ now, block, baseFeeDelta }) => {
</div>
<div className="text-right">
<div className="relative">
<span>{block.baseFeePerGas?.div(1e9).toString()} Gwei</span>
<span>
{FixedNumber.from(block.baseFeePerGas)
.divUnsafe(FixedNumber.from(1e9))
.round(0)
.toUnsafeFloat()}{" "}
Gwei
</span>
<Blip value={baseFeeDelta} />
</div>
</div>

View File

@ -5,7 +5,7 @@ import React, {
useMemo,
useCallback,
} from "react";
import { ethers } from "ethers";
import { ethers, FixedNumber } from "ethers";
import { Line } from "react-chartjs-2";
import { Transition } from "@headlessui/react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@ -176,10 +176,15 @@ const Blocks: React.FC<BlocksProps> = ({ latestBlock, targetBlockNumber }) => {
block={b}
baseFeeDelta={
i < all.length - 1
? b
.baseFeePerGas!.sub(all[i + 1].baseFeePerGas!)
.div(1e9)
.toNumber()
? FixedNumber.from(b.baseFeePerGas!)
.divUnsafe(FixedNumber.from(1e9))
.round(0)
.subUnsafe(
FixedNumber.from(all[i + 1].baseFeePerGas!)
.divUnsafe(FixedNumber.from(1e9))
.round(0)
)
.toUnsafeFloat()
: 0
}
/>