From e56adc5a244ceafec7de10e239a2d55b89ed135c Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 31 Jul 2019 10:57:20 +0300 Subject: [PATCH 01/12] get rid of cldr warnings --- apps/block_scout_web/config/config.exs | 3 +-- apps/block_scout_web/lib/block_scout_web/cldr.ex | 7 +++++++ apps/block_scout_web/mix.exs | 7 +++---- mix.lock | 11 +++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 apps/block_scout_web/lib/block_scout_web/cldr.ex diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index 836a21ba02..9dae076638 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -58,8 +58,7 @@ config :block_scout_web, BlockScoutWeb.SocialMedia, config :ex_cldr, default_locale: "en", - locales: ["en"], - gettext: BlockScoutWeb.Gettext + default_backend: BlockScoutWeb.Cldr config :logger, :block_scout_web, # keep synced with `config/config.exs` diff --git a/apps/block_scout_web/lib/block_scout_web/cldr.ex b/apps/block_scout_web/lib/block_scout_web/cldr.ex new file mode 100644 index 0000000000..7fe203f56c --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/cldr.ex @@ -0,0 +1,7 @@ +defmodule BlockScoutWeb.Cldr do + use Cldr, + default_locale: "en", + locales: ["en"], + gettext: BlockScoutWeb.Gettext, + generate_docs: false +end diff --git a/apps/block_scout_web/mix.exs b/apps/block_scout_web/mix.exs index 623aba2089..606114a6f3 100644 --- a/apps/block_scout_web/mix.exs +++ b/apps/block_scout_web/mix.exs @@ -50,7 +50,6 @@ defmodule BlockScoutWeb.Mixfile do defp extra_applications, do: [ - :ex_cldr, :logger, :runtime_tools ] @@ -78,8 +77,8 @@ defmodule BlockScoutWeb.Mixfile do # Need until https://github.com/absinthe-graphql/absinthe_relay/pull/125 is released, then can be removed # The current `absinthe_relay` is compatible though as shown from that PR {:ecto, "~> 3.0", override: true}, - {:ex_cldr_numbers, "~> 1.0"}, - {:ex_cldr_units, "~> 1.0"}, + {:ex_cldr, "~> 2.0"}, + {:ex_cldr_units, "~> 2.5"}, {:ex_machina, "~> 2.1", only: [:test]}, # Code coverage {:excoveralls, "~> 0.10.0", only: [:test], github: "KronicDeth/excoveralls", branch: "circle-workflows"}, @@ -141,7 +140,7 @@ defmodule BlockScoutWeb.Mixfile do # See the documentation for `Mix` for more info on aliases. defp aliases do [ - compile: "compile --warnings-as-errors", + compile: "compile", "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"], test: [ diff --git a/mix.lock b/mix.lock index 09f449b928..9d9e2b09c6 100644 --- a/mix.lock +++ b/mix.lock @@ -15,6 +15,7 @@ "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], []}, "bypass": {:hex, :bypass, "1.0.0", "b78b3dcb832a71aca5259c1a704b2e14b55fd4e1327ff942598b4e7d1a7ad83d", [:mix], [{:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}], "hexpm"}, "certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, + "cldr_utils": {:hex, :cldr_utils, "2.3.0", "e7e8b5ad7494a929c1b620cc489c3aa3f6e7e5299584c1a934bbdb56d1a53c70", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], []}, "comeonin": {:hex, :comeonin, "4.1.2", "3eb5620fd8e35508991664b4c2b04dd41e52f1620b36957be837c1d7784b7592", [:mix], [{:argon2_elixir, "~> 1.2", [hex: :argon2_elixir, repo: "hexpm", optional: true]}, {:bcrypt_elixir, "~> 0.12.1 or ~> 1.0", [hex: :bcrypt_elixir, repo: "hexpm", optional: true]}, {:pbkdf2_elixir, "~> 0.12", [hex: :pbkdf2_elixir, repo: "hexpm", optional: true]}], "hexpm"}, "con_cache": {:hex, :con_cache, "0.13.1", "047e097ab2a8c6876e12d0c29e29a86d487b592df97b98e3e2abedad574e215d", [:mix], [], "hexpm"}, @@ -26,7 +27,7 @@ "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"}, - "decimal": {:hex, :decimal, "1.6.0", "bfd84d90ff966e1f5d4370bdd3943432d8f65f07d3bab48001aebd7030590dcc", [:mix], [], "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], []}, @@ -36,9 +37,11 @@ "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"}, "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]}]}, - "ex_cldr_numbers": {:hex, :ex_cldr_numbers, "1.2.0", "ef27299922da913ffad1ed296cacf28b6452fc1243b77301dc17c03276c6ee34", [:mix], [{:decimal, "~> 1.4", [hex: :decimal, optional: false]}, {:ex_cldr, "~> 1.3", [hex: :ex_cldr, optional: false]}, {:poison, "~> 2.1 or ~> 3.1", [hex: :poison, optional: false]}]}, - "ex_cldr_units": {:hex, :ex_cldr_units, "1.1.1", "b3c7256709bdeb3740a5f64ce2bce659eb9cf4cc1afb4cf94aba033b4a18bc5f", [:mix], [{:ex_cldr, "~> 1.0", [hex: :ex_cldr, optional: false]}, {:ex_cldr_numbers, "~> 1.0", [hex: :ex_cldr_numbers, optional: false]}]}, + "ex_cldr": {:hex, :ex_cldr, "2.7.0", "be0f1c88f1baeb8364395df7d3266a8d7f075ebaeb00d20db743b1d72fa47e55", [:mix], [{:cldr_utils, "~> 2.1", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.3.0", "bffae489416b8b05d4683403263f5d62aae17de70c24ff915a533541fea514de", [:mix], [{:ex_cldr, "~> 2.6", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_cldr_lists": {:hex, :ex_cldr_lists, "2.2.0", "b99f8752d098fc6ba5f083bbd0b25d0d01e36b0042155cf6abd5f205306ba849", [:mix], [{:ex_cldr, "~> 2.6", [hex: :ex_cldr, 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_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_rlp": {:hex, :ex_rlp, "0.5.2", "7f4ce7bd55e543c054ce6d49629b01e9833c3462e3d547952be89865f39f2c58", [:mix], [], "hexpm"}, From ea898957a192510e48d31fd00f93b7a79d82a601 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 31 Jul 2019 11:06:37 +0300 Subject: [PATCH 02/12] disable --warning-as-errors for now --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index c6c74689f9..f354634327 100644 --- a/mix.exs +++ b/mix.exs @@ -54,7 +54,7 @@ defmodule BlockScout.Mixfile do defp env_aliases(_env) do [ - compile: "compile --warnings-as-errors" + compile: "compile" ] end From b15d650a39e9e7f90a69738de6f29bf6504d896b Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 31 Jul 2019 11:27:29 +0300 Subject: [PATCH 03/12] add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c7ef4b7c1..8c6ab0d5bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,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 +- [#2473](https://github.com/poanetwork/blockscout/pull/2473) - get rid of cldr warnings - [#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 - [#2450](https://github.com/poanetwork/blockscout/pull/2450) - Fix clearance of logs and node_modules folders in clearing script From 0cf0b215887a514d4d3d6ebaabb2738321dd6ab1 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Wed, 31 Jul 2019 12:07:45 +0300 Subject: [PATCH 04/12] update ex_cldr to 2.7.2 --- apps/block_scout_web/lib/block_scout_web/cldr.ex | 3 ++- apps/block_scout_web/mix.exs | 7 ++++--- apps/explorer/mix.exs | 4 ++-- mix.exs | 2 +- mix.lock | 14 +++++++------- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/cldr.ex b/apps/block_scout_web/lib/block_scout_web/cldr.ex index 7fe203f56c..bdcef408cf 100644 --- a/apps/block_scout_web/lib/block_scout_web/cldr.ex +++ b/apps/block_scout_web/lib/block_scout_web/cldr.ex @@ -3,5 +3,6 @@ defmodule BlockScoutWeb.Cldr do default_locale: "en", locales: ["en"], gettext: BlockScoutWeb.Gettext, - generate_docs: false + generate_docs: false, + providers: [Cldr.Number, Cldr.Unit] end diff --git a/apps/block_scout_web/mix.exs b/apps/block_scout_web/mix.exs index 606114a6f3..797e347465 100644 --- a/apps/block_scout_web/mix.exs +++ b/apps/block_scout_web/mix.exs @@ -77,8 +77,9 @@ defmodule BlockScoutWeb.Mixfile do # Need until https://github.com/absinthe-graphql/absinthe_relay/pull/125 is released, then can be removed # The current `absinthe_relay` is compatible though as shown from that PR {:ecto, "~> 3.0", override: true}, - {:ex_cldr, "~> 2.0"}, - {:ex_cldr_units, "~> 2.5"}, + {:ex_cldr, "2.7.2"}, + {:ex_cldr_numbers, "2.6.4"}, + {:cldr_utils, "2.3.0"}, {:ex_machina, "~> 2.1", only: [:test]}, # Code coverage {:excoveralls, "~> 0.10.0", only: [:test], github: "KronicDeth/excoveralls", branch: "circle-workflows"}, @@ -140,7 +141,7 @@ defmodule BlockScoutWeb.Mixfile do # See the documentation for `Mix` for more info on aliases. defp aliases do [ - compile: "compile", + compile: "compile --warnings-as-errors", "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"], test: [ diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs index b9b887f838..2570f160e5 100644 --- a/apps/explorer/mix.exs +++ b/apps/explorer/mix.exs @@ -76,7 +76,7 @@ defmodule Explorer.Mixfile do # `override: true` for `ex_machina` compatibility {:ecto, "~> 3.0", 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 @@ -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.exs b/mix.exs index f354634327..c6c74689f9 100644 --- a/mix.exs +++ b/mix.exs @@ -54,7 +54,7 @@ defmodule BlockScout.Mixfile do defp env_aliases(_env) do [ - compile: "compile" + compile: "compile --warnings-as-errors" ] end diff --git a/mix.lock b/mix.lock index 9d9e2b09c6..44eb0b3048 100644 --- a/mix.lock +++ b/mix.lock @@ -26,18 +26,18 @@ "credo": {:hex, :credo, "1.0.0", "aaa40fdd0543a0cf8080e8c5949d8c25f0a24e4fc8c1d83d06c388f5e5e0ea42", [: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, "2.7.0", "be0f1c88f1baeb8364395df7d3266a8d7f075ebaeb00d20db743b1d72fa47e55", [:mix], [{:cldr_utils, "~> 2.1", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_cldr": {:hex, :ex_cldr, "2.7.2", "d79a1af6ed12630a15175d2b88d4381b22db5d6f835c5da8de132f0cf712b233", [:mix], [{:cldr_utils, "~> 2.1", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, "ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.3.0", "bffae489416b8b05d4683403263f5d62aae17de70c24ff915a533541fea514de", [:mix], [{:ex_cldr, "~> 2.6", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "ex_cldr_lists": {:hex, :ex_cldr_lists, "2.2.0", "b99f8752d098fc6ba5f083bbd0b25d0d01e36b0042155cf6abd5f205306ba849", [:mix], [{:ex_cldr, "~> 2.6", [hex: :ex_cldr, 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_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"}, @@ -90,12 +90,12 @@ "phoenix_html": {:hex, :phoenix_html, "2.13.1", "fa8f034b5328e2dfa0e4131b5569379003f34bc1fafdaa84985b0b9d2f12e68b", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.0", "3bb31a9fbd40ffe8652e60c8660dffd72dd231efcdf49b744fb75b9ef7db5dd2", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"}, - "plug": {:hex, :plug, "1.7.2", "d7b7db7fbd755e8283b6c0a50be71ec0a3d67d9213d74422d9372effc8e87fd1", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"}, + "plug": {:hex, :plug, "1.8.3", "12d5f9796dc72e8ac9614e94bda5e51c4c028d0d428e9297650d09e15a684478", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, "plug_cowboy": {:hex, :plug_cowboy, "2.0.1", "d798f8ee5acc86b7d42dbe4450b8b0dadf665ce588236eb0a751a132417a980e", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "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"}, @@ -112,7 +112,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 0635297ea01d72a0a973d6995f68fe247d3f9d90 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 10:13:20 +0300 Subject: [PATCH 05/12] rename conflicting module --- .../block_scout_web/views/{cldr => cldr_helper}/number.ex | 2 +- .../lib/block_scout_web/views/currency_helpers.ex | 2 +- apps/block_scout_web/mix.exs | 7 ++++--- apps/explorer/mix.exs | 7 +------ mix.lock | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) rename apps/block_scout_web/lib/block_scout_web/views/{cldr => cldr_helper}/number.ex (95%) diff --git a/apps/block_scout_web/lib/block_scout_web/views/cldr/number.ex b/apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex similarity index 95% rename from apps/block_scout_web/lib/block_scout_web/views/cldr/number.ex rename to apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex index 2484646a74..bacd37564a 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/cldr/number.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex @@ -1,4 +1,4 @@ -defmodule BlockScoutWeb.Cldr.Number do +defmodule BlockScoutWeb.CldrHelper.Number do @moduledoc """ Work-arounds for `Cldr.Number` bugs """ diff --git a/apps/block_scout_web/lib/block_scout_web/views/currency_helpers.ex b/apps/block_scout_web/lib/block_scout_web/views/currency_helpers.ex index d79be3b31e..2aad5b013c 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/currency_helpers.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/currency_helpers.ex @@ -3,7 +3,7 @@ defmodule BlockScoutWeb.CurrencyHelpers do Helper functions for interacting with `t:BlockScoutWeb.ExchangeRates.USD.t/0` values. """ - alias BlockScoutWeb.Cldr.Number + alias BlockScoutWeb.CldrHelper.Number @doc """ Formats the given integer value to a currency format. diff --git a/apps/block_scout_web/mix.exs b/apps/block_scout_web/mix.exs index a15bfdcd78..46867df947 100644 --- a/apps/block_scout_web/mix.exs +++ b/apps/block_scout_web/mix.exs @@ -77,9 +77,10 @@ defmodule BlockScoutWeb.Mixfile do # Need until https://github.com/absinthe-graphql/absinthe_relay/pull/125 is released, then can be removed # The current `absinthe_relay` is compatible though as shown from that PR {:ecto, "~> 3.0", override: true}, - {:ex_cldr, "2.7.2"}, - {:ex_cldr_numbers, "2.6.4"}, - {:cldr_utils, "2.3.0"}, + {:ex_cldr, "~> 2.7"}, + {:ex_cldr_numbers, "~> 2.6"}, + {:ex_cldr_units, "~> 2.5"}, + {:cldr_utils, "~> 2.3"}, {:ex_machina, "~> 2.1", only: [:test]}, # Code coverage {:excoveralls, "~> 0.10.0", only: [:test], github: "KronicDeth/excoveralls", branch: "circle-workflows"}, diff --git a/apps/explorer/mix.exs b/apps/explorer/mix.exs index 54597163cc..37bfc881eb 100644 --- a/apps/explorer/mix.exs +++ b/apps/explorer/mix.exs @@ -98,12 +98,7 @@ defmodule Explorer.Mixfile do # For compatibility with `prometheus_process_collector`, which hasn't been updated yet {:prometheus, "~> 4.0", override: true}, # Prometheus metrics for query duration - { - :prometheus_ecto, - "~> 1.3", - # Ecto 3.0 compatibility - github: "deadtrickster/prometheus-ecto", ref: "650a403183f6a2fb6b682d7fbcba8bf9d24fe1e4" - }, + {:prometheus_ecto, "~> 1.4.3"}, # bypass optional dependency {:plug_cowboy, "~> 2.0", only: [:dev, :test]}, {:que, "~> 0.10.1"}, diff --git a/mix.lock b/mix.lock index eb373a9f15..d225be02ca 100644 --- a/mix.lock +++ b/mix.lock @@ -97,7 +97,7 @@ "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "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_ecto": {:hex, :prometheus_ecto, "1.4.3", "3dd4da1812b8e0dbee81ea58bb3b62ed7588f2eae0c9e97e434c46807ff82311", [:mix], [{:ecto, "~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm"}, "prometheus_ex": {:hex, :prometheus_ex, "3.0.3", "5d722263bb1f7a9b1d02554de42e61ea672b4e3c07c3f74e23ce35ab5e111cfa", [:mix], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm"}, "prometheus_phoenix": {:hex, :prometheus_phoenix, "1.2.1", "964a74dfbc055f781d3a75631e06ce3816a2913976d1df7830283aa3118a797a", [:mix], [{:phoenix, "~> 1.3", [hex: :phoenix, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.3 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm"}, "prometheus_plugs": {:hex, :prometheus_plugs, "1.1.5", "25933d48f8af3a5941dd7b621c889749894d8a1082a6ff7c67cc99dec26377c5", [:mix], [{:accept, "~> 0.1", [hex: :accept, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}, {:prometheus_process_collector, "~> 1.1", [hex: :prometheus_process_collector, repo: "hexpm", optional: true]}], "hexpm"}, From 761fb05256509eaf27fee414977baba0345ee37f Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 10:19:05 +0300 Subject: [PATCH 06/12] fix credo --- apps/block_scout_web/lib/block_scout_web/cldr.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/block_scout_web/lib/block_scout_web/cldr.ex b/apps/block_scout_web/lib/block_scout_web/cldr.ex index bdcef408cf..7b9d77d7e2 100644 --- a/apps/block_scout_web/lib/block_scout_web/cldr.ex +++ b/apps/block_scout_web/lib/block_scout_web/cldr.ex @@ -1,4 +1,8 @@ defmodule BlockScoutWeb.Cldr do + @moduledoc """ + Cldr global configuration. + """ + use Cldr, default_locale: "en", locales: ["en"], From 2a5c63b5e550a0af2a1f36dc76e2aef86b0045e7 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 11:04:52 +0300 Subject: [PATCH 07/12] fix CLDR issues --- .../lib/block_scout_web/channels/address_channel.ex | 2 +- .../lib/block_scout_web/templates/address/overview.html.eex | 4 ++-- .../lib/block_scout_web/templates/block/overview.html.eex | 4 ++-- .../lib/block_scout_web/templates/chain/show.html.eex | 6 +++--- .../lib/block_scout_web/views/address_view.ex | 2 +- .../block_scout_web/lib/block_scout_web/views/block_view.ex | 4 ++-- .../lib/block_scout_web/views/transaction_view.ex | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex b/apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex index 4009d4f461..c13692f7ea 100644 --- a/apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex +++ b/apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex @@ -73,7 +73,7 @@ defmodule BlockScoutWeb.AddressChannel do def handle_out("count", %{count: count}, socket) do Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale) - push(socket, "count", %{count: Cldr.Number.to_string!(count, format: "#,###")}) + push(socket, "count", %{count: BlockScoutWeb.Cldr.Number.to_string!(count, format: "#,###")}) {:noreply, socket} end diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex index 04e7c2c036..9f20f28458 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex @@ -79,7 +79,7 @@ <%= gettext("Incoming Transactions") %> <% else %> - <%= Cldr.Number.to_string!(@transaction_count, format: "#,###") %> + <%= BlockScoutWeb.Cldr.Number.to_string!(@transaction_count, format: "#,###") %> <%= gettext("Transactions Sent") %> <% end %> @@ -92,7 +92,7 @@ <%= if validator?(@validation_count) do %> - <%= Cldr.Number.to_string!(@validation_count, format: "#,###") %> + <%= BlockScoutWeb.Cldr.Number.to_string!(@validation_count, format: "#,###") %> <%= gettext("Blocks Validated") %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex index 24b2d9e61a..2dd56f5bab 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex @@ -98,7 +98,7 @@
<%= gettext "Gas Used" %>
<%= @block.gas_used |> Cldr.Number.to_string! %> - (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> Cldr.Number.to_string!(format: "#.#%") %>) + (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)
@@ -147,7 +147,7 @@

