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, 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(
conn,
"index.html",
@ -36,7 +42,8 @@ defmodule BlockScoutWeb.AddressTransactionController do
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(),
filter: params["filter"],
transactions: transactions,
transaction_count: transaction_count(address)
transaction_count: transaction_count(address),
token: token
)
else
:error ->

Loading…
Cancel
Save