From 2e3cfe764056f6844e3fc850d733e2059f023571 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 2 Aug 2019 11:31:59 +0300 Subject: [PATCH 1/5] 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
From 96654f56bf15818d021af89955f4ee7f019283bd Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 2 Aug 2019 11:35:49 +0300 Subject: [PATCH 2/5] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 44 ++++++++++--------- .../priv/gettext/en/LC_MESSAGES/default.po | 44 ++++++++++--------- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index e356d87df9..0a365bd381 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -547,10 +547,10 @@ msgid "Must be set to:" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:46 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:52 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:46 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:52 msgid "Name" msgstr "" @@ -1108,8 +1108,12 @@ msgid "Static Call" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:14 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:14 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:16 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:28 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:36 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:16 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:28 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:36 msgid "Decoded" msgstr "" @@ -1753,9 +1757,9 @@ msgid "Constructor Arguments" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:59 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:65 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:31 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:59 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:65 msgid "Copy Value" msgstr "" @@ -1765,29 +1769,29 @@ msgid "Create2" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:114 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:55 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:120 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:115 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:55 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:121 msgid "Data" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:29 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:29 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:31 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:31 msgid "Failed to decode log data." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:48 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:48 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:54 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:54 msgid "Indexed?" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:43 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:43 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 msgid "Log Data" msgstr "" @@ -1799,14 +1803,14 @@ msgid "Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:84 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:90 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:91 msgid "Topics" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:47 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:53 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:20 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:47 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:53 msgid "Type" msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 58e159d0bb..3dbf32e371 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -547,10 +547,10 @@ msgid "Must be set to:" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:46 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:52 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:46 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:52 msgid "Name" msgstr "" @@ -1108,8 +1108,12 @@ msgid "Static Call" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:14 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:14 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:16 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:28 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:36 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:16 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:28 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:36 msgid "Decoded" msgstr "" @@ -1754,9 +1758,9 @@ msgid "Constructor Arguments" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:59 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:65 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:31 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:59 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:65 msgid "Copy Value" msgstr "" @@ -1766,29 +1770,29 @@ msgid "Create2" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:114 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:55 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:120 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:115 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:55 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:121 msgid "Data" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:29 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:29 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:31 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:31 msgid "Failed to decode log data." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:48 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:48 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:54 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:54 msgid "Indexed?" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:43 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:43 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 msgid "Log Data" msgstr "" @@ -1800,14 +1804,14 @@ msgid "Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:84 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:90 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:91 msgid "Topics" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:47 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:53 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:20 -#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:47 +#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:53 msgid "Type" msgstr "" From c804ac5d6600f9af59508fb51aeeb8b291cf88ed Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 2 Aug 2019 11:36:33 +0300 Subject: [PATCH 3/5] add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1277e69d70..8a608f45e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [#2425](https://github.com/poanetwork/blockscout/pull/2425) - Force to show address view for checksummed address even if it is not in DB ### Chore +- [#2492](https://github.com/poanetwork/blockscout/pull/2492) - hide decoded row if event is not decoded - [#2432](https://github.com/poanetwork/blockscout/pull/2432) - bump credo version - [#2457](https://github.com/poanetwork/blockscout/pull/2457) - update mix.lock - [#2435](https://github.com/poanetwork/blockscout/pull/2435) - Replace deprecated extract-text-webpack-plugin with mini-css-extract-plugin From fef781d656ddebb88f3e64c3ba6347c5b4c23927 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 2 Aug 2019 12:28:01 +0300 Subject: [PATCH 4/5] fix dialyzer --- .../lib/block_scout_web/templates/address_logs/_logs.html.eex | 4 +--- 1 file changed, 1 insertion(+), 3 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 0e61ee7b77..e49adf8801 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 @@ -30,8 +30,6 @@
<%= gettext "Failed to decode log data." %>
- <% {:error, :no_matching_function} -> %> - <%= nil %> <% {:ok, method_id, text, mapping} -> %>
<%= gettext "Decoded" %>
@@ -84,7 +82,7 @@ <% end %>
Method Id
- <% _ -> %> + <% _ -> %> <%= nil %> <% end %>
<%= gettext "Topics" %>
From eec6bd60eeba3e91b1c6ba28a6e5662a94cd9342 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Fri, 2 Aug 2019 12:30:39 +0300 Subject: [PATCH 5/5] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 18 +++++++++--------- .../priv/gettext/en/LC_MESSAGES/default.po | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 0a365bd381..7a8787510d 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -547,7 +547,7 @@ msgid "Must be set to:" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:52 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:50 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:52 @@ -1110,7 +1110,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:16 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:28 -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:36 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:34 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:16 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:28 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:36 @@ -1757,7 +1757,7 @@ msgid "Constructor Arguments" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:65 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:63 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:31 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:65 msgid "Copy Value" @@ -1769,8 +1769,8 @@ msgid "Create2" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:55 -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:120 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:53 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:118 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:55 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:121 @@ -1784,13 +1784,13 @@ msgid "Failed to decode log data." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:54 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:52 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:54 msgid "Indexed?" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:47 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 msgid "Log Data" msgstr "" @@ -1803,13 +1803,13 @@ msgid "Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:90 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:88 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:91 msgid "Topics" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:53 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:51 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:20 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:53 msgid "Type" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 3dbf32e371..9f39434681 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -547,7 +547,7 @@ msgid "Must be set to:" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:52 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:50 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:52 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:19 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:52 @@ -1110,7 +1110,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:16 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:28 -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:36 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:34 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:16 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:28 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:36 @@ -1758,7 +1758,7 @@ msgid "Constructor Arguments" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:65 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:63 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:31 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:65 msgid "Copy Value" @@ -1770,8 +1770,8 @@ msgid "Create2" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:55 -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:120 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:53 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:118 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:55 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:121 @@ -1785,13 +1785,13 @@ msgid "Failed to decode log data." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:54 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:52 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:54 msgid "Indexed?" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:47 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:49 msgid "Log Data" msgstr "" @@ -1804,13 +1804,13 @@ msgid "Reward" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:90 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:88 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:91 msgid "Topics" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/address_logs/_logs.html.eex:53 +#: lib/block_scout_web/templates/address_logs/_logs.html.eex:51 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:20 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:53 msgid "Type"