From 2e3cfe764056f6844e3fc850d733e2059f023571 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 2 Aug 2019 11:31:59 +0300 Subject: [PATCH] hide decoded row if event is not decoded --- .../templates/address_logs/_logs.html.eex | 10 ++++++++-- .../templates/transaction_log/_logs.html.eex | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex index 3fb638b1d9..0e61ee7b77 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_logs/_logs.html.eex @@ -11,10 +11,10 @@ ) %> -
<%= gettext "Decoded" %>
-
<%= case decode(@log, @log.transaction) do %> <% {:error, :contract_not_verified} -> %> +
<%= gettext "Decoded" %>
+
<%= gettext "To see decoded input data, the contract must be verified." %> <%= case @log.transaction do %> @@ -25,10 +25,16 @@ <% end %>
<% {:error, :could_not_decode} -> %> +
<%= gettext "Decoded" %>
+
<%= gettext "Failed to decode log data." %>
+ <% {:error, :no_matching_function} -> %> + <%= nil %> <% {:ok, method_id, text, mapping} -> %> +
<%= gettext "Decoded" %>
+
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex index ff3e46d42a..eb3f075cfc 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction_log/_logs.html.eex @@ -11,10 +11,10 @@ ) %> -
<%= gettext "Decoded" %>
-
<%= case decode(@log, @transaction) do %> <% {:error, :contract_not_verified} -> %> +
<%= gettext "Decoded" %>
+
<%= gettext "To see decoded input data, the contract must be verified." %> <%= case @transaction do %> @@ -25,10 +25,16 @@ <% end %>
<% {:error, :could_not_decode} -> %> +
<%= gettext "Decoded" %>
+
<%= gettext "Failed to decode log data." %>
+ <% {:error, :no_matching_function} -> %> + <%= nil %> <% {:ok, method_id, text, mapping} -> %> +
<%= gettext "Decoded" %>
+
Method Id
Method Id