From d9db44895aca14d084c554406dfabb7e0b0a9884 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 6 Aug 2019 15:59:59 +0300 Subject: [PATCH 01/17] get rid of telemetry warnings --- apps/block_scout_web/mix.exs | 2 +- apps/explorer/mix.exs | 8 ++++---- mix.lock | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/block_scout_web/mix.exs b/apps/block_scout_web/mix.exs index 819a9d7adb..2f0b8ee8a3 100644 --- a/apps/block_scout_web/mix.exs +++ b/apps/block_scout_web/mix.exs @@ -101,7 +101,7 @@ defmodule BlockScoutWeb.Mixfile do {:phoenix, "~> 1.4"}, {:phoenix_ecto, "~> 4.0"}, {:phoenix_html, "~> 2.10"}, - {:phoenix_live_reload, "~> 1.0", only: [:dev]}, + {:phoenix_live_reload, "~> 1.2", only: [:dev]}, {:phoenix_pubsub, "~> 1.0"}, # use `:cowboy` for WebServer with `:plug` {:plug_cowboy, "~> 2.0"}, diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs index b261d96d28..bb0c1671e8 100644 --- a/apps/explorer/mix.exs +++ b/apps/explorer/mix.exs @@ -74,13 +74,13 @@ defmodule Explorer.Mixfile do {:decimal, "~> 1.0"}, {:dialyxir, "~> 0.5", only: [:dev, :test], runtime: false}, # `override: true` for `ex_machina` compatibility - {:ecto, "~> 3.0", override: true}, + {:ecto, "~> 3.1", override: true}, # Storing blockchain data and derived data in PostgreSQL. - {:ecto_sql, "~> 3.0"}, + {:ecto_sql, "~> 3.1"}, # JSONRPC access to query smart contracts {:ethereum_jsonrpc, in_umbrella: true}, # Data factory for testing - {:ex_machina, "~> 2.1", only: [:test]}, + {:ex_machina, "~> 2.3", only: [:test]}, # Code coverage {:excoveralls, "~> 0.10.0", only: [:test], github: "KronicDeth/excoveralls", branch: "circle-workflows"}, {:exvcr, "~> 0.10", only: :test}, @@ -115,7 +115,7 @@ defmodule Explorer.Mixfile do # `:spandex` tracing of `:ecto` {:spandex_ecto, "~> 0.4.0"}, # Attach `:prometheus_ecto` to `:ecto` - {:telemetry, "~> 0.3.0"}, + {:telemetry, "~> 0.4.0"}, # `Timex.Duration` for `Explorer.Counters.AverageBlockTime.average_block_time/0` {:timex, "~> 3.6"}, {:con_cache, "~> 0.13"} diff --git a/mix.lock b/mix.lock index 111a006f53..9a250dc840 100644 --- a/mix.lock +++ b/mix.lock @@ -25,15 +25,15 @@ "credo": {:hex, :credo, "1.1.2", "02b6422f3e659eb74b05aca3c20c1d8da0119a05ee82577a82e6c2938bf29f81", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, "csv": {:hex, :csv, "2.1.1", "a4c1a7c30d2151b6e4976cb2f52c0a1d49ec965afb737ed84a684bc4284d1627", [:mix], [{:parallel_stream, "~> 1.0.4", [hex: :parallel_stream, optional: false]}]}, "dataloader": {:hex, :dataloader, "1.0.6", "fb724d6d3fb6acb87d27e3b32dea3a307936ad2d245faf9cf5221d1323d6a4ba", [:mix], [{:ecto, ">= 0.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"}, - "db_connection": {:hex, :db_connection, "2.0.3", "b4e8aa43c100e16f122ccd6798cd51c48c79fd391c39d411f42b3cd765daccb0", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, + "db_connection": {:hex, :db_connection, "2.1.1", "a51e8a2ee54ef2ae6ec41a668c85787ed40cb8944928c191280fe34c15b76ae5", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, "decimal": {:hex, :decimal, "1.8.0", "ca462e0d885f09a1c5a342dbd7c1dcf27ea63548c65a65e67334f4b61803822e", [:mix], [], "hexpm"}, "decorator": {:hex, :decorator, "1.3.0", "6203dbd6e4e519a21a079e2a74e50fddaf03e80be22711b92eb4cd410173abea", [:mix], [], "hexpm"}, "deep_merge": {:hex, :deep_merge, "0.2.0", "c1050fa2edf4848b9f556fba1b75afc66608a4219659e3311d9c9427b5b680b3", [:mix], [], "hexpm"}, "dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [:mix], []}, "distillery": {:hex, :distillery, "2.0.12", "6e78fe042df82610ac3fa50bd7d2d8190ad287d120d3cd1682d83a44e8b34dfb", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"}, "earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"}, - "ecto": {:hex, :ecto, "3.0.7", "44dda84ac6b17bbbdeb8ac5dfef08b7da253b37a453c34ab1a98de7f7e5fec7f", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, - "ecto_sql": {:hex, :ecto_sql, "3.0.4", "e7a0feb0b2484b90981c56d5cd03c52122c1c31ded0b95ed213b7c5c07ae6737", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0.6", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.3.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, + "ecto": {:hex, :ecto, "3.1.7", "fa21d06ef56cdc2fdaa62574e8c3ba34a2751d44ea34c30bc65f0728421043e5", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "ecto_sql": {:hex, :ecto_sql, "3.1.6", "1e80e30d16138a729c717f73dcb938590bcdb3a4502f3012414d0cbb261045d8", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:myxql, "~> 0.2.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0 or ~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"}, "ex_abi": {:hex, :ex_abi, "0.1.18", "19db9bffdd201edbdff97d7dd5849291218b17beda045c1b76bff5248964f37d", [:mix], [{:exth_crypto, "~> 0.1.4", [hex: :exth_crypto, repo: "hexpm", optional: false]}], "hexpm"}, "ex_cldr": {:hex, :ex_cldr, "1.3.2", "8f4a00c99d1c537b8e8db7e7903f4bd78d82a7289502d080f70365392b13921b", [:mix], [{:abnf2, "~> 0.1", [hex: :abnf2, optional: false]}, {:decimal, "~> 1.4", [hex: :decimal, optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, optional: true]}, {:poison, "~> 2.1 or ~> 3.0", [hex: :poison, optional: true]}]}, @@ -92,7 +92,7 @@ "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], []}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm"}, - "postgrex": {:hex, :postgrex, "0.14.1", "63247d4a5ad6b9de57a0bac5d807e1c32d41e39c04b8a4156a26c63bcd8a2e49", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "postgrex": {:hex, :postgrex, "0.15.0", "dd5349161019caeea93efa42f9b22f9d79995c3a86bdffb796427b4c9863b0f0", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "prometheus": {:hex, :prometheus, "4.2.0", "06c58bfdfe28d3168b926da614cb9a6d39593deebde648a5480e32dfa3c370e9", [:mix, :rebar3], [], "hexpm"}, "prometheus_ecto": {:git, "https://github.com/deadtrickster/prometheus-ecto.git", "650a403183f6a2fb6b682d7fbcba8bf9d24fe1e4", [ref: "650a403183f6a2fb6b682d7fbcba8bf9d24fe1e4"]}, "prometheus_ex": {:hex, :prometheus_ex, "3.0.3", "5d722263bb1f7a9b1d02554de42e61ea672b4e3c07c3f74e23ce35ab5e111cfa", [:mix], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm"}, @@ -109,7 +109,7 @@ "spandex_ecto": {:hex, :spandex_ecto, "0.4.0", "deaeaddc11a35f1c551206c53d09bb93a0da5808dbef751430e465c8c7de01d3", [:mix], [{:spandex, "~> 2.2", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm"}, "spandex_phoenix": {:hex, :spandex_phoenix, "0.3.1", "9cb9a4a9f2161f171d9df9afa1289a0d037abbbeecabae674f959b57f106f201", [:mix], [{:plug, "~> 1.3", [hex: :plug, repo: "hexpm", optional: false]}, {:spandex, "~> 2.2", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"}, - "telemetry": {:hex, :telemetry, "0.3.0", "099a7f3ce31e4780f971b4630a3c22ec66d22208bc090fe33a2a3a6a67754a73", [:rebar3], [], "hexpm"}, + "telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"}, "timex": {:hex, :timex, "3.6.1", "efdf56d0e67a6b956cc57774353b0329c8ab7726766a11547e529357ffdc1d56", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5 or ~> 1.0.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"}, "tzdata": {:hex, :tzdata, "1.0.1", "f6027a331af7d837471248e62733c6ebee86a72e57c613aa071ebb1f750fc71a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"}, From 099224d82426f518f675de6745a1176b9c780693 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 6 Aug 2019 16:02:40 +0300 Subject: [PATCH 02/17] get rid of telemetry warnings --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99e26c578c..c7a52f9f63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,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 +- [#2507](https://github.com/poanetwork/blockscout/pull/2507) - get rid of telemetry warnings - [#2402](https://github.com/poanetwork/blockscout/pull/2402) - bump otp version to 22.0 - [#2432](https://github.com/poanetwork/blockscout/pull/2432) - bump credo version - [#2457](https://github.com/poanetwork/blockscout/pull/2457) - update mix.lock From 39f7fe22a1f29797eb8dad9005c8f1489a73e71e Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Tue, 6 Aug 2019 18:39:25 +0300 Subject: [PATCH 03/17] logs view columns fix --- .../templates/transaction_log/_logs.html.eex | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 eb3f075cfc..c63502669b 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 @@ -1,7 +1,7 @@
-
<%= gettext "Address" %>
-
+
<%= gettext "Address" %>
+