<%= @block.gas_used |> Cldr.Number.to_string! %> - (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> Cldr.Number.to_string!(format: "#.#%") %>) + (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)

<%= @block.gas_limit |> Cldr.Number.to_string! %><%= gettext "Gas Limit" %>

diff --git a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex index 53b21cb3fa..8285d429e0 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex @@ -56,7 +56,7 @@ <%= gettext "Total transactions" %> - <%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %> + <%= BlockScoutWeb.Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %>
@@ -64,7 +64,7 @@ <%= gettext "Total blocks" %> - <%= Cldr.Number.to_string!(@block_count, format: "#,###") %> + <%= BlockScoutWeb.Cldr.Number.to_string!(@block_count, format: "#,###") %>
@@ -72,7 +72,7 @@ <%= gettext "Wallet addresses" %> - <%= Cldr.Number.to_string!(@address_count, format: "#,###") %> + <%= BlockScoutWeb.Cldr.Number.to_string!(@address_count, format: "#,###") %>
diff --git a/apps/block_scout_web/lib/block_scout_web/views/address_view.ex b/apps/block_scout_web/lib/block_scout_web/views/address_view.ex index f93b8bcb0b..15405beecb 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/address_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/address_view.ex @@ -222,7 +222,7 @@ defmodule BlockScoutWeb.AddressView do def incoming_transaction_count(address_hash) do address_hash |> Chain.address_to_incoming_transaction_count() - |> Cldr.Number.to_string!(format: "#,###") + |> BlockScoutWeb.Cldr.Number.to_string!(format: "#,###") end def trimmed_hash(%Hash{} = hash) do diff --git a/apps/block_scout_web/lib/block_scout_web/views/block_view.ex b/apps/block_scout_web/lib/block_scout_web/views/block_view.ex index e475e7ace9..7aa53637ff 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/block_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/block_view.ex @@ -33,7 +33,7 @@ defmodule BlockScoutWeb.BlockView do # We do this to trick Dialyzer to not complain about non-local returns caused by bug in Cldr.Unit.to_string! spec case :erlang.phash2(1, 1) do 0 -> - Cldr.Unit.to_string!(unit) + BlockScoutWeb.Cldr.Unit.to_string!(unit) 1 -> # does not occur @@ -42,7 +42,7 @@ defmodule BlockScoutWeb.BlockView do end def formatted_gas(gas, format \\ []) do - Cldr.Number.to_string!(gas, format) + BlockScoutWeb.Cldr.Number.to_string!(gas, format) end def formatted_timestamp(%Block{timestamp: timestamp}) do 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 1ed50d28ab..e72879c4ab 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 @@ -100,7 +100,7 @@ defmodule BlockScoutWeb.TransactionView do %Block{consensus: true} -> {:ok, confirmations} = Chain.confirmations(block, named_arguments) - Cldr.Number.to_string!(confirmations, format: "#,###") + BlockScoutWeb.Cldr.Number.to_string!(confirmations, format: "#,###") end end From b1dd27016d81b04c1029b7a9c5e7e1fe5997d908 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 11:46:20 +0300 Subject: [PATCH 08/12] set correct Cldr module --- .../templates/block/overview.html.eex | 12 ++++++------ .../lib/block_scout_web/views/block_view.ex | 2 +- .../lib/block_scout_web/views/cldr_helper/number.ex | 6 +++--- .../lib/block_scout_web/views/transaction_view.ex | 4 ++-- .../lib/block_scout_web/views/wei_helpers.ex | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex index 2dd56f5bab..65e785920f 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex @@ -57,7 +57,7 @@
<%= gettext "Difficulty" %>
- <%= @block.difficulty |> Cldr.Number.to_string! %> + <%= @block.difficulty |> BlockScoutWeb.Cldr.Number.to_string! %>
@@ -65,7 +65,7 @@
<%= gettext "Total Difficulty" %>
-
<%= @block.total_difficulty |> Cldr.Number.to_string! %>
+
<%= @block.total_difficulty |> BlockScoutWeb.Cldr.Number.to_string! %>
@@ -97,14 +97,14 @@
<%= gettext "Gas Used" %>
- <%= @block.gas_used |> Cldr.Number.to_string! %> + <%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %> (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)
<%= gettext "Gas Limit" %>
- <%= Cldr.Number.to_string!(@block.gas_limit) %> + <%= BlockScoutWeb.Cldr.Number.to_string!(@block.gas_limit) %>
<% end %> @@ -146,10 +146,10 @@

