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/lib/explorer_web/controllers/transaction_log_controller.ex

23 lines
561 B

defmodule ExplorerWeb.TransactionLogController do
use ExplorerWeb, :controller
import Ecto.Query
alias Explorer.Log
alias Explorer.Repo.NewRelic, as: Repo
def index(conn, %{"transaction_id" => transaction_id}) do
hash = String.downcase(transaction_id)
logs =
from(
log in Log,
join: transaction in assoc(log, :transaction),
preload: [:address],
where: fragment("lower(?)", transaction.hash) == ^hash
)
render(conn, "index.html", logs: Repo.paginate(logs), transaction_hash: hash)
end
end