From c6decf337120905518ad09cf4b356cfa45536967 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 27 Mar 2023 17:40:24 +0300 Subject: [PATCH] Refactor runtime config (#7119) * Refactor runtime config * Process reviewer comments * Invalidate GA cache --- .github/workflows/config.yml | 26 +- CHANGELOG.md | 1 + apps/block_scout_web/lib/block_scout_web.ex | 14 +- .../block_scout_web/channels/token_channel.ex | 6 +- .../address_coin_balance_by_day_controller.ex | 4 +- .../address_coin_balance_controller.ex | 6 +- .../address_contract_controller.ex | 4 +- .../controllers/address_controller.ex | 4 +- .../address_decompiled_contract_controller.ex | 4 +- ...address_internal_transaction_controller.ex | 6 +- .../controllers/address_logs_controller.ex | 6 +- .../address_read_contract_controller.ex | 6 +- .../address_read_proxy_controller.ex | 4 +- .../address_token_balance_controller.ex | 4 +- .../controllers/address_token_controller.ex | 6 +- .../address_token_transfer_controller.ex | 10 +- .../address_transaction_controller.ex | 6 +- .../address_validation_controller.ex | 6 +- .../address_write_contract_controller.ex | 6 +- .../address_write_proxy_controller.ex | 4 +- .../controllers/api/eth_rpc/eth_controller.ex | 14 +- .../controllers/api/rpc/address_controller.ex | 6 +- .../api/rpc/contract_controller.ex | 10 +- .../api/rpc/{helpers.ex => helper.ex} | 2 +- .../controllers/api/rpc/rpc_translator.ex | 6 +- .../controllers/api/rpc/token_controller.ex | 4 +- .../controllers/api/v2/address_controller.ex | 30 +- .../api/v2/smart_contract_controller.ex | 18 +- .../controllers/api/v2/token_controller.ex | 18 +- .../api/v2/transaction_controller.ex | 26 +- .../api/v2/verification_controller.ex | 14 +- .../controllers/csv_export_controller.ex | 4 +- .../controllers/tokens/contract_controller.ex | 12 +- .../controllers/tokens/holder_controller.ex | 6 +- .../tokens/inventory_controller.ex | 4 +- .../controllers/tokens/token_controller.ex | 4 +- .../controllers/tokens/transfer_controller.ex | 6 +- .../controllers/transaction_controller.ex | 10 +- ...saction_internal_transaction_controller.ex | 10 +- .../controllers/transaction_log_controller.ex | 10 +- .../transaction_raw_trace_controller.ex | 6 +- .../transaction_state_controller.ex | 10 +- .../transaction_token_transfer_controller.ex | 10 +- .../address/_balance_dropdown.html.eex | 2 +- .../templates/address/_tabs.html.eex | 30 +- .../templates/address/_tile.html.eex | 2 +- .../templates/address/overview.html.eex | 10 +- .../address_coin_balance/index.html.eex | 2 +- .../index.html.eex | 6 +- .../templates/address_token/_tokens.html.eex | 2 +- .../_token_balances.html.eex | 2 +- .../address_token_balance/_tokens.html.eex | 6 +- .../address_token_transfer/index.html.eex | 6 +- .../address_transaction/index.html.eex | 6 +- .../templates/block/_tile.html.eex | 2 +- .../templates/block/overview.html.eex | 2 +- .../templates/chain/_block.html.eex | 2 +- .../internal_transaction/_tile.html.eex | 4 +- .../templates/layout/_search.html.eex | 2 +- .../templates/search/_tile.html.eex | 2 +- .../templates/search/results.html.eex | 2 +- .../templates/tokens/_tile.html.eex | 2 +- .../templates/tokens/index.html.eex | 2 +- .../tokens/overview/_details.html.eex | 10 +- .../templates/tokens/overview/_tabs.html.eex | 14 +- .../_emission_reward_tile.html.eex | 6 +- .../templates/transaction/_tabs.html.eex | 10 +- .../templates/transaction/_tile.html.eex | 6 +- .../transaction/_token_transfer.html.eex | 4 +- .../templates/transaction/overview.html.eex | 2 +- .../{access_helpers.ex => access_helper.ex} | 8 +- .../views/account/watchlist_address_view.ex | 2 +- .../views/address_coin_balance_view.ex | 2 +- .../address_internal_transaction_view.ex | 2 +- .../views/address_token_balance_view.ex | 2 +- .../views/address_token_transfer_view.ex | 2 +- .../views/address_transaction_view.ex | 2 +- .../lib/block_scout_web/views/address_view.ex | 4 +- .../views/api/v2/token_view.ex | 8 +- .../views/api/v2/transaction_view.ex | 4 +- ...currency_helpers.ex => currency_helper.ex} | 4 +- .../{error_helpers.ex => error_helper.ex} | 2 +- .../views/{nft_helpers.ex => nft_helper.ex} | 2 +- .../{render_helpers.ex => render_helper.ex} | 2 +- .../{script_helpers.ex => script_helper.ex} | 4 +- .../views/{tab_helpers.ex => tab_helper.ex} | 10 +- .../views/tokens/{helpers.ex => helper.ex} | 10 +- .../views/tokens/instance/overview_view.ex | 8 +- .../views/tokens/overview_view.ex | 6 +- .../block_scout_web/views/transaction_view.ex | 10 +- .../views/{wei_helpers.ex => wei_helper.ex} | 2 +- apps/block_scout_web/priv/gettext/default.pot | 4 +- .../priv/gettext/en/LC_MESSAGES/default.po | 4 +- .../api/rpc/address_controller_test.exs | 4 +- .../api/rpc/eth_controller_test.exs | 4 +- .../api/v2/stats_controller_test.exs | 4 +- .../transaction_state_controller_test.exs | 2 +- ...pers_test.exs => currency_helper_test.exs} | 28 +- ...helpers_test.exs => error_helper_test.exs} | 14 +- ...t_helpers_test.exs => nft_helper_test.exs} | 10 +- ...elpers_test.exs => render_helper_test.exs} | 8 +- ...b_helpers_test.exs => tab_helper_test.exs} | 22 +- .../{helpers_test.exs => helper_test.exs} | 22 +- .../block_scout_web/views/wei_helper_test.exs | 8 + .../views/wei_helpers_test.exs | 8 - apps/explorer/config/config.exs | 42 +- .../{access_helpers.ex => access_helper.ex} | 4 +- .../account/notifier/forbidden_address.ex | 4 +- apps/explorer/lib/explorer/application.ex | 27 +- apps/explorer/lib/explorer/chain.ex | 6 +- .../explorer/chain/address/coin_balance.ex | 3 +- .../chain/address/coin_balance_daily.ex | 3 +- .../explorer/chain/cache/contracts_counter.ex | 4 +- .../explorer/chain/cache/gas_price_oracle.ex | 30 +- .../lib/explorer/chain/cache/gas_usage.ex | 13 +- .../chain/cache/new_contracts_counter.ex | 4 +- .../cache/new_verified_contracts_counter.ex | 4 +- .../chain/cache/verified_contracts_counter.ex | 4 +- ...currency_helpers.ex => currency_helper.ex} | 2 +- .../explorer/chain_spec/parity/importer.ex | 5 +- .../counters/address_gas_usage_counter.ex | 6 +- .../address_token_transfers_counter.ex | 6 +- .../counters/address_tokens_usd_sum.ex | 6 +- .../counters/address_transactions_counter.ex | 9 +- .../explorer/counters/addresses_counter.ex | 4 +- .../addresses_with_balance_counter.ex | 4 +- .../explorer/counters/average_block_time.ex | 9 +- apps/explorer/lib/explorer/counters/helper.ex | 14 - .../counters/token_holders_counter.ex | 9 +- .../counters/token_transfers_counter.ex | 6 +- ..._helpers.ex => custom_contracts_helper.ex} | 4 +- .../explorer/exchange_rates/exchange_rates.ex | 3 +- apps/explorer/lib/explorer/helper.ex | 11 + apps/explorer/lib/explorer/history/process.ex | 10 +- apps/explorer/lib/explorer/logger.ex | 2 +- .../explorer/market/market_history_cache.ex | 6 +- .../lib/explorer/repo/config_helper.ex | 7 - .../smart_contract/compiler_version.ex | 20 +- .../counters/average_block_time_test.exs | 6 +- .../test/explorer/history/process_test.exs | 8 +- .../block/catchup/missing_ranges_collector.ex | 12 +- .../indexer/fetcher/coin_balance_on_demand.ex | 2 +- .../lib/indexer/fetcher/token_updater.ex | 10 +- .../lib/indexer/fetcher/transaction_action.ex | 12 +- apps/indexer/lib/indexer/logger.ex | 2 +- .../fetcher/coin_balance_on_demand_test.exs | 6 +- config/config_helper.exs | 91 +++ config/runtime.exs | 599 ++++++------------ config/runtime/dev.exs | 14 +- config/runtime/prod.exs | 22 +- docker-compose/envs/common-blockscout.env | 5 +- docker/Makefile | 17 +- 152 files changed, 802 insertions(+), 1052 deletions(-) rename apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/{helpers.ex => helper.ex} (95%) rename apps/block_scout_web/lib/block_scout_web/views/{access_helpers.ex => access_helper.ex} (95%) rename apps/block_scout_web/lib/block_scout_web/views/{currency_helpers.ex => currency_helper.ex} (95%) rename apps/block_scout_web/lib/block_scout_web/views/{error_helpers.ex => error_helper.ex} (97%) rename apps/block_scout_web/lib/block_scout_web/views/{nft_helpers.ex => nft_helper.ex} (98%) rename apps/block_scout_web/lib/block_scout_web/views/{render_helpers.ex => render_helper.ex} (92%) rename apps/block_scout_web/lib/block_scout_web/views/{script_helpers.ex => script_helper.ex} (83%) rename apps/block_scout_web/lib/block_scout_web/views/{tab_helpers.ex => tab_helper.ex} (82%) rename apps/block_scout_web/lib/block_scout_web/views/tokens/{helpers.ex => helper.ex} (91%) rename apps/block_scout_web/lib/block_scout_web/views/{wei_helpers.ex => wei_helper.ex} (98%) rename apps/block_scout_web/test/block_scout_web/views/{currency_helpers_test.exs => currency_helper_test.exs} (61%) rename apps/block_scout_web/test/block_scout_web/views/{error_helpers_test.exs => error_helper_test.exs} (64%) rename apps/block_scout_web/test/block_scout_web/views/{nft_helpers_test.exs => nft_helper_test.exs} (79%) rename apps/block_scout_web/test/block_scout_web/views/{render_helpers_test.exs => render_helper_test.exs} (66%) rename apps/block_scout_web/test/block_scout_web/views/{tab_helpers_test.exs => tab_helper_test.exs} (66%) rename apps/block_scout_web/test/block_scout_web/views/tokens/{helpers_test.exs => helper_test.exs} (73%) create mode 100644 apps/block_scout_web/test/block_scout_web/views/wei_helper_test.exs delete mode 100644 apps/block_scout_web/test/block_scout_web/views/wei_helpers_test.exs rename apps/explorer/lib/explorer/{access_helpers.ex => access_helper.ex} (89%) rename apps/explorer/lib/explorer/chain/{currency_helpers.ex => currency_helper.ex} (89%) rename apps/explorer/lib/explorer/{custom_contracts_helpers.ex => custom_contracts_helper.ex} (84%) create mode 100644 apps/explorer/lib/explorer/helper.ex diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 8c804782d3..a226cebbeb 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -40,7 +40,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps- @@ -100,7 +100,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -124,7 +124,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -147,7 +147,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -187,7 +187,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -213,7 +213,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -242,7 +242,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -287,7 +287,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -333,7 +333,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -392,7 +392,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -448,7 +448,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -515,7 +515,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" @@ -581,7 +581,7 @@ jobs: path: | deps _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_14-${{ hashFiles('mix.lock') }} + key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_15-${{ hashFiles('mix.lock') }} restore-keys: | ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d0441448..cb31ef1e30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - [#7144](https://github.com/blockscout/blockscout/pull/7144) - Update Blockscout logo - [#7136](https://github.com/blockscout/blockscout/pull/7136) - Add release link or commit hash to docker images - [#7097](https://github.com/blockscout/blockscout/pull/7097) - Force display token instance page +- [#7119](https://github.com/blockscout/blockscout/pull/7119) - Refactor runtime config - [#7072](https://github.com/blockscout/blockscout/pull/7072) - Add a separate docker compose for geth with clique consensus - [#7056](https://github.com/blockscout/blockscout/pull/7056) - Add path_helper in interact.js - [#7040](https://github.com/blockscout/blockscout/pull/7040) - Use alias BlockScoutWeb.Cldr.Number diff --git a/apps/block_scout_web/lib/block_scout_web.ex b/apps/block_scout_web/lib/block_scout_web.ex index fddfe7cf35..e996557820 100644 --- a/apps/block_scout_web/lib/block_scout_web.ex +++ b/apps/block_scout_web/lib/block_scout_web.ex @@ -26,7 +26,7 @@ defmodule BlockScoutWeb do import BlockScoutWeb.Router.Helpers import BlockScoutWeb.WebRouter.Helpers, except: [static_path: 2] import BlockScoutWeb.Gettext - import BlockScoutWeb.ErrorHelpers + import BlockScoutWeb.ErrorHelper import Plug.Conn alias BlockScoutWeb.AdminRouter.Helpers, as: AdminRoutes @@ -46,14 +46,14 @@ defmodule BlockScoutWeb do use Phoenix.HTML import BlockScoutWeb.{ - CurrencyHelpers, - ErrorHelpers, + CurrencyHelper, + ErrorHelper, Gettext, Router.Helpers, - TabHelpers, - Tokens.Helpers, - Views.ScriptHelpers, - WeiHelpers + TabHelper, + Tokens.Helper, + Views.ScriptHelper, + WeiHelper } import BlockScoutWeb.WebRouter.Helpers, except: [static_path: 2] diff --git a/apps/block_scout_web/lib/block_scout_web/channels/token_channel.ex b/apps/block_scout_web/lib/block_scout_web/channels/token_channel.ex index 13c2b370b7..fff56d6c09 100644 --- a/apps/block_scout_web/lib/block_scout_web/channels/token_channel.ex +++ b/apps/block_scout_web/lib/block_scout_web/channels/token_channel.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.TokenChannel do """ use BlockScoutWeb, :channel - alias BlockScoutWeb.{CurrencyHelpers, TokensView} + alias BlockScoutWeb.{CurrencyHelper, TokensView} alias BlockScoutWeb.Tokens.TransferView alias Explorer.Chain alias Explorer.Chain.Hash @@ -64,8 +64,8 @@ defmodule BlockScoutWeb.TokenChannel do push(socket, "total_supply", %{ total_supply: if(TokensView.decimals?(token), - do: CurrencyHelpers.format_according_to_decimals(token.total_supply, token.decimals), - else: CurrencyHelpers.format_integer_to_currency(token.total_supply) + do: CurrencyHelper.format_according_to_decimals(token.total_supply, token.decimals), + else: CurrencyHelper.format_integer_to_currency(token.total_supply) ) }) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_by_day_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_by_day_controller.ex index 030f80a88d..10833909ce 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_by_day_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_by_day_controller.ex @@ -5,12 +5,12 @@ defmodule BlockScoutWeb.AddressCoinBalanceByDayController do use BlockScoutWeb, :controller - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.Chain def index(conn, %{"address_id" => address_hash_string, "type" => "JSON"} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do balances_by_day = address_hash |> Chain.address_to_balances_by_day() 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 6f8f220245..cd85a4c716 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 import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, AddressCoinBalanceView, Controller} + alias BlockScoutWeb.{AccessHelper, AddressCoinBalanceView, Controller} alias Explorer.{Chain, Market} alias Explorer.Chain.{Address, Wei} alias Explorer.ExchangeRates.Token @@ -19,7 +19,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do def index(conn, %{"address_id" => address_hash_string, "type" => "JSON"} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), :ok <- Chain.check_address_exists(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do full_options = paging_options(params) coin_balances_plus_one = Chain.address_to_coin_balances(address_hash, full_options) @@ -72,7 +72,7 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render(conn, "index.html", address: address, coin_balance_status: CoinBalanceOnDemand.trigger_fetch(address), diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_controller.ex index c9bd58dbfb..da6e864e69 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_contract_controller.ex @@ -5,7 +5,7 @@ defmodule BlockScoutWeb.AddressContractController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token alias Explorer.SmartContract.Solidity.PublishHelper @@ -23,7 +23,7 @@ defmodule BlockScoutWeb.AddressContractController do ] with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), _ <- PublishHelper.check_and_verify(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, true) do render( diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex index 982ac6128f..4331bdf6be 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex @@ -8,7 +8,7 @@ defmodule BlockScoutWeb.AddressController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] alias BlockScoutWeb.{ - AccessHelpers, + AccessHelper, AddressTransactionController, AddressView, Controller @@ -95,7 +95,7 @@ defmodule BlockScoutWeb.AddressController do def show(conn, %{"id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "_show_address_transactions.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_decompiled_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_decompiled_contract_controller.ex index 968326cbf2..292ea0f929 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_decompiled_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_decompiled_contract_controller.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.AddressDecompiledContractController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand @@ -12,7 +12,7 @@ defmodule BlockScoutWeb.AddressDecompiledContractController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_decompiled_contract_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", 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 bfc8ce84fb..daca356e1f 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 import BlockScoutWeb.Chain, only: [current_filter: 1, paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller, InternalTransactionView} + alias BlockScoutWeb.{AccessHelper, Controller, InternalTransactionView} alias Explorer.{Chain, Market} alias Explorer.Chain.{Address, Wei} alias Explorer.ExchangeRates.Token @@ -20,7 +20,7 @@ defmodule BlockScoutWeb.AddressInternalTransactionController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash, [necessity_by_association: %{:smart_contract => :optional}], false), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do full_options = [ necessity_by_association: %{ @@ -79,7 +79,7 @@ defmodule BlockScoutWeb.AddressInternalTransactionController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex index 742c58cc08..67bbfc5958 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex @@ -9,7 +9,7 @@ defmodule BlockScoutWeb.AddressLogsController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, AddressLogsView, Controller} + alias BlockScoutWeb.{AccessHelper, AddressLogsView, Controller} alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token alias Indexer.Fetcher.CoinBalanceOnDemand @@ -20,7 +20,7 @@ defmodule BlockScoutWeb.AddressLogsController do def index(conn, %{"address_id" => address_hash_string, "type" => "JSON"} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), :ok <- Chain.check_address_exists(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do logs_plus_one = Chain.address_to_logs(address_hash, paging_options(params)) {results, next_page} = split_list_by_page(logs_plus_one) @@ -60,7 +60,7 @@ defmodule BlockScoutWeb.AddressLogsController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex index 2751e69dd0..b963cfa3e4 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex @@ -11,7 +11,7 @@ defmodule BlockScoutWeb.AddressReadContractController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.AddressView alias Explorer.{Chain, Market} alias Explorer.Chain.Address @@ -47,7 +47,7 @@ defmodule BlockScoutWeb.AddressReadContractController do {:ok, address} <- Chain.find_contract_address(address_hash, address_options, true), false <- is_nil(address.smart_contract), need_wallet? <- Reader.read_functions_required_wallet_from_abi(address.smart_contract.abi) != [], - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", @@ -66,7 +66,7 @@ defmodule BlockScoutWeb.AddressReadContractController do if custom_abi? do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, false), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_read_proxy_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_read_proxy_controller.ex index 564655a0c1..6e4534af7c 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_read_proxy_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_read_proxy_controller.ex @@ -5,7 +5,7 @@ defmodule BlockScoutWeb.AddressReadProxyController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.{Chain, Market} alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token @@ -25,7 +25,7 @@ defmodule BlockScoutWeb.AddressReadProxyController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, true), false <- is_nil(address.smart_contract), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex index e5a213ac9b..2013c7bcaa 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex @@ -1,7 +1,7 @@ defmodule BlockScoutWeb.AddressTokenBalanceController do use BlockScoutWeb, :controller - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.Chain alias Explorer.Chain.Address alias Indexer.Fetcher.TokenBalanceOnDemand @@ -17,7 +17,7 @@ defmodule BlockScoutWeb.AddressTokenBalanceController do TokenBalanceOnDemand.trigger_fetch(address_hash, token_balances) end) - case AccessHelpers.restricted_access?(address_hash_string, params) do + case AccessHelper.restricted_access?(address_hash_string, params) do {:ok, false} -> conn |> put_status(200) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex index 5a4add3b75..f896e75e3f 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_controller.ex @@ -5,7 +5,7 @@ defmodule BlockScoutWeb.AddressTokenController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, AddressTokenView, Controller} + alias BlockScoutWeb.{AccessHelper, AddressTokenView, Controller} alias Explorer.{Chain, Market} alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token @@ -15,7 +15,7 @@ defmodule BlockScoutWeb.AddressTokenController do def index(conn, %{"address_id" => address_hash_string, "type" => "JSON"} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash, [], false), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do token_balances_plus_one = address_hash |> Chain.fetch_paginated_last_token_balances(paging_options(params)) @@ -66,7 +66,7 @@ defmodule BlockScoutWeb.AddressTokenController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex index eeebc3236a..dff9c28541 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_transfer_controller.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller, TransactionView} + alias BlockScoutWeb.{AccessHelper, Controller, TransactionView} alias Explorer.ExchangeRates.Token alias Explorer.{Chain, Market} alias Explorer.Chain.Address @@ -45,7 +45,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do {:ok, token_hash} <- Chain.string_to_address_hash(token_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), {:ok, _} <- Chain.token_from_address_hash(token_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do transactions = Chain.address_to_transactions_with_token_transfers( address_hash, @@ -103,7 +103,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do {:ok, token_hash} <- Chain.string_to_address_hash(token_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), {:ok, token} <- Chain.token_from_address_hash(token_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", @@ -136,7 +136,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do ) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do options = @transaction_necessity_by_association |> Keyword.merge(paging_options(params)) @@ -195,7 +195,7 @@ defmodule BlockScoutWeb.AddressTokenTransferController do ) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", 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 679b0f62e9..e22dc29c7b 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 @@ -11,7 +11,7 @@ defmodule BlockScoutWeb.AddressTransactionController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller, TransactionView} + alias BlockScoutWeb.{AccessHelper, Controller, TransactionView} alias Explorer.{Chain, Market} alias Explorer.Chain.{ @@ -48,7 +48,7 @@ defmodule BlockScoutWeb.AddressTransactionController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash, address_options, false), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do options = @transaction_necessity_by_association |> Keyword.merge(paging_options(params)) @@ -117,7 +117,7 @@ defmodule BlockScoutWeb.AddressTransactionController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.hash_to_address(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_validation_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_validation_controller.ex index 3963c26289..a4893bf3ce 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_validation_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_validation_controller.ex @@ -11,7 +11,7 @@ defmodule BlockScoutWeb.AddressValidationController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, BlockView, Controller} + alias BlockScoutWeb.{AccessHelper, BlockView, Controller} alias Explorer.ExchangeRates.Token alias Explorer.{Chain, Market} alias Indexer.Fetcher.CoinBalanceOnDemand @@ -20,7 +20,7 @@ defmodule BlockScoutWeb.AddressValidationController do def index(conn, %{"address_id" => address_hash_string, "type" => "JSON"} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, _} <- Chain.find_or_insert_address_from_hash(address_hash, [], false), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do full_options = Keyword.merge( [ @@ -75,7 +75,7 @@ defmodule BlockScoutWeb.AddressValidationController do def index(conn, %{"address_id" => address_hash_string} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_or_insert_address_from_hash(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_write_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_write_contract_controller.ex index 75e98e7963..cd88e97a0b 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_write_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_write_contract_controller.ex @@ -11,7 +11,7 @@ defmodule BlockScoutWeb.AddressWriteContractController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.AddressView alias Explorer.{Chain, Market} alias Explorer.Chain.Address @@ -42,7 +42,7 @@ defmodule BlockScoutWeb.AddressWriteContractController do {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, true), false <- is_nil(address.smart_contract), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", @@ -60,7 +60,7 @@ defmodule BlockScoutWeb.AddressWriteContractController do if custom_abi? do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, false), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_write_proxy_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_write_proxy_controller.ex index f89aa0552d..844c5d3ddc 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_write_proxy_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_write_proxy_controller.ex @@ -5,7 +5,7 @@ defmodule BlockScoutWeb.AddressWriteProxyController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, AddressView} + alias BlockScoutWeb.{AccessHelper, AddressView} alias Explorer.{Chain, Market} alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token @@ -26,7 +26,7 @@ defmodule BlockScoutWeb.AddressWriteProxyController do {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, true), false <- is_nil(address.smart_contract), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/eth_rpc/eth_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/eth_rpc/eth_controller.ex index 178cb32dbb..2a4287cf98 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/eth_rpc/eth_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/eth_rpc/eth_controller.ex @@ -1,12 +1,12 @@ defmodule BlockScoutWeb.API.EthRPC.EthController do use BlockScoutWeb, :controller - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.API.EthRPC.View, as: EthRPCView alias Explorer.EthRPC def eth_request(%{body_params: %{"_json" => requests}} = conn, _) when is_list(requests) do - case AccessHelpers.check_rate_limit(conn) do + case AccessHelper.check_rate_limit(conn) do :ok -> responses = EthRPC.responses(requests) @@ -16,12 +16,12 @@ defmodule BlockScoutWeb.API.EthRPC.EthController do |> render("responses.json", %{responses: responses}) :rate_limit_reached -> - AccessHelpers.handle_rate_limit_deny(conn) + AccessHelper.handle_rate_limit_deny(conn) end end def eth_request(%{body_params: %{"_json" => request}} = conn, _) do - case AccessHelpers.check_rate_limit(conn) do + case AccessHelper.check_rate_limit(conn) do :ok -> [response] = EthRPC.responses([request]) @@ -31,12 +31,12 @@ defmodule BlockScoutWeb.API.EthRPC.EthController do |> render("response.json", %{response: response}) :rate_limit_reached -> - AccessHelpers.handle_rate_limit_deny(conn) + AccessHelper.handle_rate_limit_deny(conn) end end def eth_request(conn, request) do - case AccessHelpers.check_rate_limit(conn) do + case AccessHelper.check_rate_limit(conn) do :ok -> # In the case that the JSON body is sent up w/o a json content type, # Phoenix encodes it as a single key value pair, with the value being @@ -57,7 +57,7 @@ defmodule BlockScoutWeb.API.EthRPC.EthController do |> render("response.json", %{response: response}) :rate_limit_reached -> - AccessHelpers.handle_rate_limit_deny(conn) + AccessHelper.handle_rate_limit_deny(conn) end end end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/address_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/address_controller.ex index 394c3018e8..e3d33c1419 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/address_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/address_controller.ex @@ -1,7 +1,7 @@ defmodule BlockScoutWeb.API.RPC.AddressController do use BlockScoutWeb, :controller - alias BlockScoutWeb.API.RPC.Helpers + alias BlockScoutWeb.API.RPC.Helper alias Explorer.{Chain, Etherscan} alias Explorer.Chain.{Address, Wei} alias Explorer.Etherscan.{Addresses, Blocks} @@ -221,7 +221,7 @@ defmodule BlockScoutWeb.API.RPC.AddressController do end def getminedblocks(conn, params) do - options = Helpers.put_pagination_options(%{}, params) + options = Helper.put_pagination_options(%{}, params) with {:address_param, {:ok, address_param}} <- fetch_address(params), {:format, {:ok, address_hash}} <- to_address_hash(address_param), @@ -248,7 +248,7 @@ defmodule BlockScoutWeb.API.RPC.AddressController do def optional_params(params) do %{} |> put_order_by_direction(params) - |> Helpers.put_pagination_options(params) + |> Helper.put_pagination_options(params) |> put_block(params, "start_block") |> put_block(params, "end_block") |> put_filter_by(params) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex index 5b07139112..fd80cf7ad7 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex @@ -3,12 +3,12 @@ defmodule BlockScoutWeb.API.RPC.ContractController do require Logger - alias BlockScoutWeb.API.RPC.{AddressController, Helpers} + alias BlockScoutWeb.API.RPC.{AddressController, Helper} alias Explorer.Chain alias Explorer.Chain.{Address, Hash, SmartContract} alias Explorer.Chain.SmartContract.VerificationStatus alias Explorer.Etherscan.Contracts - alias Explorer.SmartContract.Helper + alias Explorer.SmartContract.Helper, as: SmartContractHelper alias Explorer.SmartContract.Solidity.{Publisher, PublishHelper} alias Explorer.SmartContract.Solidity.PublisherWorker, as: SolidityPublisherWorker alias Explorer.SmartContract.Vyper.Publisher, as: VyperPublisher @@ -179,11 +179,11 @@ defmodule BlockScoutWeb.API.RPC.ContractController do jsons = files_array - |> Enum.filter(fn file -> Helper.json_file?(file.filename) end) + |> Enum.filter(fn file -> SmartContractHelper.json_file?(file.filename) end) sols = files_array - |> Enum.filter(fn file -> Helper.sol_file?(file.filename) end) + |> Enum.filter(fn file -> SmartContractHelper.sol_file?(file.filename) end) if length(jsons) > 0 and length(sols) > 0 do {:ok, files_array} @@ -311,7 +311,7 @@ defmodule BlockScoutWeb.API.RPC.ContractController do end def listcontracts(conn, params) do - with pagination_options <- Helpers.put_pagination_options(%{}, params), + with pagination_options <- Helper.put_pagination_options(%{}, params), {:params, {:ok, options}} <- {:params, add_filters(pagination_options, params)} do options_with_defaults = options diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/helpers.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/helper.ex similarity index 95% rename from apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/helpers.ex rename to apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/helper.ex index 1196af9edf..46840eda25 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/helpers.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/helper.ex @@ -1,4 +1,4 @@ -defmodule BlockScoutWeb.API.RPC.Helpers do +defmodule BlockScoutWeb.API.RPC.Helper do @moduledoc """ Small helpers for RPC api controllers. """ diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/rpc_translator.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/rpc_translator.ex index 0da4fd9e71..53a5ec3add 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/rpc_translator.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/rpc_translator.ex @@ -18,7 +18,7 @@ defmodule BlockScoutWeb.API.RPC.RPCTranslator do import Plug.Conn import Phoenix.Controller, only: [put_view: 2] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.API.APILogger alias BlockScoutWeb.API.RPC.RPCView alias Phoenix.Controller @@ -33,7 +33,7 @@ defmodule BlockScoutWeb.API.RPC.RPCTranslator do {:ok, {controller, write_actions}} <- translate_module(translations, module), {:ok, action} <- translate_action(action), true <- action_accessed?(action, write_actions), - :ok <- AccessHelpers.check_rate_limit(conn), + :ok <- AccessHelper.check_rate_limit(conn), {:ok, conn} <- call_controller(conn, controller, action) do conn else @@ -56,7 +56,7 @@ defmodule BlockScoutWeb.API.RPC.RPCTranslator do |> halt() :rate_limit_reached -> - AccessHelpers.handle_rate_limit_deny(conn) + AccessHelper.handle_rate_limit_deny(conn) _ -> conn diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/token_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/token_controller.ex index 59ba120d45..3392fb5505 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/token_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/token_controller.ex @@ -1,7 +1,7 @@ defmodule BlockScoutWeb.API.RPC.TokenController do use BlockScoutWeb, :controller - alias BlockScoutWeb.API.RPC.Helpers + alias BlockScoutWeb.API.RPC.Helper alias Explorer.{Chain, PagingOptions} def gettoken(conn, params) do @@ -22,7 +22,7 @@ defmodule BlockScoutWeb.API.RPC.TokenController do end def gettokenholders(conn, params) do - with pagination_options <- Helpers.put_pagination_options(%{}, params), + with pagination_options <- Helper.put_pagination_options(%{}, params), {:contractaddress_param, {:ok, contractaddress_param}} <- fetch_contractaddress(params), {:format, {:ok, address_hash}} <- to_address_hash(contractaddress_param) do options_with_defaults = diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex index 8cbc15620e..ab29da2107 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex @@ -13,7 +13,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do import BlockScoutWeb.PagingHelper, only: [delete_parameters_from_next_page_params: 1, token_transfers_types_options: 1] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.API.V2.{BlockView, TransactionView} alias Explorer.ExchangeRates.Token alias Explorer.{Chain, Market} @@ -59,7 +59,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def address(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, address}} <- {:not_found, Chain.hash_to_address(address_hash, @address_options)} do CoinBalanceOnDemand.trigger_fetch(address) @@ -71,7 +71,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def counters(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do {validation_count} = Chain.address_counters(address, @api_true) @@ -90,7 +90,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def token_balances(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do token_balances = address_hash @@ -108,7 +108,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def transactions(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do options = @transaction_necessity_by_association @@ -134,8 +134,8 @@ defmodule BlockScoutWeb.API.V2.AddressController do ) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, {:format, {:ok, token_address_hash}} <- {:format, Chain.string_to_address_hash(token_address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), - {:ok, false} <- AccessHelpers.restricted_access?(token_address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(token_address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)}, {:not_found, {:ok, _}} <- {:not_found, Chain.token_from_address_hash(token_address_hash, @api_true)} do paging_options = paging_options(params) @@ -178,7 +178,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def token_transfers(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do paging_options = paging_options(params) @@ -210,7 +210,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def internal_transactions(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do full_options = [ @@ -245,7 +245,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def logs(conn, %{"address_hash" => address_hash_string, "topic" => topic} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do prepared_topic = String.trim(topic) @@ -268,7 +268,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def logs(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do options = params |> paging_options() |> Keyword.merge(@api_true) @@ -287,7 +287,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def blocks_validated(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do full_options = [ @@ -315,7 +315,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def coin_balance_history(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do full_options = params |> paging_options() |> Keyword.merge(@api_true) @@ -334,7 +334,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def coin_balance_history_by_day(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do balances_by_day = address_hash @@ -348,7 +348,7 @@ defmodule BlockScoutWeb.API.V2.AddressController do def tokens(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _address}} <- {:not_found, Chain.hash_to_address(address_hash, @api_true, false)} do results_plus_one = address_hash diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/smart_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/smart_contract_controller.ex index 05a1b23122..dc294bed73 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/smart_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/smart_contract_controller.ex @@ -8,7 +8,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do import Explorer.SmartContract.Solidity.Verifier, only: [parse_boolean: 1] - alias BlockScoutWeb.{AccessHelpers, AddressView} + alias BlockScoutWeb.{AccessHelper, AddressView} alias Ecto.Association.NotLoaded alias Explorer.Chain alias Explorer.Chain.SmartContract @@ -32,7 +32,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do def smart_contract(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), _ <- PublishHelper.check_and_verify(address_hash_string), {:not_found, {:ok, address}} <- {:not_found, Chain.find_contract_address(address_hash, @smart_contract_address_options, true)} do @@ -44,7 +44,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do def methods_read(conn, %{"address_hash" => address_hash_string, "is_custom_abi" => "true"} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), custom_abi <- AddressView.fetch_custom_abi(conn, address_hash_string), {:not_found, true} <- {:not_found, AddressView.check_custom_abi_for_having_read_functions(custom_abi)} do read_only_functions_from_abi = @@ -60,7 +60,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do def methods_read(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), smart_contract <- Chain.address_hash_to_smart_contract(address_hash, @api_true), {:not_found, false} <- {:not_found, is_nil(smart_contract)} do read_only_functions_from_abi = Reader.read_only_functions(smart_contract, address_hash, params["from"]) @@ -77,7 +77,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do with {:contract_interaction_disabled, false} <- {:contract_interaction_disabled, AddressView.contract_interaction_disabled?()}, {:format, {:ok, _address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), custom_abi <- AddressView.fetch_custom_abi(conn, address_hash_string), {:not_found, true} <- {:not_found, AddressView.check_custom_abi_for_having_write_functions(custom_abi)} do conn @@ -90,7 +90,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do with {:contract_interaction_disabled, false} <- {:contract_interaction_disabled, AddressView.contract_interaction_disabled?()}, {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), smart_contract <- Chain.address_hash_to_smart_contract(address_hash, @api_true), {:not_found, false} <- {:not_found, is_nil(smart_contract)} do conn @@ -101,7 +101,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do def methods_read_proxy(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, address}} <- {:not_found, Chain.find_contract_address(address_hash, @smart_contract_address_options)}, {:not_found, false} <- {:not_found, is_nil(address.smart_contract)} do @@ -123,7 +123,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do with {:contract_interaction_disabled, false} <- {:contract_interaction_disabled, AddressView.contract_interaction_disabled?()}, {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, address}} <- {:not_found, Chain.find_contract_address(address_hash, @smart_contract_address_options)}, {:not_found, false} <- {:not_found, is_nil(address.smart_contract)} do @@ -149,7 +149,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractController do contract_type = if type == "proxy", do: :proxy, else: :regular with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, address}} <- {:not_found, Chain.find_contract_address(address_hash, diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/token_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/token_controller.ex index 1e54ca5827..bee9dd44a4 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/token_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/token_controller.ex @@ -1,7 +1,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do use BlockScoutWeb, :controller - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.API.V2.TransactionView alias Explorer.Chain alias Indexer.Fetcher.TokenTotalSupplyOnDemand @@ -25,7 +25,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def token(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, token}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)} do TokenTotalSupplyOnDemand.trigger_fetch(address_hash) @@ -37,7 +37,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def counters(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)} do {transfer_count, token_holder_count} = Chain.fetch_token_counters(address_hash, 30_000) @@ -47,7 +47,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def transfers(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, _}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)} do paging_options = paging_options(params) @@ -73,7 +73,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def holders(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, token}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)} do results_plus_one = Chain.fetch_token_holders_from_token_hash(address_hash, Keyword.merge(paging_options(params), @api_true)) @@ -91,7 +91,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def instances(conn, %{"address_hash" => address_hash_string} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, token}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)} do results_plus_one = Chain.address_to_unique_tokens( @@ -112,7 +112,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def instance(conn, %{"address_hash" => address_hash_string, "token_id" => token_id_str} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, token}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)}, {:not_found, false} <- {:not_found, Chain.is_erc_20_token?(token)}, {:format, {token_id, ""}} <- {:format, Integer.parse(token_id_str)} do @@ -133,7 +133,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def transfers_by_instance(conn, %{"address_hash" => address_hash_string, "token_id" => token_id_str} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, token}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)}, {:not_found, false} <- {:not_found, Chain.is_erc_20_token?(token)}, {:format, {token_id, ""}} <- {:format, Integer.parse(token_id_str)} do @@ -161,7 +161,7 @@ defmodule BlockScoutWeb.API.V2.TokenController do def transfers_count_by_instance(conn, %{"address_hash" => address_hash_string, "token_id" => token_id_str} = params) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:not_found, {:ok, token}} <- {:not_found, Chain.token_from_address_hash(address_hash, @api_true)}, {:not_found, false} <- {:not_found, Chain.is_erc_20_token?(token)}, {:format, {token_id, ""}} <- {:format, Integer.parse(token_id_str)} do diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/transaction_controller.ex index 5cb7e8a262..986c8196a3 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/transaction_controller.ex @@ -14,7 +14,7 @@ defmodule BlockScoutWeb.API.V2.TransactionController do type_filter_options: 1 ] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.Models.TransactionStateHelper alias Explorer.Chain alias Indexer.Fetcher.FirstTraceOnDemand @@ -72,8 +72,8 @@ defmodule BlockScoutWeb.API.V2.TransactionController do necessity_by_association: Map.put(@transaction_necessity_by_association, :transaction_actions, :optional), api?: true )}, - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params), preloaded <- Chain.preload_token_transfers(transaction, @token_transfers_in_tx_necessity_by_association, @api_true, false) do conn @@ -109,8 +109,8 @@ defmodule BlockScoutWeb.API.V2.TransactionController do with {:format, {:ok, transaction_hash}} <- {:format, Chain.string_to_transaction_hash(transaction_hash_string)}, {:not_found, {:ok, transaction}} <- {:not_found, Chain.hash_to_transaction(transaction_hash, @api_true)}, - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do if is_nil(transaction.block_number) do conn |> put_status(200) @@ -138,8 +138,8 @@ defmodule BlockScoutWeb.API.V2.TransactionController do with {:format, {:ok, transaction_hash}} <- {:format, Chain.string_to_transaction_hash(transaction_hash_string)}, {:not_found, {:ok, transaction}} <- {:not_found, Chain.hash_to_transaction(transaction_hash, @api_true)}, - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do paging_options = paging_options(params) full_options = @@ -171,8 +171,8 @@ defmodule BlockScoutWeb.API.V2.TransactionController do with {:format, {:ok, transaction_hash}} <- {:format, Chain.string_to_transaction_hash(transaction_hash_string)}, {:not_found, {:ok, transaction}} <- {:not_found, Chain.hash_to_transaction(transaction_hash, @api_true)}, - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do full_options = @internal_transaction_necessity_by_association |> Keyword.merge(paging_options(params)) @@ -200,8 +200,8 @@ defmodule BlockScoutWeb.API.V2.TransactionController do with {:format, {:ok, transaction_hash}} <- {:format, Chain.string_to_transaction_hash(transaction_hash_string)}, {:not_found, {:ok, transaction}} <- {:not_found, Chain.hash_to_transaction(transaction_hash, @api_true)}, - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do full_options = [ necessity_by_association: %{ @@ -241,8 +241,8 @@ defmodule BlockScoutWeb.API.V2.TransactionController do Map.merge(@transaction_necessity_by_association, %{[block: [miner: :names]] => :optional}), api?: true )}, - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do state_changes = TransactionStateHelper.state_changes(transaction) conn diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/verification_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/verification_controller.ex index e55df4c14e..60ee9fbc13 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/verification_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/api/v2/verification_controller.ex @@ -3,7 +3,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do import Explorer.SmartContract.Solidity.Verifier, only: [parse_boolean: 1] - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.API.V2.ApiView alias Explorer.Chain alias Explorer.SmartContract.Solidity.PublisherWorker, as: SolidityPublisherWorker @@ -46,7 +46,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do params ) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:already_verified, false} <- {:already_verified, Chain.smart_contract_fully_verified?(address_hash, @api_true)} do verification_params = @@ -81,7 +81,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do %{"address_hash" => address_hash_string, "files" => files, "compiler_version" => compiler_version} = params ) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:already_verified, false} <- {:already_verified, Chain.smart_contract_fully_verified?(address_hash, @api_true)}, files_array <- PublishHelper.prepare_files_array(files), @@ -109,7 +109,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do with {:not_found, true} <- {:not_found, Application.get_env(:explorer, Explorer.ThirdPartyIntegrations.Sourcify)[:enabled]}, {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:already_verified, false} <- {:already_verified, Chain.smart_contract_fully_verified?(address_hash, @api_true)}, files_array <- PublishHelper.prepare_files_array(files), @@ -135,7 +135,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do ) do with {:not_found, true} <- {:not_found, RustVerifierInterface.enabled?()}, {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:already_verified, false} <- {:already_verified, Chain.smart_contract_fully_verified?(address_hash, @api_true)}, libraries <- Map.get(params, "libraries", "{}"), @@ -172,7 +172,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do params ) do with {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:already_verified, false} <- {:already_verified, Chain.smart_contract_fully_verified?(address_hash, @api_true)} do verification_params = @@ -199,7 +199,7 @@ defmodule BlockScoutWeb.API.V2.VerificationController do ) do with {:not_found, true} <- {:not_found, RustVerifierInterface.enabled?()}, {:format, {:ok, address_hash}} <- {:format, Chain.string_to_address_hash(address_hash_string)}, - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), {:already_verified, false} <- {:already_verified, Chain.smart_contract_fully_verified?(address_hash, @api_true)} do verification_params = diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/csv_export_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/csv_export_controller.ex index 8cab1d2405..08f05ba937 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/csv_export_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/csv_export_controller.ex @@ -1,13 +1,13 @@ defmodule BlockScoutWeb.CsvExportController do use BlockScoutWeb, :controller - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.Chain def index(conn, %{"address" => address_hash_string, "type" => type} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), :ok <- Chain.check_address_exists(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params), + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params), true <- supported_export_type(type) do render(conn, "index.html", address_hash_string: address_hash_string, type: type) else diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/contract_controller.ex index 400b6dfc17..f792297e3a 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/contract_controller.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.Tokens.ContractController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, TabHelpers} + alias BlockScoutWeb.{AccessHelper, TabHelper} alias Explorer.Chain alias Explorer.Chain.Address @@ -14,19 +14,19 @@ defmodule BlockScoutWeb.Tokens.ContractController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), :ok <- Chain.check_verified_smart_contract_exists(address_hash), {:ok, token} <- Chain.token_from_address_hash(address_hash, options), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do %{type: type, action: action} = cond do - TabHelpers.tab_active?("read-contract", conn.request_path) -> + TabHelper.tab_active?("read-contract", conn.request_path) -> %{type: :regular, action: :read} - TabHelpers.tab_active?("write-contract", conn.request_path) -> + TabHelper.tab_active?("write-contract", conn.request_path) -> %{type: :regular, action: :write} - TabHelpers.tab_active?("read-proxy", conn.request_path) -> + TabHelper.tab_active?("read-proxy", conn.request_path) -> %{type: :proxy, action: :read} - TabHelpers.tab_active?("write-proxy", conn.request_path) -> + TabHelper.tab_active?("write-proxy", conn.request_path) -> %{type: :proxy, action: :write} end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/holder_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/holder_controller.ex index d7529227e2..6a61ff30e5 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/holder_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/holder_controller.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.Tokens.HolderController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller} + alias BlockScoutWeb.{AccessHelper, Controller} alias BlockScoutWeb.Tokens.HolderView alias Explorer.Chain alias Explorer.Chain.Address @@ -22,7 +22,7 @@ defmodule BlockScoutWeb.Tokens.HolderController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, token} <- Chain.token_from_address_hash(address_hash), token_balances <- Chain.fetch_token_holders_from_token_hash(address_hash, paging_options(params)), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do {token_balances_paginated, next_page} = split_list_by_page(token_balances) next_page_path = @@ -62,7 +62,7 @@ defmodule BlockScoutWeb.Tokens.HolderController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, token} <- Chain.token_from_address_hash(address_hash, options), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/inventory_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/inventory_controller.ex index 7b2a6cc6ad..2d09db0845 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/inventory_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/inventory_controller.ex @@ -1,7 +1,7 @@ defmodule BlockScoutWeb.Tokens.InventoryController do use BlockScoutWeb, :controller - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias BlockScoutWeb.Tokens.{HolderController, InventoryView} alias Explorer.Chain alias Phoenix.View @@ -16,7 +16,7 @@ defmodule BlockScoutWeb.Tokens.InventoryController do def index(conn, %{"token_id" => address_hash_string, "type" => "JSON"} = params) do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, token} <- Chain.token_from_address_hash(address_hash), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do unique_token_instances = Chain.address_to_unique_tokens( token.contract_address_hash, diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/token_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/token_controller.ex index 73739141e7..a9f5c60d8a 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/token_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/token_controller.ex @@ -3,11 +3,11 @@ defmodule BlockScoutWeb.Tokens.TokenController do require Logger - alias BlockScoutWeb.AccessHelpers + alias BlockScoutWeb.AccessHelper alias Explorer.Chain def show(conn, %{"id" => address_hash_string}) do - redirect(conn, to: AccessHelpers.get_path(conn, :token_transfer_path, :index, address_hash_string)) + redirect(conn, to: AccessHelper.get_path(conn, :token_transfer_path, :index, address_hash_string)) end def token_counters(conn, %{"id" => address_hash_string}) do diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/transfer_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/transfer_controller.ex index 8fd4864162..a349af1474 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/tokens/transfer_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/tokens/transfer_controller.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.Tokens.TransferController do import BlockScoutWeb.Account.AuthController, only: [current_user: 1] import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller} + alias BlockScoutWeb.{AccessHelper, Controller} alias BlockScoutWeb.Tokens.TransferView alias Explorer.Chain alias Explorer.Chain.Address @@ -20,7 +20,7 @@ defmodule BlockScoutWeb.Tokens.TransferController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, token} <- Chain.token_from_address_hash(address_hash), token_transfers <- Chain.fetch_token_transfers_from_token_hash(address_hash, paging_options(params)), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do {token_transfers_paginated, next_page} = split_list_by_page(token_transfers) next_page_path = @@ -67,7 +67,7 @@ defmodule BlockScoutWeb.Tokens.TransferController do with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, token} <- Chain.token_from_address_hash(address_hash, options), - {:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do + {:ok, false} <- AccessHelper.restricted_access?(address_hash_string, params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex index 83818de3b5..9158d1ca85 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex @@ -16,7 +16,7 @@ defmodule BlockScoutWeb.TransactionController do import BlockScoutWeb.Models.GetTransactionTags, only: [get_transaction_with_addresses_tags: 2] alias BlockScoutWeb.{ - AccessHelpers, + AccessHelper, Controller, TransactionInternalTransactionController, TransactionTokenTransferController, @@ -156,8 +156,8 @@ defmodule BlockScoutWeb.TransactionController do transaction_hash, necessity_by_association: @necessity_by_association ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do render( conn, "show_token_transfers.html", @@ -194,8 +194,8 @@ defmodule BlockScoutWeb.TransactionController do transaction_hash, necessity_by_association: @necessity_by_association ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do render( conn, "show_internal_transactions.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex index 155e95d2d7..9f2b6c8fac 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex @@ -6,7 +6,7 @@ defmodule BlockScoutWeb.TransactionInternalTransactionController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] import BlockScoutWeb.Models.GetTransactionTags, only: [get_transaction_with_addresses_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller, InternalTransactionView, TransactionController} + alias BlockScoutWeb.{AccessHelper, Controller, InternalTransactionView, TransactionController} alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token alias Phoenix.View @@ -15,8 +15,8 @@ defmodule BlockScoutWeb.TransactionInternalTransactionController do with {:ok, transaction_hash} <- Chain.string_to_transaction_hash(transaction_hash_string), :ok <- Chain.check_transaction_exists(transaction_hash), {:ok, transaction} <- Chain.hash_to_transaction(transaction_hash, []), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do full_options = Keyword.merge( [ @@ -97,8 +97,8 @@ defmodule BlockScoutWeb.TransactionInternalTransactionController do :token_transfers => :optional } ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_log_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_log_controller.ex index 1da5c204ad..70cb686bad 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_log_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_log_controller.ex @@ -6,7 +6,7 @@ defmodule BlockScoutWeb.TransactionLogController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] import BlockScoutWeb.Models.GetTransactionTags, only: [get_transaction_with_addresses_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller, TransactionController, TransactionLogView} + alias BlockScoutWeb.{AccessHelper, Controller, TransactionController, TransactionLogView} alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token alias Phoenix.View @@ -17,8 +17,8 @@ defmodule BlockScoutWeb.TransactionLogController do Chain.hash_to_transaction(transaction_hash, necessity_by_association: %{[to_address: :smart_contract] => :optional} ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do full_options = Keyword.merge( [ @@ -89,8 +89,8 @@ defmodule BlockScoutWeb.TransactionLogController do :token_transfers => :optional } ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex index 234d12e89e..0fa47a09f2 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex @@ -5,7 +5,7 @@ defmodule BlockScoutWeb.TransactionRawTraceController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] import BlockScoutWeb.Models.GetTransactionTags, only: [get_transaction_with_addresses_tags: 2] - alias BlockScoutWeb.{AccessHelpers, TransactionController} + alias BlockScoutWeb.{AccessHelper, TransactionController} alias EthereumJSONRPC alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token @@ -25,8 +25,8 @@ defmodule BlockScoutWeb.TransactionRawTraceController do :token_transfers => :optional } ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do if is_nil(transaction.block_number) do render_raw_trace(conn, [], transaction, hash) else diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_state_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_state_controller.ex index b28a24296a..9ebcc0751f 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_state_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_state_controller.ex @@ -2,7 +2,7 @@ defmodule BlockScoutWeb.TransactionStateController do use BlockScoutWeb, :controller alias BlockScoutWeb.{ - AccessHelpers, + AccessHelper, Controller, Models.TransactionStateHelper, TransactionController, @@ -33,9 +33,9 @@ defmodule BlockScoutWeb.TransactionStateController do } ), {:ok, false} <- - AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), + AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), {:ok, false} <- - AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do state_changes = TransactionStateHelper.state_changes(transaction) rendered_changes = @@ -87,9 +87,9 @@ defmodule BlockScoutWeb.TransactionStateController do } ), {:ok, false} <- - AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), + AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), {:ok, false} <- - AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_token_transfer_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_token_transfer_controller.ex index d391ed5d13..e2fdffb4ed 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_token_transfer_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_token_transfer_controller.ex @@ -6,7 +6,7 @@ defmodule BlockScoutWeb.TransactionTokenTransferController do import BlockScoutWeb.Models.GetAddressTags, only: [get_address_tags: 2] import BlockScoutWeb.Models.GetTransactionTags, only: [get_transaction_with_addresses_tags: 2] - alias BlockScoutWeb.{AccessHelpers, Controller, TransactionController, TransactionTokenTransferView} + alias BlockScoutWeb.{AccessHelper, Controller, TransactionController, TransactionTokenTransferView} alias Explorer.{Chain, Market} alias Explorer.ExchangeRates.Token alias Phoenix.View @@ -22,8 +22,8 @@ defmodule BlockScoutWeb.TransactionTokenTransferController do transaction_hash, [] ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do full_options = Keyword.merge( [ @@ -100,8 +100,8 @@ defmodule BlockScoutWeb.TransactionTokenTransferController do :token_transfers => :optional } ), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.from_address_hash), params), - {:ok, false} <- AccessHelpers.restricted_access?(to_string(transaction.to_address_hash), params) do + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.from_address_hash), params), + {:ok, false} <- AccessHelper.restricted_access?(to_string(transaction.to_address_hash), params) do render( conn, "index.html", diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_dropdown.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_dropdown.html.eex index e590b9f24e..a802313c1e 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_dropdown.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_dropdown.html.eex @@ -1,7 +1,7 @@
<%= render BlockScoutWeb.CommonComponentsView, "_loading_spinner.html", loading_text: gettext("Fetching tokens...") %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_tabs.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_tabs.html.eex index ce533de13a..2a29f0de4c 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_tabs.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_tabs.html.eex @@ -1,26 +1,26 @@ -<% dark_forest_addresses_list_0_4 = CustomContractsHelpers.get_custom_addresses_list(:dark_forest_addresses) %> -<% dark_forest_addresses_list_0_5 = CustomContractsHelpers.get_custom_addresses_list(:dark_forest_addresses_v_0_5) %> +<% dark_forest_addresses_list_0_4 = CustomContractsHelper.get_custom_addresses_list(:dark_forest_addresses) %> +<% dark_forest_addresses_list_0_5 = CustomContractsHelper.get_custom_addresses_list(:dark_forest_addresses_v_0_5) %> <% dark_forest_addresses_list = dark_forest_addresses_list_0_4 ++ dark_forest_addresses_list_0_5 %> <% current_address = "0x" <> Base.encode16(@address.hash.bytes, case: :lower) %>
<%= link( gettext("Transactions"), class: "card-tab #{tab_status("transactions", @conn.request_path)}", - to: AccessHelpers.get_path(@conn, :address_transaction_path, :index, @address.hash) + to: AccessHelper.get_path(@conn, :address_transaction_path, :index, @address.hash) ) %> <%= if Chain.check_if_token_transfers_at_address(@address.hash) do %> <%= link( gettext("Token Transfers"), class: "card-tab #{tab_status("token-transfers", @conn.request_path)}", "data-test": "token_transfers_tab_link", - to: AccessHelpers.get_path(@conn, :address_token_transfers_path, :index, @address.hash) + to: AccessHelper.get_path(@conn, :address_token_transfers_path, :index, @address.hash) ) %> <% end %> <%= if Chain.check_if_tokens_at_address(@address.hash) do %> <%= link( gettext("Tokens"), class: "card-tab #{tab_status("tokens", @conn.request_path)}", - to: AccessHelpers.get_path(@conn, :address_token_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_token_path, :index, @address.hash), "data-test": "tokens_tab_link" ) %> <% end %> @@ -28,19 +28,19 @@ gettext("Internal Transactions"), class: "card-tab #{tab_status("internal-transactions", @conn.request_path)}", "data-test": "internal_transactions_tab_link", - to: AccessHelpers.get_path(@conn, :address_internal_transaction_path, :index, @address.hash) + to: AccessHelper.get_path(@conn, :address_internal_transaction_path, :index, @address.hash) ) %> <%= link( gettext("Coin Balance History"), class: "card-tab #{tab_status("coin-balances", @conn.request_path)}", "data-test": "coin_balance_tab_link", - to: AccessHelpers.get_path(@conn, :address_coin_balance_path, :index, @address.hash) + to: AccessHelper.get_path(@conn, :address_coin_balance_path, :index, @address.hash) ) %> <%= if Chain.check_if_logs_at_address(@address.hash) do %> <%= link( gettext("Logs"), class: "card-tab #{tab_status("logs", @conn.request_path)}", - to: AccessHelpers.get_path(@conn, :address_logs_path, :index, @address.hash) + to: AccessHelper.get_path(@conn, :address_logs_path, :index, @address.hash) ) %> <% end %> <%= if Chain.check_if_validated_blocks_at_address(@address.hash) do %> @@ -48,12 +48,12 @@ gettext("Blocks Validated"), class: "card-tab #{tab_status("validations", @conn.request_path)}", "data-test": "validations_tab_link", - to: AccessHelpers.get_path(@conn, :address_validation_path, :index, @address.hash) + to: AccessHelper.get_path(@conn, :address_validation_path, :index, @address.hash) ) %> <% end %> <%= if contract?(@address) do %> <%= link( - to: AccessHelpers.get_path(@conn, :address_contract_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_contract_path, :index, @address.hash), class: "card-tab #{tab_status("contracts", @conn.request_path)}") do %> <%= gettext("Code") %> <%= if smart_contract_verified?(@address) do %> @@ -70,7 +70,7 @@ <% end %> <%= if has_decompiled_code?(@address) do %> <%= link( - to: AccessHelpers.get_path(@conn, :address_decompiled_contract_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_decompiled_contract_path, :index, @address.hash), class: "card-tab #{tab_status("decompiled-contracts", @conn.request_path)}") do %> <%= gettext("Decompiled code") %> @@ -79,28 +79,28 @@ <%= if smart_contract_with_read_only_functions?(@address) || has_address_custom_abi_with_read_functions?(@conn, @address.hash) do %> <%= link( gettext("Read Contract"), - to: AccessHelpers.get_path(@conn, :address_read_contract_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_read_contract_path, :index, @address.hash), class: "card-tab #{tab_status("read-contract", @conn.request_path)}") %> <% end %> <%= if @is_proxy do %> <%= link( gettext("Read Proxy"), - to: AccessHelpers.get_path(@conn, :address_read_proxy_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_read_proxy_path, :index, @address.hash), class: "card-tab #{tab_status("read-proxy", @conn.request_path)}") %> <% end %> <%= if smart_contract_with_write_functions?(@address) || has_address_custom_abi_with_write_functions?(@conn, @address.hash) do %> <%= link( gettext("Write Contract"), - to: AccessHelpers.get_path(@conn, :address_write_contract_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_write_contract_path, :index, @address.hash), class: "card-tab #{tab_status("write-contract", @conn.request_path)}") %> <% end %> <%= if smart_contract_with_write_functions?(@address) && @is_proxy do %> <%= link( gettext("Write Proxy"), - to: AccessHelpers.get_path(@conn, :address_write_proxy_path, :index, @address.hash), + to: AccessHelper.get_path(@conn, :address_write_proxy_path, :index, @address.hash), class: "card-tab #{tab_status("write-proxy", @conn.request_path)}") %> <% end %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex index 9e91a5a75e..368aa9f91e 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex @@ -6,7 +6,7 @@ - <%= @address |> BlockScoutWeb.AddressView.address_partial_selector(nil, nil) |> BlockScoutWeb.RenderHelpers.render_partial() %> + <%= @address |> BlockScoutWeb.AddressView.address_partial_selector(nil, nil) |> BlockScoutWeb.RenderHelper.render_partial() %> <%= balance(@address) %> 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 9a8abc9dd7..2b8ba6e6aa 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 @@ -1,8 +1,8 @@
<%= render BlockScoutWeb.Advertisement.TextAdView, "index.html", conn: @conn %> - <% dark_forest_addresses_list_0_4 = CustomContractsHelpers.get_custom_addresses_list(:dark_forest_addresses) %> - <% dark_forest_addresses_list_0_5 = CustomContractsHelpers.get_custom_addresses_list(:dark_forest_addresses_v_0_5) %> - <% circles_addresses_list = CustomContractsHelpers.get_custom_addresses_list(:circles_addresses) %> + <% dark_forest_addresses_list_0_4 = CustomContractsHelper.get_custom_addresses_list(:dark_forest_addresses) %> + <% dark_forest_addresses_list_0_5 = CustomContractsHelper.get_custom_addresses_list(:dark_forest_addresses_v_0_5) %> + <% circles_addresses_list = CustomContractsHelper.get_custom_addresses_list(:circles_addresses) %> <% current_address = "0x" <> Base.encode16(@address.hash.bytes, case: :lower) %> <% created_from_address_hash = if from_address_hash(@address), do: "0x" <> Base.encode16(from_address_hash(@address).bytes, case: :lower), else: nil %>
@@ -195,7 +195,7 @@ <% end %> <% else %> - + <%= if @address.token_transfers_count do %> <%= Number.Delimit.number_to_delimited(@address.transactions_count, precision: 0) %> <%= gettext("Transactions") %> <% else %> @@ -222,7 +222,7 @@ <% end %> <% else %> - + <%= if @address.token_transfers_count do %> <%= Number.Delimit.number_to_delimited(@address.token_transfers_count, precision: 0) %> <%= gettext("Transfers") %> <% else %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex index 9292206e04..268b148cdb 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex @@ -21,7 +21,7 @@ <%= gettext("There was a problem loading the chart.") %> <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex index feb7011179..1757deb2cb 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex @@ -24,19 +24,19 @@