pull/9168/head
Kirill Fedoseev 10 months ago
parent 1bc0e50245
commit 41008abb69
  1. 4
      apps/block_scout_web/lib/block_scout_web/chain.ex
  2. 18
      apps/indexer/test/indexer/fetcher/beacon/blob_test.exs

@ -19,13 +19,13 @@ defmodule BlockScoutWeb.Chain do
alias Ecto.Association.NotLoaded
alias Explorer.Account.{TagAddress, TagTransaction, WatchlistAddress}
alias Explorer.Chain.Beacon.Reader, as: BeaconReader
alias Explorer.Chain.Block.Reward
alias Explorer.Chain.{
Address,
Address.CoinBalance,
Address.CurrentTokenBalance,
Beacon,
Beacon.Blob,
Block,
Hash,
@ -697,7 +697,7 @@ defmodule BlockScoutWeb.Chain do
defp hash_to_blob(hash) do
if Application.get_env(:explorer, :chain_type) == "ethereum" do
Beacon.Reader.blob(hash, false)
BeaconReader.blob(hash, false)
else
{:error, :not_found}
end

@ -40,10 +40,10 @@ defmodule Indexer.Fetcher.Beacon.BlobTest do
insert(:blob_transaction, hash: transaction_b_hash, blob_versioned_hashes: [blob_c.hash])
insert(:blob_transaction, hash: transaction_c_hash, blob_versioned_hashes: [blob_d.hash])
assert {:error, :not_found} = Reader.blob(blob_a.hash)
assert {:error, :not_found} = Reader.blob(blob_b.hash)
assert {:error, :not_found} = Reader.blob(blob_c.hash)
assert {:ok, _} = Reader.blob(blob_d.hash)
assert {:error, :not_found} = Reader.blob(blob_a.hash, true)
assert {:error, :not_found} = Reader.blob(blob_b.hash, true)
assert {:error, :not_found} = Reader.blob(blob_c.hash, true)
assert {:ok, _} = Reader.blob(blob_d.hash, true)
Application.put_env(:explorer, :http_adapter, Explorer.Mox.HTTPoison)
@ -96,10 +96,10 @@ defmodule Indexer.Fetcher.Beacon.BlobTest do
Repo.one!(from(blob in Blob, where: blob.hash == ^blob_a.hash))
end)
assert {:ok, _} = Reader.blob(blob_a.hash)
assert {:ok, _} = Reader.blob(blob_b.hash)
assert {:ok, _} = Reader.blob(blob_c.hash)
assert {:ok, _} = Reader.blob(blob_d.hash)
assert {:ok, _} = Reader.blob(blob_a.hash, true)
assert {:ok, _} = Reader.blob(blob_b.hash, true)
assert {:ok, _} = Reader.blob(blob_c.hash, true)
assert {:ok, _} = Reader.blob(blob_d.hash, true)
Application.put_env(:explorer, :http_adapter, HTTPoison)
end
@ -154,7 +154,7 @@ defmodule Indexer.Fetcher.Beacon.BlobTest do
Repo.one!(from(blob in Blob, where: blob.hash == ^blob_hash_a))
end)
assert {:ok, blob} = Reader.blob(blob_hash_a)
assert {:ok, blob} = Reader.blob(blob_hash_a, true)
assert %{
hash: ^blob_hash_a,

Loading…
Cancel
Save