Merge pull request #4746 from blockscout/np-fix-decimal-compare-gas-limit

Fix comparison of decimal value
pull/4699/head
Victor Baranov 3 years ago committed by GitHub
commit 79c11a9118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/block/_tile.html.eex

@ -18,6 +18,7 @@
- [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector
### Fixes
- [#4746](https://github.com/blockscout/blockscout/pull/4746) - Fix comparison of decimal value
- [#4711](https://github.com/blockscout/blockscout/pull/4711) - Add trimming to the contract functions inputs
- [#4729](https://github.com/blockscout/blockscout/pull/4729) - Fix bugs with fees in cases of txs with `gas price = 0`
- [#4725](https://github.com/blockscout/blockscout/pull/4725) - Fix hardcoded coin name on transaction's and block's page

@ -68,7 +68,7 @@
<!-- Gas Used -->
<div class="mr-3 mr-md-0">
<%= formatted_gas(@block.gas_used) %>
<% gas = if @block.gas_limit > 0, do: Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit), else: 0 %>
<% gas = if Decimal.cmp(@block.gas_limit, 0) == :gt, do: Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit), else: 0 %>
(<%= formatted_gas(gas, format: "#.#%") %>)
<%= gettext "Gas Used" %>
</div>

Loading…
Cancel
Save