Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/apps/explorer/lib/explorer/skipped_internal_transactio...

25 lines
644 B

defmodule Explorer.SkippedInternalTransactions do
@moduledoc """
Find transactions that do not have internal transactions.
"""
import Ecto.Query, only: [from: 2]
alias Explorer.Chain.Transaction
alias Explorer.Repo.NewRelic, as: Repo
def first, do: first(1)
def first(count) do
transactions =
from(
transaction in Transaction,
left_join: internal_transactions in assoc(transaction, :internal_transactions),
select: fragment("hash"),
group_by: transaction.id,
having: count(internal_transactions.id) == 0,
limit: ^count
)
Repo.all(transactions)
end
end