diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e63f5eec1..a537a51303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixes - [#8040](https://github.com/blockscout/blockscout/pull/8040) - Resolve issue with Docker image for Mac M1/M2 +- [#8060](https://github.com/blockscout/blockscout/pull/8060) - Fix eth_getLogs API endpoint ### Chore diff --git a/apps/explorer/lib/explorer/eth_rpc.ex b/apps/explorer/lib/explorer/eth_rpc.ex index ed7e683080..889fdabbba 100644 --- a/apps/explorer/lib/explorer/eth_rpc.ex +++ b/apps/explorer/lib/explorer/eth_rpc.ex @@ -296,17 +296,14 @@ defmodule Explorer.EthRPC do defp paging_options(%{ "paging_options" => %{ "logIndex" => log_index, - "transactionIndex" => transaction_index, "blockNumber" => block_number } - }) - when is_integer(transaction_index) do + }) do with {:ok, parsed_block_number} <- to_number(block_number, "invalid block number"), {:ok, parsed_log_index} <- to_number(log_index, "invalid log index") do {:ok, %{ log_index: parsed_log_index, - transaction_index: transaction_index, block_number: parsed_block_number }} end diff --git a/apps/explorer/lib/explorer/etherscan/logs.ex b/apps/explorer/lib/explorer/etherscan/logs.ex index 006c0a2e19..c7ae91e347 100644 --- a/apps/explorer/lib/explorer/etherscan/logs.ex +++ b/apps/explorer/lib/explorer/etherscan/logs.ex @@ -248,16 +248,14 @@ defmodule Explorer.Etherscan.Logs do defp where_multiple_topics_match(query, _, _, _), do: query - defp page_logs(query, %{block_number: nil, transaction_index: nil, log_index: nil}) do + defp page_logs(query, %{block_number: nil, log_index: nil}) do query end - defp page_logs(query, %{block_number: block_number, transaction_index: transaction_index, log_index: log_index}) do + defp page_logs(query, %{block_number: block_number, log_index: log_index}) do from( data in query, - where: - data.index > ^log_index and data.block_number >= ^block_number and - data.transaction_index >= ^transaction_index + where: data.index > ^log_index and data.block_number >= ^block_number ) end