|
|
@ -6,15 +6,13 @@ defmodule BlockScoutWeb.BlockController do |
|
|
|
alias Explorer.Chain |
|
|
|
alias Explorer.Chain |
|
|
|
|
|
|
|
|
|
|
|
def index(conn, params) do |
|
|
|
def index(conn, params) do |
|
|
|
Keyword.merge( |
|
|
|
|
|
|
|
[ |
|
|
|
[ |
|
|
|
necessity_by_association: %{ |
|
|
|
necessity_by_association: %{ |
|
|
|
:transactions => :optional, |
|
|
|
:transactions => :optional, |
|
|
|
[miner: :names] => :optional |
|
|
|
[miner: :names] => :optional |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
] |
|
|
|
paging_options(params) |
|
|
|
|> Keyword.merge(paging_options(params)) |
|
|
|
) |
|
|
|
|
|
|
|
|> handle_render(conn, params) |
|
|
|
|> handle_render(conn, params) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -23,21 +21,18 @@ defmodule BlockScoutWeb.BlockController do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def reorg(conn, params) do |
|
|
|
def reorg(conn, params) do |
|
|
|
Keyword.merge( |
|
|
|
|
|
|
|
[ |
|
|
|
[ |
|
|
|
necessity_by_association: %{ |
|
|
|
necessity_by_association: %{ |
|
|
|
:transactions => :optional, |
|
|
|
:transactions => :optional, |
|
|
|
[miner: :names] => :optional |
|
|
|
[miner: :names] => :optional |
|
|
|
}, |
|
|
|
}, |
|
|
|
block_type: "Reorg" |
|
|
|
block_type: "Reorg" |
|
|
|
], |
|
|
|
] |
|
|
|
paging_options(params) |
|
|
|
|> Keyword.merge(paging_options(params)) |
|
|
|
) |
|
|
|
|
|
|
|
|> handle_render(conn, params) |
|
|
|
|> handle_render(conn, params) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def uncle(conn, params) do |
|
|
|
def uncle(conn, params) do |
|
|
|
Keyword.merge( |
|
|
|
|
|
|
|
[ |
|
|
|
[ |
|
|
|
necessity_by_association: %{ |
|
|
|
necessity_by_association: %{ |
|
|
|
:transactions => :optional, |
|
|
|
:transactions => :optional, |
|
|
@ -45,9 +40,8 @@ defmodule BlockScoutWeb.BlockController do |
|
|
|
:nephews => :required |
|
|
|
:nephews => :required |
|
|
|
}, |
|
|
|
}, |
|
|
|
block_type: "Uncle" |
|
|
|
block_type: "Uncle" |
|
|
|
], |
|
|
|
] |
|
|
|
paging_options(params) |
|
|
|
|> Keyword.merge(paging_options(params)) |
|
|
|
) |
|
|
|
|
|
|
|
|> handle_render(conn, params) |
|
|
|
|> handle_render(conn, params) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|