Remove unnecessary field

This commit is contained in:
Willian Mitsuda 2021-07-28 04:53:55 -03:00
parent e214117f47
commit 31287796f0
3 changed files with 9 additions and 6 deletions

View File

@ -97,10 +97,8 @@ const Transaction: React.FC = () => {
maxFeePerGas: _response.maxFeePerGas,
maxPriorityFeePerGas: _response.maxPriorityFeePerGas,
gasPrice: _response.gasPrice!,
gasLimit: _response.gasLimit,
gasUsed: _receipt.gasUsed,
gasUsedPerc:
_receipt.gasUsed.toNumber() / _response.gasLimit.toNumber(),
gasLimit: _response.gasLimit,
nonce: _response.nonce,
data: _response.data,
logs: _receipt.logs,

View File

@ -177,7 +177,13 @@ const Details: React.FC<DetailsProps> = ({
<GasValue value={txData.gasUsed} /> /{" "}
<GasValue value={txData.gasLimit} />
</div>
<PercentageBar perc={Math.round(txData.gasUsedPerc * 10000) / 100} />
<PercentageBar
perc={
Math.round(
(txData.gasUsed.toNumber() / txData.gasLimit.toNumber()) * 10000
) / 100
}
/>
</div>
</InfoRow>
<InfoRow title="Ether Price">N/A</InfoRow>

View File

@ -54,9 +54,8 @@ export type TransactionData = {
maxPriorityFeePerGas?: BigNumber | undefined;
fee: BigNumber;
gasPrice: BigNumber;
gasLimit: BigNumber;
gasUsed: BigNumber;
gasUsedPerc: number;
gasLimit: BigNumber;
nonce: number;
data: string;
logs: ethers.providers.Log[];