diff --git a/apps/explorer/config/test.exs b/apps/explorer/config/test.exs index 70d457c6c3..2894a2052b 100644 --- a/apps/explorer/config/test.exs +++ b/apps/explorer/config/test.exs @@ -43,7 +43,13 @@ config :explorer, Explorer.Repo.Account, queue_target: 1000, log: false -for repo <- [Explorer.Repo.PolygonEdge, Explorer.Repo.PolygonZkevm, Explorer.Repo.RSK, Explorer.Repo.Suave, Explorer.Repo.Beacon] do +for repo <- [ + Explorer.Repo.PolygonEdge, + Explorer.Repo.PolygonZkevm, + Explorer.Repo.RSK, + Explorer.Repo.Suave, + Explorer.Repo.Beacon + ] do config :explorer, repo, database: "explorer_test", hostname: "localhost", diff --git a/apps/indexer/lib/indexer/block/fetcher.ex b/apps/indexer/lib/indexer/block/fetcher.ex index d7177c83b8..bf91091f8b 100644 --- a/apps/indexer/lib/indexer/block/fetcher.ex +++ b/apps/indexer/lib/indexer/block/fetcher.ex @@ -388,12 +388,14 @@ defmodule Indexer.Block.Fetcher do def async_import_blobs(%{blocks: blocks}) do timestamps = blocks - |> Enum.filter(fn %{blob_gas_used: blob_gas_used} -> blob_gas_used > 0 end) + |> Enum.filter(fn block -> block |> Map.get(:blob_gas_used, 0) > 0 end) |> Enum.map(&Map.get(&1, :timestamp)) Blob.async_fetch(timestamps) end + def async_import_blobs(_), do: :ok + defp block_reward_errors_to_block_numbers(block_reward_errors) when is_list(block_reward_errors) do Enum.map(block_reward_errors, &block_reward_error_to_block_number/1) end diff --git a/config/config_helper.exs b/config/config_helper.exs index cac87c611f..392ca74a2e 100644 --- a/config/config_helper.exs +++ b/config/config_helper.exs @@ -182,7 +182,7 @@ defmodule ConfigHelper do end @spec chain_type() :: String.t() - def chain_type, do: System.get_env("CHAIN_TYPE") || "ethereum" + def chain_type, do: System.get_env("CHAIN_TYPE") || "default" @spec eth_call_url(String.t() | nil) :: String.t() | nil def eth_call_url(default \\ nil) do diff --git a/config/runtime.exs b/config/runtime.exs index 3659b1d7be..7ef79e36d9 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -666,7 +666,7 @@ config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch, config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch.Supervisor, enabled: - System.get_env("CHAIN_TYPE", "ethereum") == "polygon_zkevm" && + ConfigHelper.chain_type() == "polygon_zkevm" && ConfigHelper.parse_bool_env_var("INDEXER_ZKEVM_BATCHES_ENABLED") config :indexer, Indexer.Fetcher.RootstockData.Supervisor,