pass the token(or nil if there's no token) to the address transaction indexrender

pull/699/head
Gustavo Santos Ferreira 6 years ago
parent 729d205ab5
commit 1a947867e2
  1. 9
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex

@ -28,6 +28,12 @@ defmodule BlockScoutWeb.AddressTransactionController do
transactions_plus_one = Chain.address_to_transactions(address, full_options) transactions_plus_one = Chain.address_to_transactions(address, full_options)
{transactions, next_page} = split_list_by_page(transactions_plus_one) {transactions, next_page} = split_list_by_page(transactions_plus_one)
token =
case Chain.token_from_address_hash(address_hash) do
{:ok, token} -> token
{:error, :not_found} -> nil
end
render( render(
conn, conn,
"index.html", "index.html",
@ -36,7 +42,8 @@ defmodule BlockScoutWeb.AddressTransactionController do
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(), exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(),
filter: params["filter"], filter: params["filter"],
transactions: transactions, transactions: transactions,
transaction_count: transaction_count(address) transaction_count: transaction_count(address),
token: token
) )
else else
:error -> :error ->

Loading…
Cancel
Save