fix: fmt and test config

pull/9168/head
Kirill Fedoseev 10 months ago
parent 37e968f76c
commit e91b2c7ac0
  1. 8
      apps/explorer/config/test.exs
  2. 4
      apps/indexer/lib/indexer/block/fetcher.ex
  3. 2
      config/config_helper.exs
  4. 2
      config/runtime.exs

@ -43,7 +43,13 @@ config :explorer, Explorer.Repo.Account,
queue_target: 1000, queue_target: 1000,
log: false 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, config :explorer, repo,
database: "explorer_test", database: "explorer_test",
hostname: "localhost", hostname: "localhost",

@ -388,12 +388,14 @@ defmodule Indexer.Block.Fetcher do
def async_import_blobs(%{blocks: blocks}) do def async_import_blobs(%{blocks: blocks}) do
timestamps = timestamps =
blocks 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)) |> Enum.map(&Map.get(&1, :timestamp))
Blob.async_fetch(timestamps) Blob.async_fetch(timestamps)
end end
def async_import_blobs(_), do: :ok
defp block_reward_errors_to_block_numbers(block_reward_errors) when is_list(block_reward_errors) do 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) Enum.map(block_reward_errors, &block_reward_error_to_block_number/1)
end end

@ -182,7 +182,7 @@ defmodule ConfigHelper do
end end
@spec chain_type() :: String.t() @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 @spec eth_call_url(String.t() | nil) :: String.t() | nil
def eth_call_url(default \\ nil) do def eth_call_url(default \\ nil) do

@ -666,7 +666,7 @@ config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch,
config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch.Supervisor, config :indexer, Indexer.Fetcher.Zkevm.TransactionBatch.Supervisor,
enabled: enabled:
System.get_env("CHAIN_TYPE", "ethereum") == "polygon_zkevm" && ConfigHelper.chain_type() == "polygon_zkevm" &&
ConfigHelper.parse_bool_env_var("INDEXER_ZKEVM_BATCHES_ENABLED") ConfigHelper.parse_bool_env_var("INDEXER_ZKEVM_BATCHES_ENABLED")
config :indexer, Indexer.Fetcher.RootstockData.Supervisor, config :indexer, Indexer.Fetcher.RootstockData.Supervisor,

Loading…
Cancel
Save