|
|
|
@ -105,32 +105,38 @@ |
|
|
|
|
<div data-function-response></div> |
|
|
|
|
</div> |
|
|
|
|
<% else %> |
|
|
|
|
<%= if outputs?(function["outputs"]) do %> |
|
|
|
|
<% length = Enum.count(function["outputs"]) %> |
|
|
|
|
<%= for {output, index} <- Enum.with_index(function["outputs"]) do %> |
|
|
|
|
<%= if address?(output["type"]) do %> |
|
|
|
|
<div class="py-2 word-break-all"> |
|
|
|
|
<%= link( |
|
|
|
|
output["value"], |
|
|
|
|
to: address_path(@conn, :show, output["value"])) %><%= if length > 1 and index < length - 1 do %>, <% end %> |
|
|
|
|
</div> |
|
|
|
|
<% else %> |
|
|
|
|
<%= if output["type"] == "uint256" do %> |
|
|
|
|
<%= cond do %> |
|
|
|
|
<%= outputs?(function["outputs"]) -> %> |
|
|
|
|
<% length = Enum.count(function["outputs"]) %> |
|
|
|
|
<%= for {output, index} <- Enum.with_index(function["outputs"]) do %> |
|
|
|
|
<%= if address?(output["type"]) do %> |
|
|
|
|
<div class="py-2 word-break-all"> |
|
|
|
|
<div data-wei-ether-converter> |
|
|
|
|
<span data-conversion-unit data-original-value="<%= output["value"] %>"><%= output["value"] %></span> |
|
|
|
|
<span class="py-2 px-2"> |
|
|
|
|
<input class="wei-ether" type="checkbox" autocomplete="off"> |
|
|
|
|
<span class="d-inline-block" data-conversion-text-wei><%= gettext("WEI")%></span> |
|
|
|
|
<span class="d-none" data-conversion-text-eth><%= gettext("ETH")%></span> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<%= link( |
|
|
|
|
output["value"], |
|
|
|
|
to: address_path(@conn, :show, output["value"])) %><%= if length > 1 and index < length - 1 do %>, <% end %> |
|
|
|
|
</div> |
|
|
|
|
<% else %> |
|
|
|
|
<%= raw(values_only(output["value"], output["type"], output["components"])) %> |
|
|
|
|
<%= if output["type"] == "uint256" do %> |
|
|
|
|
<div class="py-2 word-break-all"> |
|
|
|
|
<div data-wei-ether-converter> |
|
|
|
|
<span data-conversion-unit data-original-value="<%= output["value"] %>"><%= output["value"] %></span> |
|
|
|
|
<span class="py-2 px-2"> |
|
|
|
|
<input class="wei-ether" type="checkbox" autocomplete="off"> |
|
|
|
|
<span class="d-inline-block" data-conversion-text-wei><%= gettext("WEI")%></span> |
|
|
|
|
<span class="d-none" data-conversion-text-eth><%= gettext("ETH")%></span> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% else %> |
|
|
|
|
<%= raw(values_only(output["value"], output["type"], output["components"])) %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
<% error?(function["outputs"]) -> %> |
|
|
|
|
<% {:error, text_error} = function["outputs"] %> |
|
|
|
|
<div class="alert alert-danger py-2 word-break-all" style="margin-bottom: 0;"><%= text_error %></div> |
|
|
|
|
<% true -> %> |
|
|
|
|
<% nil %> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
</div> |
|
|
|
|