Fix transaction_controller.ex

pull/7584/head
POA 1 year ago
parent 45cb6d2174
commit e7bad40bc1
  1. 10
      apps/block_scout_web/lib/block_scout_web/controllers/api/v2/transaction_controller.ex

@ -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}} <-

Loading…
Cancel
Save