Merge pull request #5629 from blockscout/np-fix-empty-coin-balance

Fix empty coin balance for empty address
pull/5612/head
Victor Baranov 3 years ago committed by GitHub
commit d0fa495df0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 10
      apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex
  3. 10
      apps/block_scout_web/lib/block_scout_web/controllers/address_internal_transaction_controller.ex
  4. 11
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex

@ -7,6 +7,7 @@
- [#5540](https://github.com/blockscout/blockscout/pull/5540) - Tx page: scroll to selected tab's data - [#5540](https://github.com/blockscout/blockscout/pull/5540) - Tx page: scroll to selected tab's data
### Fixes ### Fixes
- [#5629](https://github.com/blockscout/blockscout/pull/5629) - Fix empty coin balance for empty address
- [#5626](https://github.com/blockscout/blockscout/pull/5626) - Fix vyper compiler versions order - [#5626](https://github.com/blockscout/blockscout/pull/5626) - Fix vyper compiler versions order
- [#5603](https://github.com/blockscout/blockscout/pull/5603) - Fix failing verification attempts - [#5603](https://github.com/blockscout/blockscout/pull/5603) - Fix failing verification attempts
- [#5598](https://github.com/blockscout/blockscout/pull/5598) - Fix token dropdown - [#5598](https://github.com/blockscout/blockscout/pull/5598) - Fix token dropdown

@ -9,7 +9,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do
alias BlockScoutWeb.{AccessHelpers, AddressCoinBalanceView, Controller} alias BlockScoutWeb.{AccessHelpers, AddressCoinBalanceView, Controller}
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.Chain.Address alias Explorer.Chain.{Address, Wei}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias Indexer.Fetcher.CoinBalanceOnDemand alias Indexer.Fetcher.CoinBalanceOnDemand
alias Phoenix.View alias Phoenix.View
@ -84,7 +84,13 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do
{:error, :not_found} -> {:error, :not_found} ->
{:ok, address_hash} = Chain.string_to_address_hash(address_hash_string) {:ok, address_hash} = Chain.string_to_address_hash(address_hash_string)
address = %Chain.Address{hash: address_hash, smart_contract: nil, token: nil}
address = %Chain.Address{
hash: address_hash,
smart_contract: nil,
token: nil,
fetched_coin_balance: %Wei{value: Decimal.new(0)}
}
case Chain.Hash.Address.validate(address_hash_string) do case Chain.Hash.Address.validate(address_hash_string) do
{:ok, _} -> {:ok, _} ->

@ -9,7 +9,7 @@ defmodule BlockScoutWeb.AddressInternalTransactionController do
alias BlockScoutWeb.{AccessHelpers, Controller, InternalTransactionView} alias BlockScoutWeb.{AccessHelpers, Controller, InternalTransactionView}
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.Chain.Address alias Explorer.Chain.{Address, Wei}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias Indexer.Fetcher.CoinBalanceOnDemand alias Indexer.Fetcher.CoinBalanceOnDemand
alias Phoenix.View alias Phoenix.View
@ -94,7 +94,13 @@ defmodule BlockScoutWeb.AddressInternalTransactionController do
{:error, :not_found} -> {:error, :not_found} ->
{:ok, address_hash} = Chain.string_to_address_hash(address_hash_string) {:ok, address_hash} = Chain.string_to_address_hash(address_hash_string)
address = %Chain.Address{hash: address_hash, smart_contract: nil, token: nil}
address = %Chain.Address{
hash: address_hash,
smart_contract: nil,
token: nil,
fetched_coin_balance: %Wei{value: Decimal.new(0)}
}
case Chain.Hash.Address.validate(address_hash_string) do case Chain.Hash.Address.validate(address_hash_string) do
{:ok, _} -> {:ok, _} ->

@ -14,7 +14,8 @@ defmodule BlockScoutWeb.AddressTransactionController do
AddressInternalTransactionCsvExporter, AddressInternalTransactionCsvExporter,
AddressLogCsvExporter, AddressLogCsvExporter,
AddressTokenTransferCsvExporter, AddressTokenTransferCsvExporter,
AddressTransactionCsvExporter AddressTransactionCsvExporter,
Wei
} }
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
@ -130,7 +131,13 @@ defmodule BlockScoutWeb.AddressTransactionController do
{:error, :not_found} -> {:error, :not_found} ->
{:ok, address_hash} = Chain.string_to_address_hash(address_hash_string) {:ok, address_hash} = Chain.string_to_address_hash(address_hash_string)
address = %Chain.Address{hash: address_hash, smart_contract: nil, token: nil}
address = %Chain.Address{
hash: address_hash,
smart_contract: nil,
token: nil,
fetched_coin_balance: %Wei{value: Decimal.new(0)}
}
case Chain.Hash.Address.validate(address_hash_string) do case Chain.Hash.Address.validate(address_hash_string) do
{:ok, _} -> {:ok, _} ->

Loading…
Cancel
Save