diff --git a/CHANGELOG.md b/CHANGELOG.md index b920ea53ae..08c226590d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - [#4739](https://github.com/blockscout/blockscout/pull/4739) - Improve logs and inputs decoding - [#4747](https://github.com/blockscout/blockscout/pull/4747) - Advanced CSV export - [#4745](https://github.com/blockscout/blockscout/pull/4745) - Vyper contracts verification -- [#4699](https://github.com/blockscout/blockscout/pull/4699), [#4793](https://github.com/blockscout/blockscout/pull/4793) - Address page facelifting +- [#4699](https://github.com/blockscout/blockscout/pull/4699), [#4793](https://github.com/blockscout/blockscout/pull/4793), [#4820](https://github.com/blockscout/blockscout/pull/4820) - Address page facelifting - [#4667](https://github.com/blockscout/blockscout/pull/4667) - Transaction Page: Add expand/collapse button for long contract method data - [#4641](https://github.com/blockscout/blockscout/pull/4641), [#4733](https://github.com/blockscout/blockscout/pull/4733) - Improve Read Contract page logic - [#4660](https://github.com/blockscout/blockscout/pull/4660) - Save Sourcify path instead of filename diff --git a/apps/block_scout_web/assets/js/pages/address.js b/apps/block_scout_web/assets/js/pages/address.js index ca73e65e1e..62dad38d79 100644 --- a/apps/block_scout_web/assets/js/pages/address.js +++ b/apps/block_scout_web/assets/js/pages/address.js @@ -121,11 +121,6 @@ const elements = { if (oldState.transactionCount === state.transactionCount) return const transactionsDSName = (state.transactionCount > 1) ? ' Transactions' : ' Transaction' $el.empty().append(numeral(state.transactionCount).format() + transactionsDSName) - $el.show() - $('.address-transactions-count-item').removeAttr('style') - } else { - $el.hide() - $('.address-transactions-count-item').css('display', 'none') } } }, @@ -138,11 +133,6 @@ const elements = { if (oldState.tokenTransferCount === state.tokenTransferCount) return const transfersDSName = (state.tokenTransferCount > 1) ? ' Transfers' : ' Transfer' $el.empty().append(numeral(state.tokenTransferCount).format() + transfersDSName) - $el.show() - $('.address-transfers-count-item').removeAttr('style') - } else { - $el.hide() - $('.address-transfers-count-item').css('display', 'none') } } }, @@ -154,11 +144,6 @@ const elements = { if (state.countersFetched && state.gasUsageCount) { if (oldState.gasUsageCount === state.gasUsageCount) return $el.empty().append(numeral(state.gasUsageCount).format()) - $el.show() - $('.address-gas-used-item').removeAttr('style') - } else { - $el.hide() - $('.address-gas-used-item').css('display', 'none') } } }, diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex index 0789f1c112..a4b8073a0d 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex @@ -205,9 +205,11 @@
<%= if @conn.request_path |> String.contains?("/transactions") do %> + 0 <%= gettext("Transactions") %> <% else %> + 0 <%= gettext("Transactions") %> <% end %>
@@ -222,9 +224,11 @@
<%= if @conn.request_path |> String.contains?("/token-transfers") do %> + 0 <%= gettext("Transfers") %> <% else %> + 0 <%= gettext("Transfers") %> <% end %>
@@ -238,6 +242,7 @@
+ 0
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index e388c07a48..9e8597e787 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -398,7 +398,7 @@ msgid "Block number containing the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:249 +#: lib/block_scout_web/templates/address/overview.html.eex:254 msgid "Block number in which the address was updated." msgstr "" @@ -420,7 +420,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:48 -#: lib/block_scout_web/templates/address/overview.html.eex:266 lib/block_scout_web/templates/address_validation/index.html.eex:15 +#: lib/block_scout_web/templates/address/overview.html.eex:271 lib/block_scout_web/templates/address_validation/index.html.eex:15 #: lib/block_scout_web/views/address_view.ex:356 msgid "Blocks Validated" msgstr "" @@ -1176,7 +1176,7 @@ msgid "Gas Price" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:237 +#: lib/block_scout_web/templates/address/overview.html.eex:241 #: lib/block_scout_web/templates/block/_tile.html.eex:73 lib/block_scout_web/templates/block/overview.html.eex:172 msgid "Gas Used" msgstr "" @@ -1187,8 +1187,8 @@ msgid "Gas Used by Transaction" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:236 -#: lib/block_scout_web/templates/address/overview.html.eex:265 +#: lib/block_scout_web/templates/address/overview.html.eex:240 +#: lib/block_scout_web/templates/address/overview.html.eex:270 msgid "Gas used by the address." msgstr "" @@ -1345,7 +1345,7 @@ msgid "JSON RPC error" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:250 +#: lib/block_scout_web/templates/address/overview.html.eex:255 msgid "Last Balance Update" msgstr "" @@ -1647,7 +1647,7 @@ msgid "Number of transactions related to this address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:219 +#: lib/block_scout_web/templates/address/overview.html.eex:221 msgid "Number of transfers to/from this address." msgstr "" @@ -2677,7 +2677,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:7 -#: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address_transaction/index.html.eex:17 +#: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address/overview.html.eex:208 +#: lib/block_scout_web/templates/address/overview.html.eex:212 lib/block_scout_web/templates/address_transaction/index.html.eex:17 #: lib/block_scout_web/templates/block/overview.html.eex:74 lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:41 #: lib/block_scout_web/views/address_view.ex:347 @@ -2695,7 +2696,8 @@ msgid "Transactions sent" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:220 +#: lib/block_scout_web/templates/address/overview.html.eex:222 +#: lib/block_scout_web/templates/address/overview.html.eex:227 lib/block_scout_web/templates/address/overview.html.eex:231 #: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:50 msgid "Transfers" msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index e388c07a48..9e8597e787 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -398,7 +398,7 @@ msgid "Block number containing the transaction." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:249 +#: lib/block_scout_web/templates/address/overview.html.eex:254 msgid "Block number in which the address was updated." msgstr "" @@ -420,7 +420,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:48 -#: lib/block_scout_web/templates/address/overview.html.eex:266 lib/block_scout_web/templates/address_validation/index.html.eex:15 +#: lib/block_scout_web/templates/address/overview.html.eex:271 lib/block_scout_web/templates/address_validation/index.html.eex:15 #: lib/block_scout_web/views/address_view.ex:356 msgid "Blocks Validated" msgstr "" @@ -1176,7 +1176,7 @@ msgid "Gas Price" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:237 +#: lib/block_scout_web/templates/address/overview.html.eex:241 #: lib/block_scout_web/templates/block/_tile.html.eex:73 lib/block_scout_web/templates/block/overview.html.eex:172 msgid "Gas Used" msgstr "" @@ -1187,8 +1187,8 @@ msgid "Gas Used by Transaction" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:236 -#: lib/block_scout_web/templates/address/overview.html.eex:265 +#: lib/block_scout_web/templates/address/overview.html.eex:240 +#: lib/block_scout_web/templates/address/overview.html.eex:270 msgid "Gas used by the address." msgstr "" @@ -1345,7 +1345,7 @@ msgid "JSON RPC error" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:250 +#: lib/block_scout_web/templates/address/overview.html.eex:255 msgid "Last Balance Update" msgstr "" @@ -1647,7 +1647,7 @@ msgid "Number of transactions related to this address." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:219 +#: lib/block_scout_web/templates/address/overview.html.eex:221 msgid "Number of transfers to/from this address." msgstr "" @@ -2677,7 +2677,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address/_tabs.html.eex:7 -#: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address_transaction/index.html.eex:17 +#: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address/overview.html.eex:208 +#: lib/block_scout_web/templates/address/overview.html.eex:212 lib/block_scout_web/templates/address_transaction/index.html.eex:17 #: lib/block_scout_web/templates/block/overview.html.eex:74 lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:41 #: lib/block_scout_web/views/address_view.ex:347 @@ -2695,7 +2696,8 @@ msgid "Transactions sent" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address/overview.html.eex:220 +#: lib/block_scout_web/templates/address/overview.html.eex:222 +#: lib/block_scout_web/templates/address/overview.html.eex:227 lib/block_scout_web/templates/address/overview.html.eex:231 #: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:50 msgid "Transfers" msgstr "" diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs index d02c8a1e4e..77220b26a5 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs @@ -89,7 +89,7 @@ defmodule BlockScoutWeb.AddressControllerTest do "transaction_count" => 0, "token_transfer_count" => 0, "validation_count" => 0, - "gas_usage_count" => 0, + "gas_usage_count" => nil, "crc_total_worth" => "0" } == response diff --git a/apps/explorer/lib/explorer/counters/address_gas_usage_counter.ex b/apps/explorer/lib/explorer/counters/address_gas_usage_counter.ex index d4e40620ca..fbffbe1ccf 100644 --- a/apps/explorer/lib/explorer/counters/address_gas_usage_counter.ex +++ b/apps/explorer/lib/explorer/counters/address_gas_usage_counter.ex @@ -48,9 +48,7 @@ defmodule Explorer.Counters.AddressTransactionsGasUsageCounter do def fetch(address) do if cache_expired?(address) do - Task.start_link(fn -> - update_cache(address) - end) + update_cache(address) end address_hash_string = get_address_hash_string(address) diff --git a/apps/explorer/lib/explorer/counters/address_token_transfers_counter.ex b/apps/explorer/lib/explorer/counters/address_token_transfers_counter.ex index 6968520370..c5488afd99 100644 --- a/apps/explorer/lib/explorer/counters/address_token_transfers_counter.ex +++ b/apps/explorer/lib/explorer/counters/address_token_transfers_counter.ex @@ -48,9 +48,7 @@ defmodule Explorer.Counters.AddressTokenTransfersCounter do def fetch(address) do if cache_expired?(address) do - Task.start_link(fn -> - update_cache(address) - end) + update_cache(address) end address_hash_string = get_address_hash_string(address) diff --git a/apps/explorer/lib/explorer/counters/address_transactions_counter.ex b/apps/explorer/lib/explorer/counters/address_transactions_counter.ex index 2116ec3b4d..ac73176e45 100644 --- a/apps/explorer/lib/explorer/counters/address_transactions_counter.ex +++ b/apps/explorer/lib/explorer/counters/address_transactions_counter.ex @@ -48,9 +48,7 @@ defmodule Explorer.Counters.AddressTransactionsCounter do def fetch(address) do if cache_expired?(address) do - Task.start_link(fn -> - update_cache(address) - end) + update_cache(address) end address_hash_string = get_address_hash_string(address)