|
|
@ -28,16 +28,19 @@ defmodule BlockScoutWeb.API.V2.ZkevmController do |
|
|
|
""" |
|
|
|
""" |
|
|
|
@spec batch(Plug.Conn.t(), map()) :: Plug.Conn.t() |
|
|
|
@spec batch(Plug.Conn.t(), map()) :: Plug.Conn.t() |
|
|
|
def batch(conn, %{"batch_number" => batch_number} = _params) do |
|
|
|
def batch(conn, %{"batch_number" => batch_number} = _params) do |
|
|
|
{:ok, batch} = |
|
|
|
case Reader.batch( |
|
|
|
Reader.batch( |
|
|
|
batch_number, |
|
|
|
batch_number, |
|
|
|
necessity_by_association: @batch_necessity_by_association, |
|
|
|
necessity_by_association: @batch_necessity_by_association, |
|
|
|
api?: true |
|
|
|
api?: true |
|
|
|
) do |
|
|
|
) |
|
|
|
{:ok, batch} -> |
|
|
|
|
|
|
|
conn |
|
|
|
|
|
|
|
|> put_status(200) |
|
|
|
|
|
|
|
|> render(:zkevm_batch, %{batch: batch}) |
|
|
|
|
|
|
|
|
|
|
|
conn |
|
|
|
{:error, :not_found} = res -> |
|
|
|
|> put_status(200) |
|
|
|
res |
|
|
|
|> render(:zkevm_batch, %{batch: batch}) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
@doc """ |
|
|
|