Skip to content

Commit

Permalink
Merge pull request #2669 from dusk-network/feature-2668
Browse files Browse the repository at this point in the history
explorer: Fix Gas Used meter if Gas Limit is zero
  • Loading branch information
nortonandreev authored Oct 14, 2024
2 parents d12f480 + c61e286 commit e0f0962
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix Transactions Fee is not properly computed [#2348]
- Fix shield icons used for tx type [#2389]
- Fix Gas Used meter if Gas Limit is zero [#2668]

## [0.2.0] - 2024-08-26

Expand Down Expand Up @@ -79,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2389]: https://github.com/dusk-network/rusk/issues/2389
[#2527]: https://github.com/dusk-network/rusk/issues/2527
[#2166]: https://github.com/dusk-network/rusk/issues/2166
[#2668]: https://github.com/dusk-network/rusk/issues/2668

<!-- VERSIONS -->

Expand Down
8 changes: 5 additions & 3 deletions explorer/src/lib/components/block-details/BlockDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@
{formatter(data.transactions.stats.gasUsed)}

<ProgressBar
currentPercentage={(data.transactions.stats.gasUsed /
data.transactions.stats.gasLimit) *
100}
currentPercentage={data.transactions.stats.gasLimit === 0
? 0
: (data.transactions.stats.gasUsed /
data.transactions.stats.gasLimit) *
100}
className="block-details__gas-used"
ariaLabel="Gas Used"
/>
Expand Down
8 changes: 5 additions & 3 deletions explorer/src/lib/components/blocks-list/BlocksList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@
<svelte:fragment slot="term">gas used</svelte:fragment>
<svelte:fragment slot="definition">
<ProgressBar
currentPercentage={(data.transactions.stats.gasUsed /
data.transactions.stats.gasLimit) *
100}
currentPercentage={data.transactions.stats.gasLimit === 0
? 0
: (data.transactions.stats.gasUsed /
data.transactions.stats.gasLimit) *
100}
className="blocks-list__gas-used"
ariaLabel="Gas Used"
/>
Expand Down

0 comments on commit e0f0962

Please sign in to comment.