<%= gettext "Gas Used" %>

- <%= @block.gas_used |> Cldr.Number.to_string! %> + <%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %> (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)

-

<%= @block.gas_limit |> Cldr.Number.to_string! %><%= gettext "Gas Limit" %>

+

<%= @block.gas_limit |> BlockScoutWeb.Cldr.Number.to_string! %><%= gettext "Gas Limit" %>

<% end %> diff --git a/apps/block_scout_web/lib/block_scout_web/views/block_view.ex b/apps/block_scout_web/lib/block_scout_web/views/block_view.ex index 7aa53637ff..f30f385c86 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/block_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/block_view.ex @@ -15,7 +15,7 @@ defmodule BlockScoutWeb.BlockView do |> Enum.map(&Decimal.to_float(Wei.to(&1.gas_price, :gwei))) |> mean() |> Kernel.||(0) - |> Cldr.Number.to_string!() + |> BlockScoutWeb.Cldr.Number.to_string!() unit_text = gettext("Gwei") diff --git a/apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex b/apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex index bacd37564a..e5b946e416 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/cldr_helper/number.ex @@ -7,7 +7,7 @@ defmodule BlockScoutWeb.CldrHelper.Number do # We do this to trick Dialyzer to not complain about non-local returns caused by bug in Cldr.Number.to_string spec case :erlang.phash2(1, 1) do 0 -> - Cldr.Number.to_string(decimal, options) + BlockScoutWeb.Cldr.Number.to_string(decimal, options) 1 -> # does not occur @@ -19,7 +19,7 @@ defmodule BlockScoutWeb.CldrHelper.Number do # We do this to trick Dialyzer to not complain about non-local returns caused by bug in Cldr.Number.to_string! spec case :erlang.phash2(1, 1) do 0 -> - Cldr.Number.to_string!(decimal) + BlockScoutWeb.Cldr.Number.to_string!(decimal) 1 -> # does not occur @@ -31,7 +31,7 @@ defmodule BlockScoutWeb.CldrHelper.Number do # We do this to trick Dialyzer to not complain about non-local returns caused by bug in Cldr.Number.to_string! spec case :erlang.phash2(1, 1) do 0 -> - Cldr.Number.to_string!(decimal, options) + BlockScoutWeb.Cldr.Number.to_string!(decimal, options) 1 -> # does not occur 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 e72879c4ab..b1429f1dbc 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 @@ -2,7 +2,7 @@ defmodule BlockScoutWeb.TransactionView do use BlockScoutWeb, :view alias BlockScoutWeb.{AddressView, BlockView, TabHelpers} - alias Cldr.Number + alias BlockScoutWeb.Cldr.Number alias Explorer.{Chain, Repo} alias Explorer.Chain.Block.Reward alias Explorer.Chain.{Address, Block, InternalTransaction, Transaction, Wei} @@ -156,7 +156,7 @@ defmodule BlockScoutWeb.TransactionView do end def gas(%type{gas: gas}) when is_transaction_type(type) do - Cldr.Number.to_string!(gas) + BlockScoutWeb.Cldr.Number.to_string!(gas) end def skip_decoding?(transaction) do diff --git a/apps/block_scout_web/lib/block_scout_web/views/wei_helpers.ex b/apps/block_scout_web/lib/block_scout_web/views/wei_helpers.ex index 5cdbff8c0c..c9dfefa7b7 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/wei_helpers.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/wei_helpers.ex @@ -5,7 +5,7 @@ defmodule BlockScoutWeb.WeiHelpers do import BlockScoutWeb.Gettext - alias BlockScoutWeb.Cldr + alias BlockScoutWeb.CldrHelper alias Explorer.Chain.Wei @valid_units ~w(wei gwei ether)a @@ -60,9 +60,9 @@ defmodule BlockScoutWeb.WeiHelpers do formatted_value = if Decimal.cmp(converted_value, 1_000_000_000_000) == :gt do - Cldr.Number.to_string!(converted_value, format: "0.###E+0") + CldrHelper.Number.to_string!(converted_value, format: "0.###E+0") else - Cldr.Number.to_string!(converted_value, format: "#,##0.##################") + CldrHelper.Number.to_string!(converted_value, format: "#,##0.##################") end if Keyword.get(options, :include_unit_label, true) do From ceb9de69af3c3028a730b5615a3bcdec0130334e Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 12:33:53 +0300 Subject: [PATCH 09/12] fix graphql schema type --- apps/block_scout_web/lib/block_scout_web/schema/types.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/schema/types.ex b/apps/block_scout_web/lib/block_scout_web/schema/types.ex index 029b322f9c..aabd84b9aa 100644 --- a/apps/block_scout_web/lib/block_scout_web/schema/types.ex +++ b/apps/block_scout_web/lib/block_scout_web/schema/types.ex @@ -137,7 +137,7 @@ defmodule BlockScoutWeb.Schema.Types do field(:r, :decimal) field(:s, :decimal) field(:status, :status) - field(:v, :integer) + field(:v, :decimal) field(:value, :wei) field(:from_address_hash, :address_hash) field(:to_address_hash, :address_hash) From 0b1655921dd29c2f16edc13574ec3d6a2e71fa5e Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 12:53:42 +0300 Subject: [PATCH 10/12] fix total supply rpc --- .../lib/block_scout_web/views/api/rpc/stats_view.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/views/api/rpc/stats_view.ex b/apps/block_scout_web/lib/block_scout_web/views/api/rpc/stats_view.ex index 8d88181a5d..bdc5e28b0e 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/api/rpc/stats_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/api/rpc/stats_view.ex @@ -4,7 +4,7 @@ defmodule BlockScoutWeb.API.RPC.StatsView do alias BlockScoutWeb.API.RPC.RPCView def render("tokensupply.json", token_supply) do - RPCView.render("show.json", data: token_supply) + RPCView.render("show.json", data: Decimal.to_string(token_supply)) end def render("ethsupply.json", %{total_supply: total_supply}) do From f0e8ba8cb67fb7fa0b97e5eaa5687d78dcf055c1 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 1 Aug 2019 13:24:56 +0300 Subject: [PATCH 11/12] fix indexed ratio type --- apps/block_scout_web/lib/block_scout_web/notifier.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/notifier.ex b/apps/block_scout_web/lib/block_scout_web/notifier.ex index 2fbe17537b..aa47163c98 100644 --- a/apps/block_scout_web/lib/block_scout_web/notifier.ex +++ b/apps/block_scout_web/lib/block_scout_web/notifier.ex @@ -126,7 +126,7 @@ defmodule BlockScoutWeb.Notifier do """ def broadcast_blocks_indexed_ratio(ratio, finished?) do Endpoint.broadcast("blocks:indexing", "index_status", %{ - ratio: ratio, + ratio: Decimal.to_string(ratio), finished: finished? }) end From da52997fdc53f81abd66d8a9deb87a6197ed6ab3 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 7 Aug 2019 14:54:10 +0300 Subject: [PATCH 12/12] Update PULL_REQUEST_TEMPLATE.md DB indices check --- PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 09dbdd6b2f..9b367a8dc8 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -36,3 +36,4 @@ - [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again. - [ ] I checked whether I should update the docs and did so if necessary - [ ] If I added/changed/removed ENV var, I should update the list of env vars in https://github.com/poanetwork/blockscout/blob/master/docs/env-variables.md to reflect changes in the table here https://poanetwork.github.io/blockscout/#/env-variables?id=blockscout-env-variables + - [ ] If I add new indices into DB, I checked, that they don't redundant with PGHero or other tools