From 41008abb696a1453595b7e7c13915a31a133d47a Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 30 Jan 2024 14:40:19 +0400 Subject: [PATCH] fix: tests --- .../lib/block_scout_web/chain.ex | 4 ++-- .../test/indexer/fetcher/beacon/blob_test.exs | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/chain.ex b/apps/block_scout_web/lib/block_scout_web/chain.ex index c2c812f9db..489e8c79c4 100644 --- a/apps/block_scout_web/lib/block_scout_web/chain.ex +++ b/apps/block_scout_web/lib/block_scout_web/chain.ex @@ -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 diff --git a/apps/indexer/test/indexer/fetcher/beacon/blob_test.exs b/apps/indexer/test/indexer/fetcher/beacon/blob_test.exs index bf51708221..3d41909b78 100644 --- a/apps/indexer/test/indexer/fetcher/beacon/blob_test.exs +++ b/apps/indexer/test/indexer/fetcher/beacon/blob_test.exs @@ -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,