|
|
@ -68,12 +68,18 @@ defmodule BlockScoutWeb.API.V2.TransactionController do |
|
|
|
""" |
|
|
|
""" |
|
|
|
@spec transaction(Plug.Conn.t(), map()) :: Plug.Conn.t() | {atom(), any()} |
|
|
|
@spec transaction(Plug.Conn.t(), map()) :: Plug.Conn.t() | {atom(), any()} |
|
|
|
def transaction(conn, %{"transaction_hash_param" => transaction_hash_string} = params) do |
|
|
|
def transaction(conn, %{"transaction_hash_param" => transaction_hash_string} = params) do |
|
|
|
|
|
|
|
necessity_by_association_with_actions = |
|
|
|
|
|
|
|
Map.put(@transaction_necessity_by_association, :transaction_actions, :optional) |
|
|
|
|
|
|
|
|
|
|
|
necessity_by_association = |
|
|
|
necessity_by_association = |
|
|
|
@transaction_necessity_by_association |
|
|
|
if Application.get_env(:explorer, :chain_type) == "polygon_zkevm" do |
|
|
|
|> Map.put(:transaction_actions, :optional) |
|
|
|
necessity_by_association_with_actions |
|
|
|
|> Map.put(:zkevm_batch, :optional) |
|
|
|
|> Map.put(:zkevm_batch, :optional) |
|
|
|
|> Map.put(:zkevm_sequence_txn, :optional) |
|
|
|
|> Map.put(:zkevm_sequence_txn, :optional) |
|
|
|
|> Map.put(:zkevm_verify_txn, :optional) |
|
|
|
|> Map.put(:zkevm_verify_txn, :optional) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
necessity_by_association_with_actions |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
with {:format, {:ok, transaction_hash}} <- {:format, Chain.string_to_transaction_hash(transaction_hash_string)}, |
|
|
|
with {:format, {:ok, transaction_hash}} <- {:format, Chain.string_to_transaction_hash(transaction_hash_string)}, |
|
|
|
{:not_found, {:ok, transaction}} <- |
|
|
|
{:not_found, {:ok, transaction}} <- |
|
|
|