Merge pull request #4993 from blockscout/vb-fix-address_to_gas_usage_count

address_to_gas_usage_count function fix for nil incoming transactions gas usage count
pull/4998/head
Victor Baranov 3 years ago committed by GitHub
commit 88f5ac6d73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 13
      apps/explorer/lib/explorer/chain.ex

@ -5,7 +5,7 @@
- [#4931](https://github.com/blockscout/blockscout/pull/4931) - Web3 modal with Wallet Connect for Write contract page and Staking Dapp
### Fixes
- [#4979](https://github.com/blockscout/blockscout/pull/4979) - Store total gas_used in addresses table
- [#4979](https://github.com/blockscout/blockscout/pull/4979), [#4993](https://github.com/blockscout/blockscout/pull/4993) - Store total gas_used in addresses table
- [#4977](https://github.com/blockscout/blockscout/pull/4977) - Export token transfers on address: include transfers on contract itself
- [#4976](https://github.com/blockscout/blockscout/pull/4976) - Handle :econnrefused in pending transactions fetcher
- [#4965](https://github.com/blockscout/blockscout/pull/4965) - Fix search field appearance on medium size screens

@ -2548,10 +2548,15 @@ defmodule Explorer.Chain do
if contract?(address) do
incoming_transaction_gas_usage = address_to_incoming_transaction_gas_usage(address.hash)
if Decimal.cmp(incoming_transaction_gas_usage, 0) == :eq do
address_to_outcoming_transaction_gas_usage(address.hash)
else
incoming_transaction_gas_usage
cond do
!incoming_transaction_gas_usage ->
address_to_outcoming_transaction_gas_usage(address.hash)
Decimal.cmp(incoming_transaction_gas_usage, 0) == :eq ->
address_to_outcoming_transaction_gas_usage(address.hash)
true ->
incoming_transaction_gas_usage
end
else
address_to_outcoming_transaction_gas_usage(address.hash)

Loading…
Cancel
Save