<%= link( @log.address, @@ -13,8 +13,8 @@

<%= case decode(@log, @transaction) do %> <% {:error, :contract_not_verified} -> %> -
<%= gettext "Decoded" %>
-
+
<%= gettext "Decoded" %>
+
<%= gettext "To see decoded input data, the contract must be verified." %> <%= case @transaction do %> @@ -25,16 +25,16 @@ <% end %>
<% {:error, :could_not_decode} -> %> -
<%= gettext "Decoded" %>
-
+
<%= gettext "Decoded" %>
+
<%= gettext "Failed to decode log data." %>
<% {:error, :no_matching_function} -> %> <%= nil %> <% {:ok, method_id, text, mapping} -> %> -
<%= gettext "Decoded" %>
-
+
<%= gettext "Decoded" %>
+
@@ -88,8 +88,8 @@ <%= nil %> <% end %> -
<%= gettext "Topics" %>
-
+
<%= gettext "Topics" %>
+
<%= unless is_nil(@log.first_topic) do %>
@@ -117,10 +117,10 @@ <% end %>
-
+
<%= gettext "Data" %>
-
+
<%= unless is_nil(@log.data) do %>
<%= @log.data %> From 0ca9c069604970a194da2fc7d0911d36f16319ce Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Tue, 6 Aug 2019 18:41:20 +0300 Subject: [PATCH 04/17] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d1cc05b7..d3fd193e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#2456](https://github.com/poanetwork/blockscout/pull/2456) - fetch pending transactions for geth ### Fixes +- [#2508](https://github.com/poanetwork/blockscout/pull/2508) - logs view columns fix - [#2503](https://github.com/poanetwork/blockscout/pull/2503) - Mitigate autocompletion library influence to page loading performance - [#2502](https://github.com/poanetwork/blockscout/pull/2502) - increase reward task timeout - [#2463](https://github.com/poanetwork/blockscout/pull/2463) - dark theme fixes From bdd388b4ac5faf5ac3499b28bcbb7d25670cc7fd Mon Sep 17 00:00:00 2001 From: maxgrapps Date: Tue, 6 Aug 2019 19:33:01 +0300 Subject: [PATCH 05/17] alert link fix --- apps/block_scout_web/assets/css/theme/_dark-theme.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/block_scout_web/assets/css/theme/_dark-theme.scss b/apps/block_scout_web/assets/css/theme/_dark-theme.scss index c0adb0a84b..fe807aea60 100644 --- a/apps/block_scout_web/assets/css/theme/_dark-theme.scss +++ b/apps/block_scout_web/assets/css/theme/_dark-theme.scss @@ -680,4 +680,9 @@ $labels-dark: #8a8dba; // header nav, labels color: #3f436b !important; border-right-color: #3f436b !important; } + + // alert link + .alert-link { + color: $dark-secondary; + } } \ No newline at end of file From 159a2bd072918ddaa40b3da547088de7cd53bb45 Mon Sep 17 00:00:00 2001 From: maxgrapps <50101080+maxgrapps@users.noreply.github.com> Date: Tue, 6 Aug 2019 19:35:35 +0300 Subject: [PATCH 06/17] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d1cc05b7..77b88f7ae1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#2456](https://github.com/poanetwork/blockscout/pull/2456) - fetch pending transactions for geth ### Fixes +- [#2512](https://github.com/poanetwork/blockscout/pull/2512) - alert link fix - [#2503](https://github.com/poanetwork/blockscout/pull/2503) - Mitigate autocompletion library influence to page loading performance - [#2502](https://github.com/poanetwork/blockscout/pull/2502) - increase reward task timeout - [#2463](https://github.com/poanetwork/blockscout/pull/2463) - dark theme fixes From 81eb64a9c411514795affeedd755e591fb5c7bc5 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 10:48:06 +0300 Subject: [PATCH 07/17] do not aggregate NFT token transfers --- .../block_scout_web/views/transaction_view.ex | 38 +++++++++++++------ .../views/transaction_view_test.exs | 14 +++++++ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex index 61a0d471b1..41c8eaf844 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex @@ -42,22 +42,36 @@ defmodule BlockScoutWeb.TransactionView do def aggregate_token_transfers(token_transfers) do token_transfers |> Enum.reduce(%{}, fn token_transfer, acc -> - new_entry = %{ - token: token_transfer.token, - amount: token_transfer.amount, - token_id: token_transfer.token_id - } - - existing_entry = Map.get(acc, token_transfer.token_contract_address, %{new_entry | amount: Decimal.new(0)}) - - Map.put(acc, token_transfer.token_contract_address, %{ - new_entry - | amount: Decimal.add(new_entry.amount, existing_entry.amount) - }) + aggregate_reducer(token_transfer, acc) end) |> Enum.map(fn {_key, value} -> value end) end + def aggregate_reducer(%{amount: amount} = token_transfer, acc) when is_nil(amount) do + new_entry = %{ + token: token_transfer.token, + amount: nil, + token_id: token_transfer.token_id + } + + Map.put(acc, token_transfer.token_contract_address, new_entry) + end + + def aggregate_reducer(token_transfer, acc) do + new_entry = %{ + token: token_transfer.token, + amount: token_transfer.amount, + token_id: token_transfer.token_id + } + + existing_entry = Map.get(acc, token_transfer.token_contract_address, %{new_entry | amount: Decimal.new(0)}) + + Map.put(acc, token_transfer.token_contract_address, %{ + new_entry + | amount: Decimal.add(new_entry.amount, existing_entry.amount) + }) + end + def token_type_name(type) do case type do :erc20 -> gettext("ERC-20 ") diff --git a/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs b/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs index 8598f3826a..179ffd6d33 100644 --- a/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs +++ b/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs @@ -268,5 +268,19 @@ defmodule BlockScoutWeb.TransactionViewTest do assert Enum.count(result) == 1 assert List.first(result).amount == Decimal.new(3) end + + test "does not aggregate NFT tokens" do + transaction = + :transaction + |> insert() + |> with_block() + + token_transfer = insert(:token_transfer, transaction: transaction, amount: nil) + + result = TransactionView.aggregate_token_transfers([token_transfer, token_transfer, token_transfer]) + + assert Enum.count(result) == 1 + assert List.first(result).amount == nil + end end end From 9b93475c13f1f74f8928f72136e639fae5aca846 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 10:49:58 +0300 Subject: [PATCH 08/17] add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae8b4df2c5..0138400a00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#2456](https://github.com/poanetwork/blockscout/pull/2456) - fetch pending transactions for geth ### Fixes +- [#2515](https://github.com/poanetwork/blockscout/pull/2515) - do not aggregate NFT token transfers - [#2503](https://github.com/poanetwork/blockscout/pull/2503) - Mitigate autocompletion library influence to page loading performance - [#2502](https://github.com/poanetwork/blockscout/pull/2502) - increase reward task timeout - [#2463](https://github.com/poanetwork/blockscout/pull/2463) - dark theme fixes From a290e262160b754d12b115b2b373a955cec8392c Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 10:52:46 +0300 Subject: [PATCH 09/17] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 36 +++++++++---------- .../priv/gettext/en/LC_MESSAGES/default.po | 36 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 95bb1f079b..b50cbe0b56 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -49,7 +49,7 @@ msgid "%{subnetwork} Explorer - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:163 +#: lib/block_scout_web/views/transaction_view.ex:177 msgid "(Awaiting internal transactions for status)" msgstr "" @@ -276,12 +276,12 @@ msgid "Contract Address Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:240 +#: lib/block_scout_web/views/transaction_view.ex:254 msgid "Contract Call" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:239 +#: lib/block_scout_web/views/transaction_view.ex:253 msgid "Contract Creation" msgstr "" @@ -356,12 +356,12 @@ msgid "Error trying to fetch balances." msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:167 +#: lib/block_scout_web/views/transaction_view.ex:181 msgid "Error: %{reason}" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:165 +#: lib/block_scout_web/views/transaction_view.ex:179 msgid "Error: (Awaiting internal transactions for reason)" msgstr "" @@ -466,7 +466,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/views/address_view.ex:306 -#: lib/block_scout_web/views/transaction_view.ex:293 +#: lib/block_scout_web/views/transaction_view.ex:307 msgid "Internal Transactions" msgstr "" @@ -493,7 +493,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/views/address_view.ex:312 -#: lib/block_scout_web/views/transaction_view.ex:294 +#: lib/block_scout_web/views/transaction_view.ex:308 msgid "Logs" msgstr "" @@ -506,8 +506,8 @@ msgid "Market Cap" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:148 -#: lib/block_scout_web/views/transaction_view.ex:148 +#: lib/block_scout_web/views/transaction_view.ex:162 +#: lib/block_scout_web/views/transaction_view.ex:162 msgid "Max of" msgstr "" @@ -598,8 +598,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:58 -#: lib/block_scout_web/views/transaction_view.ex:162 -#: lib/block_scout_web/views/transaction_view.ex:196 +#: lib/block_scout_web/views/transaction_view.ex:176 +#: lib/block_scout_web/views/transaction_view.ex:210 msgid "Pending" msgstr "" @@ -686,7 +686,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 -#: lib/block_scout_web/views/transaction_view.ex:164 +#: lib/block_scout_web/views/transaction_view.ex:178 msgid "Success" msgstr "" @@ -791,7 +791,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:5 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:4 -#: lib/block_scout_web/views/transaction_view.ex:238 +#: lib/block_scout_web/views/transaction_view.ex:252 msgid "Token Transfer" msgstr "" @@ -801,7 +801,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:4 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 #: lib/block_scout_web/views/tokens/overview_view.ex:35 -#: lib/block_scout_web/views/transaction_view.ex:292 +#: lib/block_scout_web/views/transaction_view.ex:306 msgid "Token Transfers" msgstr "" @@ -835,7 +835,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:3 -#: lib/block_scout_web/views/transaction_view.ex:241 +#: lib/block_scout_web/views/transaction_view.ex:255 msgid "Transaction" msgstr "" @@ -1499,7 +1499,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 -#: lib/block_scout_web/views/transaction_view.ex:295 +#: lib/block_scout_web/views/transaction_view.ex:309 msgid "Raw Trace" msgstr "" @@ -1707,12 +1707,12 @@ msgid "Change Network" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:63 +#: lib/block_scout_web/views/transaction_view.ex:77 msgid "ERC-20 " msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:64 +#: lib/block_scout_web/views/transaction_view.ex:78 msgid "ERC-721 " 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 6ecd22e7fa..5dd7061364 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 @@ -49,7 +49,7 @@ msgid "%{subnetwork} Explorer - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:163 +#: lib/block_scout_web/views/transaction_view.ex:177 msgid "(Awaiting internal transactions for status)" msgstr "" @@ -276,12 +276,12 @@ msgid "Contract Address Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:240 +#: lib/block_scout_web/views/transaction_view.ex:254 msgid "Contract Call" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:239 +#: lib/block_scout_web/views/transaction_view.ex:253 msgid "Contract Creation" msgstr "" @@ -356,12 +356,12 @@ msgid "Error trying to fetch balances." msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:167 +#: lib/block_scout_web/views/transaction_view.ex:181 msgid "Error: %{reason}" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:165 +#: lib/block_scout_web/views/transaction_view.ex:179 msgid "Error: (Awaiting internal transactions for reason)" msgstr "" @@ -466,7 +466,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/views/address_view.ex:306 -#: lib/block_scout_web/views/transaction_view.ex:293 +#: lib/block_scout_web/views/transaction_view.ex:307 msgid "Internal Transactions" msgstr "" @@ -493,7 +493,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/views/address_view.ex:312 -#: lib/block_scout_web/views/transaction_view.ex:294 +#: lib/block_scout_web/views/transaction_view.ex:308 msgid "Logs" msgstr "" @@ -506,8 +506,8 @@ msgid "Market Cap" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:148 -#: lib/block_scout_web/views/transaction_view.ex:148 +#: lib/block_scout_web/views/transaction_view.ex:162 +#: lib/block_scout_web/views/transaction_view.ex:162 msgid "Max of" msgstr "" @@ -598,8 +598,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:58 -#: lib/block_scout_web/views/transaction_view.ex:162 -#: lib/block_scout_web/views/transaction_view.ex:196 +#: lib/block_scout_web/views/transaction_view.ex:176 +#: lib/block_scout_web/views/transaction_view.ex:210 msgid "Pending" msgstr "" @@ -686,7 +686,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 -#: lib/block_scout_web/views/transaction_view.ex:164 +#: lib/block_scout_web/views/transaction_view.ex:178 msgid "Success" msgstr "" @@ -791,7 +791,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:5 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:4 -#: lib/block_scout_web/views/transaction_view.ex:238 +#: lib/block_scout_web/views/transaction_view.ex:252 msgid "Token Transfer" msgstr "" @@ -801,7 +801,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:4 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 #: lib/block_scout_web/views/tokens/overview_view.ex:35 -#: lib/block_scout_web/views/transaction_view.ex:292 +#: lib/block_scout_web/views/transaction_view.ex:306 msgid "Token Transfers" msgstr "" @@ -835,7 +835,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:3 -#: lib/block_scout_web/views/transaction_view.ex:241 +#: lib/block_scout_web/views/transaction_view.ex:255 msgid "Transaction" msgstr "" @@ -1500,7 +1500,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 -#: lib/block_scout_web/views/transaction_view.ex:295 +#: lib/block_scout_web/views/transaction_view.ex:309 msgid "Raw Trace" msgstr "" @@ -1708,12 +1708,12 @@ msgid "Change Network" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:63 +#: lib/block_scout_web/views/transaction_view.ex:77 msgid "ERC-20 " msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:64 +#: lib/block_scout_web/views/transaction_view.ex:78 msgid "ERC-721 " msgstr "" From 7d38bab8ad8ec0da43cdc210ed0c4ebf581e2e1b Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 11:01:59 +0300 Subject: [PATCH 10/17] show all nft tokens --- .../block_scout_web/views/transaction_view.ex | 33 +++++++++++-------- .../views/transaction_view_test.exs | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex index 41c8eaf844..13c2d1032f 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex @@ -40,36 +40,43 @@ defmodule BlockScoutWeb.TransactionView do end def aggregate_token_transfers(token_transfers) do - token_transfers - |> Enum.reduce(%{}, fn token_transfer, acc -> - aggregate_reducer(token_transfer, acc) - end) - |> Enum.map(fn {_key, value} -> value end) + {transfers, nft_transfers} = + token_transfers + |> Enum.reduce({%{}, []}, fn token_transfer, acc -> + aggregate_reducer(token_transfer, acc) + end) + + final_transfers = Enum.map(transfers, fn {_key, value} -> value end) + + final_transfers ++ nft_transfers end - def aggregate_reducer(%{amount: amount} = token_transfer, acc) when is_nil(amount) do + defp aggregate_reducer(%{amount: amount} = token_transfer, {acc1, acc2}) when is_nil(amount) do new_entry = %{ token: token_transfer.token, amount: nil, token_id: token_transfer.token_id } - Map.put(acc, token_transfer.token_contract_address, new_entry) + {acc1, [new_entry | acc2]} end - def aggregate_reducer(token_transfer, acc) do + defp aggregate_reducer(token_transfer, {acc1, acc2}) do new_entry = %{ token: token_transfer.token, amount: token_transfer.amount, token_id: token_transfer.token_id } - existing_entry = Map.get(acc, token_transfer.token_contract_address, %{new_entry | amount: Decimal.new(0)}) + existing_entry = Map.get(acc1, token_transfer.token_contract_address, %{new_entry | amount: Decimal.new(0)}) + + new_acc1 = + Map.put(acc1, token_transfer.token_contract_address, %{ + new_entry + | amount: Decimal.add(new_entry.amount, existing_entry.amount) + }) - Map.put(acc, token_transfer.token_contract_address, %{ - new_entry - | amount: Decimal.add(new_entry.amount, existing_entry.amount) - }) + {new_acc1, acc2} end def token_type_name(type) do diff --git a/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs b/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs index 179ffd6d33..69cca69f41 100644 --- a/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs +++ b/apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs @@ -279,7 +279,7 @@ defmodule BlockScoutWeb.TransactionViewTest do result = TransactionView.aggregate_token_transfers([token_transfer, token_transfer, token_transfer]) - assert Enum.count(result) == 1 + assert Enum.count(result) == 3 assert List.first(result).amount == nil end end From 10c28f84bf9e588cab19c879d0dda1166b612d73 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 11:02:31 +0300 Subject: [PATCH 11/17] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 36 +++++++++---------- .../priv/gettext/en/LC_MESSAGES/default.po | 36 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index b50cbe0b56..34db86b3a1 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -49,7 +49,7 @@ msgid "%{subnetwork} Explorer - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:177 +#: lib/block_scout_web/views/transaction_view.ex:184 msgid "(Awaiting internal transactions for status)" msgstr "" @@ -276,12 +276,12 @@ msgid "Contract Address Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:254 +#: lib/block_scout_web/views/transaction_view.ex:261 msgid "Contract Call" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:253 +#: lib/block_scout_web/views/transaction_view.ex:260 msgid "Contract Creation" msgstr "" @@ -356,12 +356,12 @@ msgid "Error trying to fetch balances." msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:181 +#: lib/block_scout_web/views/transaction_view.ex:188 msgid "Error: %{reason}" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:179 +#: lib/block_scout_web/views/transaction_view.ex:186 msgid "Error: (Awaiting internal transactions for reason)" msgstr "" @@ -466,7 +466,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/views/address_view.ex:306 -#: lib/block_scout_web/views/transaction_view.ex:307 +#: lib/block_scout_web/views/transaction_view.ex:314 msgid "Internal Transactions" msgstr "" @@ -493,7 +493,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/views/address_view.ex:312 -#: lib/block_scout_web/views/transaction_view.ex:308 +#: lib/block_scout_web/views/transaction_view.ex:315 msgid "Logs" msgstr "" @@ -506,8 +506,8 @@ msgid "Market Cap" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:162 -#: lib/block_scout_web/views/transaction_view.ex:162 +#: lib/block_scout_web/views/transaction_view.ex:169 +#: lib/block_scout_web/views/transaction_view.ex:169 msgid "Max of" msgstr "" @@ -598,8 +598,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:58 -#: lib/block_scout_web/views/transaction_view.ex:176 -#: lib/block_scout_web/views/transaction_view.ex:210 +#: lib/block_scout_web/views/transaction_view.ex:183 +#: lib/block_scout_web/views/transaction_view.ex:217 msgid "Pending" msgstr "" @@ -686,7 +686,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 -#: lib/block_scout_web/views/transaction_view.ex:178 +#: lib/block_scout_web/views/transaction_view.ex:185 msgid "Success" msgstr "" @@ -791,7 +791,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:5 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:4 -#: lib/block_scout_web/views/transaction_view.ex:252 +#: lib/block_scout_web/views/transaction_view.ex:259 msgid "Token Transfer" msgstr "" @@ -801,7 +801,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:4 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 #: lib/block_scout_web/views/tokens/overview_view.ex:35 -#: lib/block_scout_web/views/transaction_view.ex:306 +#: lib/block_scout_web/views/transaction_view.ex:313 msgid "Token Transfers" msgstr "" @@ -835,7 +835,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:3 -#: lib/block_scout_web/views/transaction_view.ex:255 +#: lib/block_scout_web/views/transaction_view.ex:262 msgid "Transaction" msgstr "" @@ -1499,7 +1499,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 -#: lib/block_scout_web/views/transaction_view.ex:309 +#: lib/block_scout_web/views/transaction_view.ex:316 msgid "Raw Trace" msgstr "" @@ -1707,12 +1707,12 @@ msgid "Change Network" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:77 +#: lib/block_scout_web/views/transaction_view.ex:84 msgid "ERC-20 " msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:78 +#: lib/block_scout_web/views/transaction_view.ex:85 msgid "ERC-721 " 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 5dd7061364..a5956c5c04 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 @@ -49,7 +49,7 @@ msgid "%{subnetwork} Explorer - BlockScout" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:177 +#: lib/block_scout_web/views/transaction_view.ex:184 msgid "(Awaiting internal transactions for status)" msgstr "" @@ -276,12 +276,12 @@ msgid "Contract Address Pending" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:254 +#: lib/block_scout_web/views/transaction_view.ex:261 msgid "Contract Call" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:253 +#: lib/block_scout_web/views/transaction_view.ex:260 msgid "Contract Creation" msgstr "" @@ -356,12 +356,12 @@ msgid "Error trying to fetch balances." msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:181 +#: lib/block_scout_web/views/transaction_view.ex:188 msgid "Error: %{reason}" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:179 +#: lib/block_scout_web/views/transaction_view.ex:186 msgid "Error: (Awaiting internal transactions for reason)" msgstr "" @@ -466,7 +466,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/views/address_view.ex:306 -#: lib/block_scout_web/views/transaction_view.ex:307 +#: lib/block_scout_web/views/transaction_view.ex:314 msgid "Internal Transactions" msgstr "" @@ -493,7 +493,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/views/address_view.ex:312 -#: lib/block_scout_web/views/transaction_view.ex:308 +#: lib/block_scout_web/views/transaction_view.ex:315 msgid "Logs" msgstr "" @@ -506,8 +506,8 @@ msgid "Market Cap" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:162 -#: lib/block_scout_web/views/transaction_view.ex:162 +#: lib/block_scout_web/views/transaction_view.ex:169 +#: lib/block_scout_web/views/transaction_view.ex:169 msgid "Max of" msgstr "" @@ -598,8 +598,8 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/layout/_topnav.html.eex:58 -#: lib/block_scout_web/views/transaction_view.ex:176 -#: lib/block_scout_web/views/transaction_view.ex:210 +#: lib/block_scout_web/views/transaction_view.ex:183 +#: lib/block_scout_web/views/transaction_view.ex:217 msgid "Pending" msgstr "" @@ -686,7 +686,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 -#: lib/block_scout_web/views/transaction_view.ex:178 +#: lib/block_scout_web/views/transaction_view.ex:185 msgid "Success" msgstr "" @@ -791,7 +791,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:5 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:4 -#: lib/block_scout_web/views/transaction_view.ex:252 +#: lib/block_scout_web/views/transaction_view.ex:259 msgid "Token Transfer" msgstr "" @@ -801,7 +801,7 @@ msgstr "" #: lib/block_scout_web/templates/transaction/_tabs.html.eex:4 #: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7 #: lib/block_scout_web/views/tokens/overview_view.ex:35 -#: lib/block_scout_web/views/transaction_view.ex:306 +#: lib/block_scout_web/views/transaction_view.ex:313 msgid "Token Transfers" msgstr "" @@ -835,7 +835,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/address_logs/_logs.html.eex:3 -#: lib/block_scout_web/views/transaction_view.ex:255 +#: lib/block_scout_web/views/transaction_view.ex:262 msgid "Transaction" msgstr "" @@ -1500,7 +1500,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 -#: lib/block_scout_web/views/transaction_view.ex:309 +#: lib/block_scout_web/views/transaction_view.ex:316 msgid "Raw Trace" msgstr "" @@ -1708,12 +1708,12 @@ msgid "Change Network" msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:77 +#: lib/block_scout_web/views/transaction_view.ex:84 msgid "ERC-20 " msgstr "" #, elixir-format -#: lib/block_scout_web/views/transaction_view.ex:78 +#: lib/block_scout_web/views/transaction_view.ex:85 msgid "ERC-721 " msgstr "" From d2c9c731bf09d03b9e9408cb89dc36aad1c09519 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 11:46:28 +0300 Subject: [PATCH 12/17] Update transaction_view.ex --- .../lib/block_scout_web/views/transaction_view.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex index 13c2d1032f..dfbf58eb6b 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex @@ -46,7 +46,7 @@ defmodule BlockScoutWeb.TransactionView do aggregate_reducer(token_transfer, acc) end) - final_transfers = Enum.map(transfers, fn {_key, value} -> value end) + final_transfers = Map.values(transfers) final_transfers ++ nft_transfers end From df40be6b3d3845b9bc58474eafac2c6fdfc8f298 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 12:36:57 +0300 Subject: [PATCH 13/17] update CHANGELOG description --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46df7dfe7c..0b863cc540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,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 -- [#2507](https://github.com/poanetwork/blockscout/pull/2507) - get rid of telemetry warnings +- [#2507](https://github.com/poanetwork/blockscout/pull/2507) - update minor version of ecto, ex_machina, phoenix_live_reload - [#2473](https://github.com/poanetwork/blockscout/pull/2473) - get rid of cldr warnings - [#2402](https://github.com/poanetwork/blockscout/pull/2402) - bump otp version to 22.0 - [#2492](https://github.com/poanetwork/blockscout/pull/2492) - hide decoded row if event is not decoded From 784cbe8c76a9c1740ca6acfb56d1b2f54bd899c5 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 12:55:24 +0300 Subject: [PATCH 14/17] update absinthe plug from fork --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index d225be02ca..f0145b26fb 100644 --- a/mix.lock +++ b/mix.lock @@ -3,7 +3,7 @@ "abnf2": {:hex, :abnf2, "0.1.2", "6f8792b8ac3288dba5fc889c2bceae9fe78f74e1a7b36bea9726ffaa9d7bef95", [:mix], []}, "absinthe": {:hex, :absinthe, "1.4.14", "fef224a6aac63d6eaafbc0cb96040a8abcd572275b9b4db69d46329acdcae7c7", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, "absinthe_phoenix": {:git, "https://github.com/ayrat555/absinthe_phoenix.git", "4104c7213c328c3698b52710d49cd6d85449305c", [branch: "master"]}, - "absinthe_plug": {:git, "https://github.com/ayrat555/absinthe_plug.git", "e74da0a6e004fe4126885b5f5f60a3e72abd70bb", [branch: "ab-allow-to-set-default-query"]}, + "absinthe_plug": {:git, "https://github.com/ayrat555/absinthe_plug.git", "d4320bd4f634d418e3478870ed09b518cb3bd750", [branch: "ab-allow-to-set-default-query"]}, "absinthe_relay": {:hex, :absinthe_relay, "1.4.6", "ec0e2288994b388556247cf9601245abec785cdf206d6e844f2992d29de21624", [:mix], [{:absinthe, "~> 1.4.0", [hex: :absinthe, repo: "hexpm", optional: false]}, {:ecto, "~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"}, "accept": {:hex, :accept, "0.3.3", "548ebb6fb2e8b0d170e75bb6123aea6ceecb0189bb1231eeadf52eac08384a97", [:rebar3], [], "hexpm"}, "artificery": {:hex, :artificery, "0.2.6", "f602909757263f7897130cbd006b0e40514a541b148d366ad65b89236b93497a", [:mix], [], "hexpm"}, From 34e8179e7dd6a25d5336b1b6ad238375a7f3969a Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 12:59:09 +0300 Subject: [PATCH 15/17] add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed41ca1f7..213c27d218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,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 +- [#2516](https://github.com/poanetwork/blockscout/pull/2516) - update absinthe plug from fork - [#2473](https://github.com/poanetwork/blockscout/pull/2473) - get rid of cldr warnings - [#2402](https://github.com/poanetwork/blockscout/pull/2402) - bump otp version to 22.0 - [#2492](https://github.com/poanetwork/blockscout/pull/2492) - hide decoded row if event is not decoded From d024cf0a4d211d08540c77c3b13fde4444648b19 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 7 Aug 2019 19:51:02 +0300 Subject: [PATCH 16/17] change fork branch --- apps/block_scout_web/mix.exs | 2 +- mix.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/block_scout_web/mix.exs b/apps/block_scout_web/mix.exs index 46867df947..ced5d67bcc 100644 --- a/apps/block_scout_web/mix.exs +++ b/apps/block_scout_web/mix.exs @@ -64,7 +64,7 @@ defmodule BlockScoutWeb.Mixfile do # Integrates Absinthe subscriptions with Phoenix {:absinthe_phoenix, git: "https://github.com/ayrat555/absinthe_phoenix.git", branch: "master"}, # Plug support for Absinthe - {:absinthe_plug, git: "https://github.com/ayrat555/absinthe_plug.git", branch: "ab-allow-to-set-default-query"}, + {:absinthe_plug, git: "https://github.com/ayrat555/absinthe_plug.git", branch: "ab-enable-default-query"}, # Absinthe support for the Relay framework {:absinthe_relay, "~> 1.4"}, {:bypass, "~> 1.0", only: :test}, diff --git a/mix.lock b/mix.lock index f0145b26fb..1bfd8fe1e1 100644 --- a/mix.lock +++ b/mix.lock @@ -2,8 +2,8 @@ "abi": {:hex, :abi, "0.1.12", "87ae04cb09e2308db7b3c350584dc3934de0e308f6a056ba82be5756b081a1ca", [:mix], [{:exth_crypto, "~> 0.1.4", [hex: :exth_crypto, repo: "hexpm", optional: false]}], "hexpm"}, "abnf2": {:hex, :abnf2, "0.1.2", "6f8792b8ac3288dba5fc889c2bceae9fe78f74e1a7b36bea9726ffaa9d7bef95", [:mix], []}, "absinthe": {:hex, :absinthe, "1.4.14", "fef224a6aac63d6eaafbc0cb96040a8abcd572275b9b4db69d46329acdcae7c7", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, - "absinthe_phoenix": {:git, "https://github.com/ayrat555/absinthe_phoenix.git", "4104c7213c328c3698b52710d49cd6d85449305c", [branch: "master"]}, - "absinthe_plug": {:git, "https://github.com/ayrat555/absinthe_plug.git", "d4320bd4f634d418e3478870ed09b518cb3bd750", [branch: "ab-allow-to-set-default-query"]}, + "absinthe_phoenix": {:git, "https://github.com/ayrat555/absinthe_phoenix.git", "0f5127844a9e4e1c5fecb1fcee225894a2af6336", [branch: "master"]}, + "absinthe_plug": {:git, "https://github.com/ayrat555/absinthe_plug.git", "cbe1c170e11e60b3b0146b925a1ce6ec562840ce", [branch: "ab-enable-default-query"]}, "absinthe_relay": {:hex, :absinthe_relay, "1.4.6", "ec0e2288994b388556247cf9601245abec785cdf206d6e844f2992d29de21624", [:mix], [{:absinthe, "~> 1.4.0", [hex: :absinthe, repo: "hexpm", optional: false]}, {:ecto, "~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"}, "accept": {:hex, :accept, "0.3.3", "548ebb6fb2e8b0d170e75bb6123aea6ceecb0189bb1231eeadf52eac08384a97", [:rebar3], [], "hexpm"}, "artificery": {:hex, :artificery, "0.2.6", "f602909757263f7897130cbd006b0e40514a541b148d366ad65b89236b93497a", [:mix], [], "hexpm"}, From 68bc91ede1dedcef65e8c5f98d9273a7f0c7035f Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 8 Aug 2019 12:14:55 +0300 Subject: [PATCH 17/17] update mix.lock --- mix.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.lock b/mix.lock index 1bfd8fe1e1..92fd054cb6 100644 --- a/mix.lock +++ b/mix.lock @@ -43,7 +43,7 @@ "ex_cldr_numbers": {:hex, :ex_cldr_numbers, "2.6.4", "5b1ac8451f889576bb29dee70412de1170974298727ab944aa4d17e91bdd3472", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 2.6", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_currencies, "~> 2.3", [hex: :ex_cldr_currencies, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "ex_cldr_units": {:hex, :ex_cldr_units, "2.5.1", "0e65067a22a7c5146266c313d6333c2700868c32aa6d536f47c6c0d84aac3ac1", [:mix], [{:ex_cldr, "~> 2.6", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_lists, "~> 2.2", [hex: :ex_cldr_lists, repo: "hexpm", optional: false]}, {:ex_cldr_numbers, "~> 2.6", [hex: :ex_cldr_numbers, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.19.2", "6f4081ccd9ed081b6dc0bd5af97a41e87f5554de469e7d76025fba535180565f", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, - "ex_machina": {:hex, :ex_machina, "2.2.2", "d84217a6fb7840ff771d2561b8aa6d74a0d8968e4b10ecc0d7e9890dc8fb1c6a", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_machina": {:hex, :ex_machina, "2.3.0", "92a5ad0a8b10ea6314b876a99c8c9e3f25f4dde71a2a835845b136b9adaf199a", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm"}, "ex_rlp": {:hex, :ex_rlp, "0.5.2", "7f4ce7bd55e543c054ce6d49629b01e9833c3462e3d547952be89865f39f2c58", [:mix], [], "hexpm"}, "ex_utils": {:hex, :ex_utils, "0.1.7", "2c133e0bcdc49a858cf8dacf893308ebc05bc5fba501dc3d2935e65365ec0bf3", [:mix], [], "hexpm"}, "exactor": {:hex, :exactor, "2.2.4", "5efb4ddeb2c48d9a1d7c9b465a6fffdd82300eb9618ece5d34c3334d5d7245b1", [:mix], []},
Method Id