pull/2910/head
Victor Baranov 5 years ago
parent 21da1393fc
commit 2271bc69ef
  1. 6
      apps/explorer/lib/explorer/etherscan/logs.ex
  2. 2
      apps/explorer/test/explorer/chain_test.exs

@ -7,9 +7,8 @@ defmodule Explorer.Etherscan.Logs do
import Ecto.Query, only: [from: 2, where: 3, subquery: 1, order_by: 3, union: 2]
alias Explorer.Chain
alias Explorer.{Chain, Repo}
alias Explorer.Chain.{Block, InternalTransaction, Log, Transaction}
alias Explorer.Repo
@base_filter %{
from_block: nil,
@ -259,6 +258,7 @@ defmodule Explorer.Etherscan.Logs do
end
defp internal_transaction_query(logs_query, direction, prepared_filter, address_hash) do
query =
from(internal_transaction in InternalTransaction.where_nonpending_block(),
join: transaction in assoc(internal_transaction, :transaction),
join: log in ^logs_query,
@ -273,6 +273,8 @@ defmodule Explorer.Etherscan.Logs do
block_number: transaction.block_number
})
)
query
|> InternalTransaction.where_address_fields_match(address_hash, direction)
end
end

@ -2598,6 +2598,8 @@ defmodule Explorer.ChainTest do
transaction: transaction,
index: 2,
block_number: transaction.block_number,
block_hash: transaction.block_hash,
block_index: 2,
transaction_index: transaction.index
)

Loading…
Cancel
Save