get the contract_address_hash straight from the pattern matching

pull/699/head
Gustavo Santos Ferreira 6 years ago
parent 85770c547d
commit fe91cb3e47
  1. 4
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex

@ -70,8 +70,8 @@ defmodule BlockScoutWeb.AddressView do
def contract?(nil), do: true
def token_title(token = %Token{name: nil}) do
token.contract_address_hash
def token_title(%Token{name: nil, contract_address_hash: contract_address_hash}) do
contract_address_hash
|> to_string
|> String.slice(-6..-1)
end

Loading…
Cancel
Save