From 5409faf7e371716bb53fcfd06aeb9fb940ef3ed8 Mon Sep 17 00:00:00 2001 From: Doc Ritezel Date: Mon, 5 Feb 2018 20:37:02 -0800 Subject: [PATCH] Upgrade ethereumex --- .dialyzer-ignore | 1 + .tool-versions | 2 +- circle.yml | 9 +++++++-- config/config.exs | 4 +--- config/prod.exs | 4 +--- config/test.exs | 4 +--- elixir_buildpack.config | 2 +- lib/explorer/skipped_blocks.ex | 10 +++++----- lib/mix/tasks/exq.start.ex | 6 ++---- mix.exs | 5 +++-- mix.lock | 8 ++++---- 11 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.dialyzer-ignore b/.dialyzer-ignore index 78c9daf302..1993ebca1d 100644 --- a/.dialyzer-ignore +++ b/.dialyzer-ignore @@ -1,2 +1,3 @@ :0: Unknown function 'Elixir.ExUnit.Callbacks':'__merge__'/3 :0: Unknown function 'Elixir.ExUnit.CaseTemplate':'__proxy__'/2 +:0: Unknown type 'Elixir.Map':t/0 diff --git a/.tool-versions b/.tool-versions index 0313b53e59..d44ed439b8 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -elixir 1.5.3 +elixir 1.6.1 erlang 20.2 ruby 2.4.1 diff --git a/circle.yml b/circle.yml index 5c920d1d7b..dd0d3d793e 100644 --- a/circle.yml +++ b/circle.yml @@ -36,10 +36,15 @@ dependencies: - awk '/ruby/ { print $2 }' .tool-versions | xargs asdf install ruby: timeout: 3600 - gem install bundler + - mix local.hex --force: + timeout: 3600 + - mix local.rebar --force: + timeout: 3600 override: - - yes | mix do deps.get, local.rebar, deps.compile, compile + - mix do deps.get, deps.compile, compile - bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 - - mix dialyzer --plt + - mix dialyzer --plt: + timeout: 3600 - cd assets && yarn install && yarn build && cd .. cache_directories: - ~/.asdf diff --git a/config/config.exs b/config/config.exs index 1e50eeb817..c785014d8b 100644 --- a/config/config.exs +++ b/config/config.exs @@ -27,9 +27,7 @@ config :logger, :console, metadata: [:request_id] config :ethereumex, - scheme: "http", - host: "localhost", - port: 8545 + url: "http://localhost:8545" config :new_relixir, active: false diff --git a/config/prod.exs b/config/prod.exs index e0fc46c77e..bef5bd3fc2 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -43,9 +43,7 @@ config :new_relixir, # Configure Web3 config :ethereumex, - scheme: System.get_env("ETHEREUM_SCHEME"), - host: System.get_env("ETHEREUM_HOST"), - port: System.get_env("ETHEREUM_PORT") + url: System.get_env("ETHEREUM_URL") # Configure Quantum config :explorer, Explorer.Scheduler, diff --git a/config/test.exs b/config/test.exs index 09c8358db7..65ae14d20c 100644 --- a/config/test.exs +++ b/config/test.exs @@ -26,6 +26,4 @@ config :wallaby, # Configure ethereumex config :ethereumex, - scheme: "https", - host: "sokol.poa.network", - port: 443 + url: "https://sokol.poa.network" diff --git a/elixir_buildpack.config b/elixir_buildpack.config index 6b8f64debe..597899b969 100644 --- a/elixir_buildpack.config +++ b/elixir_buildpack.config @@ -1,3 +1,3 @@ erlang_version=20.2 -elixir_version=1.5.3 +elixir_version=1.6.1 always_rebuild=true diff --git a/lib/explorer/skipped_blocks.ex b/lib/explorer/skipped_blocks.ex index 9745597428..02660df37b 100644 --- a/lib/explorer/skipped_blocks.ex +++ b/lib/explorer/skipped_blocks.ex @@ -6,17 +6,17 @@ defmodule Explorer.SkippedBlocks do alias Explorer.Block alias Explorer.Repo.NewRelic, as: Repo - @missing "SELECT generate_series(?, 0, -1) AS missing_number" + @missing_number_query "SELECT generate_series(?, 0, -1) AS missing_number" def first, do: first(1) def first(count) do blocks = from b in Block, - right_join: missing_number in fragment(@missing, ^latest_block_number()), + right_join: fragment(@missing_number_query, ^latest_block_number()), on: b.number == fragment("missing_number"), - limit: ^count, + select: fragment("missing_number::text"), where: is_nil(b.id), - select: fragment("missing_number") - Repo.all(blocks) |> Enum.map(&Integer.to_string/1) + limit: ^count + Repo.all(blocks) end def latest_block_number do diff --git a/lib/mix/tasks/exq.start.ex b/lib/mix/tasks/exq.start.ex index 5f20ccb3fc..8b15ba49d1 100644 --- a/lib/mix/tasks/exq.start.ex +++ b/lib/mix/tasks/exq.start.ex @@ -1,11 +1,9 @@ defmodule Mix.Tasks.Exq.Start do + @moduledoc "Starts the Exq worker" + use Mix.Task alias Explorer.Repo alias Explorer.Scheduler - use Mix.Task - - @moduledoc "Starts the Exq worker" - def run(_args) do [:postgrex, :ecto, :ethereumex, :tzdata] |> Enum.each(&Application.ensure_all_started/1) diff --git a/mix.exs b/mix.exs index 6b48791f3a..d6d67388d7 100644 --- a/mix.exs +++ b/mix.exs @@ -53,15 +53,16 @@ defmodule Explorer.Mixfile do {:credo, "~> 0.8", only: [:dev, :test], runtime: false}, {:crontab, "~> 1.1"}, {:dialyxir, "~> 0.5", only: [:dev, :test], runtime: false}, - {:ethereumex, github: "exthereum/ethereumex", commit: "262f1d81ae163ffb46e127283658249dac1c8318"}, # Waiting for this version to be pushed to Hex. + {:ethereumex, "~> 0.3"}, {:ex_cldr_numbers, "~> 1.0"}, {:ex_cldr_units, "~> 1.0"}, {:ex_jasmine, github: "minifast/ex_jasmine", branch: "master"}, {:ex_machina, "~> 2.1", only: [:test]}, {:exq, "~> 0.9.1"}, {:exq_ui, "~> 0.9.0"}, - {:exvcr, "~> 0.8", only: :test}, + {:exvcr, "~> 0.10", only: :test}, {:gettext, "~> 0.11"}, + {:httpoison, "~> 1.0", override: true}, {:junit_formatter, ">= 0.0.0", only: [:test], runtime: false}, {:math, "~> 0.3.0"}, {:mock, "~> 0.3.0", only: [:test], runtime: false}, diff --git a/mix.lock b/mix.lock index 79f00d9f13..7940128f72 100644 --- a/mix.lock +++ b/mix.lock @@ -12,7 +12,7 @@ "decimal": {:hex, :decimal, "1.4.1", "ad9e501edf7322f122f7fc151cce7c2a0c9ada96f2b0155b8a09a795c2029770", [:mix], [], "hexpm"}, "dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [:mix], [], "hexpm"}, "ecto": {:hex, :ecto, "2.2.8", "a4463c0928b970f2cee722cd29aaac154e866a15882c5737e0038bbfcf03ec2c", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"}, - "ethereumex": {:git, "https://github.com/exthereum/ethereumex.git", "262f1d81ae163ffb46e127283658249dac1c8318", []}, + "ethereumex": {:hex, :ethereumex, "0.3.0", "9d5e25dc2f9ed357f9f7f2a49e09b608b41a56283c20f50e896a11af225cc723", [:mix], [{:httpoison, "~> 1.0.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:poison, "~> 3.1.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, "ex_cldr": {:hex, :ex_cldr, "1.3.2", "8f4a00c99d1c537b8e8db7e7903f4bd78d82a7289502d080f70365392b13921b", [:mix], [{:abnf2, "~> 0.1", [hex: :abnf2, repo: "hexpm", optional: false]}, {:decimal, "~> 1.4", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:poison, "~> 2.1 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, "ex_cldr_numbers": {:hex, :ex_cldr_numbers, "1.2.0", "ef27299922da913ffad1ed296cacf28b6452fc1243b77301dc17c03276c6ee34", [:mix], [{:decimal, "~> 1.4", [hex: :decimal, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 1.3", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:poison, "~> 2.1 or ~> 3.1", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, "ex_cldr_units": {:hex, :ex_cldr_units, "1.1.1", "b3c7256709bdeb3740a5f64ce2bce659eb9cf4cc1afb4cf94aba033b4a18bc5f", [:mix], [{:ex_cldr, "~> 1.0", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_numbers, "~> 1.0", [hex: :ex_cldr_numbers, repo: "hexpm", optional: false]}], "hexpm"}, @@ -22,12 +22,12 @@ "exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm"}, "exq": {:hex, :exq, "0.9.1", "77ee12c117411ddddd9810aec714eaa704fb8f327949551d9efaea19606122c3", [:mix], [{:poison, ">= 1.2.0 or ~> 2.0", [hex: :poison, repo: "hexpm", optional: false]}, {:redix, ">= 0.5.0", [hex: :redix, repo: "hexpm", optional: false]}, {:uuid, ">= 1.1.0", [hex: :uuid, repo: "hexpm", optional: false]}], "hexpm"}, "exq_ui": {:hex, :exq_ui, "0.9.0", "e97e9fa9009f30d2926b51a166e40a3a521e83f61f3f333fede8335b2aa57f09", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: false]}, {:exq, "~> 0.9", [hex: :exq, repo: "hexpm", optional: false]}, {:plug, ">= 0.8.1 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "exvcr": {:hex, :exvcr, "0.9.1", "31e3936a790a14bf56b31b6b276577076a5ef8afd9b2d53ba3ff8bb647d45613", [:mix], [{:exactor, "~> 2.2", [hex: :exactor, repo: "hexpm", optional: false]}, {:exjsx, "~> 4.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:httpoison, "~> 0.13", [hex: :httpoison, repo: "hexpm", optional: true]}, {:httpotion, "~> 3.0", [hex: :httpotion, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, + "exvcr": {:hex, :exvcr, "0.10.0", "5150808404d9f48dbda636f70f7f8fefd93e2433cd39f695f810e73b3a9d1736", [:mix], [{:exactor, "~> 2.2", [hex: :exactor, repo: "hexpm", optional: false]}, {:exjsx, "~> 4.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:httpoison, "~> 0.13", [hex: :httpoison, repo: "hexpm", optional: true]}, {:httpotion, "~> 3.0", [hex: :httpotion, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, "file_system": {:hex, :file_system, "0.2.4", "f0bdda195c0e46e987333e986452ec523aed21d784189144f647c43eaf307064", [:mix], [], "hexpm"}, "gen_stage": {:hex, :gen_stage, "0.12.2", "e0e347cbb1ceb5f4e68a526aec4d64b54ad721f0a8b30aa9d28e0ad749419cbb", [:mix], [], "hexpm"}, "gettext": {:hex, :gettext, "0.14.0", "1a019a2e51d5ad3d126efe166dcdf6563768e5d06c32a99ad2281a1fa94b4c72", [:mix], [], "hexpm"}, - "hackney": {:hex, :hackney, "1.10.1", "c38d0ca52ea80254936a32c45bb7eb414e7a96a521b4ce76d00a69753b157f21", [:rebar3], [{:certifi, "2.0.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, - "httpoison": {:hex, :httpoison, "0.13.0", "bfaf44d9f133a6599886720f3937a7699466d23bb0cd7a88b6ba011f53c6f562", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, + "hackney": {:hex, :hackney, "1.11.0", "4951ee019df102492dabba66a09e305f61919a8a183a7860236c0fde586134b6", [:rebar3], [{:certifi, "2.0.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, + "httpoison": {:hex, :httpoison, "1.0.0", "1f02f827148d945d40b24f0b0a89afe40bfe037171a6cf70f2486976d86921cd", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, "idna": {:hex, :idna, "5.1.0", "d72b4effeb324ad5da3cab1767cb16b17939004e789d8c0ad5b70f3cea20c89a", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, "jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm"}, "junit_formatter": {:hex, :junit_formatter, "2.1.0", "ff03d2bbe9a67041f2488d8e72180ddcf4dff9e9c8a39b79eac9828fcb9e9bbf", [:mix], [], "hexpm"},