chore: privatize function and fix indentation

pull/1119/head
zachdaniel 6 years ago
parent 743f446e48
commit f82d40c866
  1. 8
      apps/block_scout_web/lib/block_scout_web/templates/transaction/_decoded_input.html.eex
  2. 8
      apps/block_scout_web/lib/block_scout_web/views/abi_encoded_value_view.ex

@ -7,10 +7,10 @@
<div class="alert alert-danger">
<%= gettext "To see decoded input data, the contract must be verified." %>
<%= case @transaction do %>
<% %{to_address: %{hash: hash}} -> %>
<%= gettext "Verify the contract " %><a href="<%= address_verify_contract_path(@conn, :new, hash)%>"><%= gettext "here" %></a>
<% _ -> %>
<%= nil %>
<% %{to_address: %{hash: hash}} -> %>
<%= gettext "Verify the contract " %><a href="<%= address_verify_contract_path(@conn, :new, hash)%>"><%= gettext "here" %></a>
<% _ -> %>
<%= nil %>
<% end %>
</div>
<% {:ok, method_id, text, mapping} -> %>

@ -95,21 +95,21 @@ defmodule BlockScoutWeb.ABIEncodedValueView do
[spacing, base_value_html(type, value)]
end
def base_value_html(_, {:dynamic, value}) do
defp base_value_html(_, {:dynamic, value}) do
hex(value)
end
def base_value_html(:address, value) do
defp base_value_html(:address, value) do
address = hex(value)
~E|<a href="<%= address_path(BlockScoutWeb.Endpoint, :show, address) %>" target="_blank"><%= address %></a>|
end
def base_value_html(:bytes, value) do
defp base_value_html(:bytes, value) do
hex(value)
end
def base_value_html(_, value), do: HTML.html_escape(value)
defp base_value_html(_, value), do: HTML.html_escape(value)
defp hex(value), do: "0x" <> Base.encode16(value, case: :lower)
end

Loading…
Cancel
Save