Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite gas usage count loading #4854

Merged
merged 1 commit into from Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,7 @@
- [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector

### Fixes
- [#4854](https://github.com/blockscout/blockscout/pull/4854) - Fix infinite gas usage count loading
- [#4853](https://github.com/blockscout/blockscout/pull/4853) - Allow custom optimizations runs for contract verifications via API
- [#4840](https://github.com/blockscout/blockscout/pull/4840) - Replace Enum.dedup with Enum.uniq where actually uniq items are expected
- [#4835](https://github.com/blockscout/blockscout/pull/4835) - Fix view for broken token icons
Expand Down
Expand Up @@ -87,10 +87,12 @@ defmodule BlockScoutWeb.AddressController do
{transaction_count, token_transfer_count, gas_usage_count, validation_count, crc_total_worth} =
address_counters(address)

gas_usage_count_formatted = if gas_usage_count, do: gas_usage_count, else: 0

json(conn, %{
transaction_count: transaction_count,
token_transfer_count: token_transfer_count,
gas_usage_count: gas_usage_count,
gas_usage_count: gas_usage_count_formatted,
validation_count: validation_count,
crc_total_worth: crc_total_worth
})
Expand Down
Expand Up @@ -89,7 +89,7 @@ defmodule BlockScoutWeb.AddressControllerTest do
"transaction_count" => 0,
"token_transfer_count" => 0,
"validation_count" => 0,
"gas_usage_count" => nil,
"gas_usage_count" => 0,
"crc_total_worth" => "0"
} ==
response
Expand Down