diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index fc8a228664..d81dfc308c 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -587,9 +587,9 @@ defmodule Explorer.Chain do iex> [%Transaction{hash: hash1}, %Transaction{hash: hash2}] = insert_list(2, :transaction) iex> [%Explorer.Chain.Transaction{hash: found_hash1}, %Explorer.Chain.Transaction{hash: found_hash2}] = ...> Explorer.Chain.hashes_to_transactions([hash1, hash2]) - iex> found_hash1 == hash1 + iex> found_hash1 in [hash1, hash2] true - iex> found_hash2 == hash2 + iex> found_hash2 in [hash1, hash2] true Returns `[]` if not found diff --git a/apps/explorer/test/explorer/chain_test.exs b/apps/explorer/test/explorer/chain_test.exs index 6dad44b353..a8af458790 100644 --- a/apps/explorer/test/explorer/chain_test.exs +++ b/apps/explorer/test/explorer/chain_test.exs @@ -529,11 +529,9 @@ defmodule Explorer.ChainTest do necessity_by_association: %{block: :required} ) - assert [%Transaction{hash: ^hash_without_index1}, %Transaction{hash: ^hash_without_index2}] = - Chain.hashes_to_transactions( - [hash_without_index1, hash_without_index2], - necessity_by_association: %{block: :optional} - ) + assert [hash_without_index1, hash_without_index2] + |> Chain.hashes_to_transactions(necessity_by_association: %{block: :optional}) + |> Enum.all?(&(&1.hash in [hash_without_index1, hash_without_index2])) end end