hide decoded row if event is not decoded

pull/2492/head
Ayrat Badykov 5 years ago
parent cb79fa59a5
commit 2e3cfe7640
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 10
      apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex
  2. 10
      apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex

@ -11,10 +11,10 @@
) %>
</h3>
</dd>
<dt class="col-md-2"><%= gettext "Decoded" %></dt>
<dd class="col-md-10">
<%= case decode(@log, @log.transaction) do %>
<% {:error, :contract_not_verified} -> %>
<dt class="col-md-2"><%= gettext "Decoded" %></dt>
<dd class="col-md-10">
<div class="alert alert-info">
<%= gettext "To see decoded input data, the contract must be verified." %>
<%= case @log.transaction do %>
@ -25,10 +25,16 @@
<% end %>
</div>
<% {:error, :could_not_decode} -> %>
<dt class="col-md-2"><%= gettext "Decoded" %></dt>
<dd class="col-md-10">
<div class="alert alert-danger">
<%= gettext "Failed to decode log data." %>
</div>
<% {:error, :no_matching_function} -> %>
<%= nil %>
<% {:ok, method_id, text, mapping} -> %>
<dt class="col-md-2"><%= gettext "Decoded" %></dt>
<dd class="col-md-10">
<table summary="Transaction Info" class="table thead-light table-bordered transaction-input-table">
<tr>
<td>Method Id</td>

@ -11,10 +11,10 @@
) %>
</h3>
</dd>
<dt class="col-md-1"><%= gettext "Decoded" %></dt>
<dd class="col-md-11">
<%= case decode(@log, @transaction) do %>
<% {:error, :contract_not_verified} -> %>
<dt class="col-md-1"><%= gettext "Decoded" %></dt>
<dd class="col-md-11">
<div class="alert alert-info">
<%= gettext "To see decoded input data, the contract must be verified." %>
<%= case @transaction do %>
@ -25,10 +25,16 @@
<% end %>
</div>
<% {:error, :could_not_decode} -> %>
<dt class="col-md-1"><%= gettext "Decoded" %></dt>
<dd class="col-md-11">
<div class="alert alert-danger">
<%= gettext "Failed to decode log data." %>
</div>
<% {:error, :no_matching_function} -> %>
<%= nil %>
<% {:ok, method_id, text, mapping} -> %>
<dt class="col-md-1"><%= gettext "Decoded" %></dt>
<dd class="col-md-11">
<table summary="Transaction Info" class="table thead-light table-bordered transaction-input-table">
<tr>
<td>Method Id</td>

Loading…
Cancel
Save