diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b01347dfa..8cf251d1f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [#5540](https://github.com/blockscout/blockscout/pull/5540) - Tx page: scroll to selected tab's data ### 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 - [#5603](https://github.com/blockscout/blockscout/pull/5603) - Fix failing verification attempts - [#5598](https://github.com/blockscout/blockscout/pull/5598) - Fix token dropdown diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex index f7cf3401e2..b024c102a0 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex @@ -9,7 +9,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do alias BlockScoutWeb.{AccessHelpers, AddressCoinBalanceView, Controller} alias Explorer.{Chain, Market} - alias Explorer.Chain.Address + alias Explorer.Chain.{Address, Wei} alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -84,7 +84,13 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do {:error, :not_found} -> {: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 {:ok, _} -> diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_internal_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_internal_transaction_controller.ex index b037a251cc..a72ba8e256 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_internal_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_internal_transaction_controller.ex @@ -9,7 +9,7 @@ defmodule BlockScoutWeb.AddressInternalTransactionController do alias BlockScoutWeb.{AccessHelpers, Controller, InternalTransactionView} alias Explorer.{Chain, Market} - alias Explorer.Chain.Address + alias Explorer.Chain.{Address, Wei} alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand alias Phoenix.View @@ -94,7 +94,13 @@ defmodule BlockScoutWeb.AddressInternalTransactionController do {:error, :not_found} -> {: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 {:ok, _} -> diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex index fd8765cc25..fed2fe2da8 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex @@ -14,7 +14,8 @@ defmodule BlockScoutWeb.AddressTransactionController do AddressInternalTransactionCsvExporter, AddressLogCsvExporter, AddressTokenTransferCsvExporter, - AddressTransactionCsvExporter + AddressTransactionCsvExporter, + Wei } alias Explorer.ExchangeRates.Token @@ -130,7 +131,13 @@ defmodule BlockScoutWeb.AddressTransactionController do {:error, :not_found} -> {: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 {:ok, _} ->