Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reorgs, uncles pagination #1905

Merged
merged 7 commits into from
May 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ defmodule BlockScoutWeb.BlockController do
alias Phoenix.View

def index(conn, params) do
[
necessity_by_association: %{
:transactions => :optional,
[miner: :names] => :optional,
:rewards => :optional
}
]
|> handle_render(conn, params)
case params["block_type"] do
"Uncle" ->
uncle(conn, params)

"Reorg" ->
reorg(conn, params)

_ ->
[
necessity_by_association: %{
:transactions => :optional,
[miner: :names] => :optional,
:rewards => :optional
},
block_type: "Block"
]
|> handle_render(conn, params)
end
end

def show(conn, %{"hash_or_number" => hash_or_number}) do
Expand Down Expand Up @@ -64,7 +74,7 @@ defmodule BlockScoutWeb.BlockController do
block_path(
conn,
:index,
Map.delete(next_page_params, "type")
next_page_params
)
end

Expand Down