From 51d3900e92262067f4db83861ecf3e2a70e654b8 Mon Sep 17 00:00:00 2001 From: Viktor Baranov Date: Fri, 17 Sep 2021 22:13:46 +0300 Subject: [PATCH] Bump ex_keccak --- apps/explorer/lib/explorer/chain/address.ex | 2 +- apps/explorer/lib/explorer/chain/hash/address.ex | 2 +- apps/explorer/test/explorer/chain/log_test.exs | 8 ++++---- apps/indexer/lib/indexer/transform/blocks.ex | 5 ++--- mix.lock | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/address.ex b/apps/explorer/lib/explorer/chain/address.ex index 35c8951349..c310600789 100644 --- a/apps/explorer/lib/explorer/chain/address.ex +++ b/apps/explorer/lib/explorer/chain/address.ex @@ -212,7 +212,7 @@ defmodule Explorer.Chain.Address do end defp stream_every_four_bytes_of_sha256(value) do - {:ok, hash} = ExKeccak.hash_256(value) + hash = ExKeccak.hash_256(value) hash |> stream_binary() diff --git a/apps/explorer/lib/explorer/chain/hash/address.ex b/apps/explorer/lib/explorer/chain/hash/address.ex index e8610e19dd..930774ee59 100644 --- a/apps/explorer/lib/explorer/chain/hash/address.ex +++ b/apps/explorer/lib/explorer/chain/hash/address.ex @@ -212,7 +212,7 @@ defmodule Explorer.Chain.Hash.Address do @spec is_checksummed?(String.t()) :: boolean() defp is_checksummed?(original_hash) do lowercase_hash = String.downcase(original_hash) - {:ok, sha3_hash} = ExKeccak.hash_256(lowercase_hash) + sha3_hash = ExKeccak.hash_256(lowercase_hash) do_checksum_check(sha3_hash, original_hash) end diff --git a/apps/explorer/test/explorer/chain/log_test.exs b/apps/explorer/test/explorer/chain/log_test.exs index 1b57bdadea..f670c83873 100644 --- a/apps/explorer/test/explorer/chain/log_test.exs +++ b/apps/explorer/test/explorer/chain/log_test.exs @@ -76,9 +76,9 @@ defmodule Explorer.Chain.LogTest do address_hash: to_address.hash ) - {:ok, topic1_bytes} = ExKeccak.hash_256("WantsPets(string,uint256,bool)") + topic1_bytes = ExKeccak.hash_256("WantsPets(string,uint256,bool)") topic1 = "0x" <> Base.encode16(topic1_bytes, case: :lower) - {:ok, topic2_bytes} = ExKeccak.hash_256("bob") + topic2_bytes = ExKeccak.hash_256("bob") topic2 = "0x" <> Base.encode16(topic2_bytes, case: :lower) topic3 = "0x0000000000000000000000000000000000000000000000000000000000000001" data = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -133,9 +133,9 @@ defmodule Explorer.Chain.LogTest do |> SmartContract.changeset(params) |> Repo.insert!() - {:ok, topic1_bytes} = ExKeccak.hash_256("WantsPets(string,uint256,bool)") + topic1_bytes = ExKeccak.hash_256("WantsPets(string,uint256,bool)") topic1 = "0x" <> Base.encode16(topic1_bytes, case: :lower) - {:ok, topic2_bytes} = ExKeccak.hash_256("bob") + topic2_bytes = ExKeccak.hash_256("bob") topic2 = "0x" <> Base.encode16(topic2_bytes, case: :lower) topic3 = "0x0000000000000000000000000000000000000000000000000000000000000001" data = "0x0000000000000000000000000000000000000000000000000000000000000000" diff --git a/apps/indexer/lib/indexer/transform/blocks.ex b/apps/indexer/lib/indexer/transform/blocks.ex index 302eabd144..8b9915e2be 100644 --- a/apps/indexer/lib/indexer/transform/blocks.ex +++ b/apps/indexer/lib/indexer/transform/blocks.ex @@ -56,8 +56,7 @@ defmodule Indexer.Transform.Blocks do decode(block.nonce) ] - {:ok, hash} = ExKeccak.hash_256(ExRLP.encode(header_data)) - hash + ExKeccak.hash_256(ExRLP.encode(header_data)) end defp trim_prefix("0x" <> rest), do: rest @@ -84,7 +83,7 @@ defmodule Indexer.Transform.Blocks do :libsecp256k1.ecdsa_recover_compact(signature_hash, r <> s, :uncompressed, v) # Public key comes from the last 20 bytes - {:ok, <<_::bytes-size(12), public_key::binary>>} = ExKeccak.hash_256(private_key) + <<_::bytes-size(12), public_key::binary>> = ExKeccak.hash_256(private_key) miner_address = Base.encode16(public_key, case: :lower) "0x" <> miner_address diff --git a/mix.lock b/mix.lock index a904d605d8..365c0cf8a8 100644 --- a/mix.lock +++ b/mix.lock @@ -35,7 +35,7 @@ "ecto_sql": {:hex, :ecto_sql, "3.5.3", "1964df0305538364b97cc4661a2bd2b6c89d803e66e5655e4e55ff1571943efd", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2f53592432ce17d3978feb8f43e8dc0705e288b0890caf06d449785f018061c"}, "elixir_make": {:hex, :elixir_make, "0.6.0", "38349f3e29aff4864352084fc736fa7fa0f2995a819a737554f7ebd28b85aaab", [:mix], [], "hexpm", "d522695b93b7f0b4c0fcb2dfe73a6b905b1c301226a5a55cb42e5b14d509e050"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, - "ex_abi": {:hex, :ex_abi, "0.5.1", "e12373d4511de65c8c7e40011fa40ac05bda687de819eb0f41fc36d4e96e7b04", [:mix], [{:ex_keccak, "~> 0.1.2", [hex: :ex_keccak, repo: "hexpm", optional: false]}], "hexpm", "a2d8b8030cb6af03e69dba7395b1929422d7cb15b8275d89844c2495acf9da1f"}, + "ex_abi": {:hex, :ex_abi, "0.5.5", "678d69f8a74406cd8eaee1890cd35333c3fbcdbcb0ad50565fd0a4a82fd4ffa3", [:mix], [{:ex_keccak, "~> 0.2.0", [hex: :ex_keccak, repo: "hexpm", optional: false]}], "hexpm", "9a90d2b8c80f38dfcda110120d27fd2673ed79a8bb1c823019ecb8aa970884e3"}, "ex_cldr": {:hex, :ex_cldr, "2.18.2", "c0557145c234a4d31ff450a0438c5a70e786ccba9449a9f9f895809be20bed7d", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.5", [hex: :certifi, repo: "hexpm", optional: true]}, {:cldr_utils, "~> 2.12", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [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 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "ac28055ae6df438b72f98703c842c2c0d969af6bd68662a8f586862a9a0ddc79"}, "ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.8.0", "b2ecc94e9fa4b8ec07614830f4d6e811e5df5e7679c6d2be92f4fe4f31184913", [:mix], [{:ex_cldr, "~> 2.18", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "a39780667b73bfd3d2bd08e61981bca23a97912b86f3236042850ecb062f48eb"}, "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", "89e25d539a4126472560da2e28b6f1aeb859f5afc0778d6b594029c4226d1775"}, @@ -43,7 +43,7 @@ "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", "88f2f28a1c893e429943aaac87ea0e4d60e52852edc46420bc9f3c7aba2c8f9f"}, "ex_doc": {:hex, :ex_doc, "0.25.2", "4f1cae793c4d132e06674b282f1d9ea3bf409bcca027ddb2fe177c4eed6a253f", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5b0c172e87ac27f14dfd152d52a145238ec71a95efbf29849550278c58a393d6"}, "ex_json_schema": {:hex, :ex_json_schema, "0.6.2", "de23d80478215987469c81688208fe0ff440ee0e0e6ae2268fcadbb2ff35df9d", [:mix], [], "hexpm", "2f25c57e919ffc5d6b02f2f130548284342dd6c3e99555ee0beeb9f2d2366a96"}, - "ex_keccak": {:hex, :ex_keccak, "0.1.3", "818faf6df706209782e7e0a8c16202e380a7a9b0e932e9fcb8fa3724f6e41d2e", [:mix], [{:rustler, "~> 0.21.1", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "10b3acd7c99624e52fd48dafb2d8b32063c7c5135cd98390974a41292b0601fe"}, + "ex_keccak": {:hex, :ex_keccak, "0.2.0", "ca31d7fdae818380aa07952e6941c5de6b689cb8a68189fcce1e25d7bb0c4574", [:mix], [{:rustler, "~> 0.22.0", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "4bef13ce4dda45b15e2958e0ce5ff77502279778fb7e32cfa887dccb036f3bb2"}, "ex_machina": {:hex, :ex_machina, "2.4.0", "09a34c5d371bfb5f78399029194a8ff67aff340ebe8ba19040181af35315eabb", [: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", "a20bc9ddc721b33ea913b93666c5d0bdca5cbad7a67540784ae277228832d72c"}, "ex_rlp": {:hex, :ex_rlp, "0.5.3", "9055bddade545ee3e734aaad62c4b4d08211834da3beb43ae269b75785909e5e", [:mix], [], "hexpm", "a755a5f8f9f66079f3ecbe021536b949077fac0df963d9e59a20321bab28722d"}, "ex_utils": {:hex, :ex_utils, "0.1.7", "2c133e0bcdc49a858cf8dacf893308ebc05bc5fba501dc3d2935e65365ec0bf3", [:mix], [], "hexpm", "66d4fe75285948f2d1e69c2a5ddd651c398c813574f8d36a9eef11dc20356ef6"}, @@ -106,7 +106,7 @@ "qrcode": {:hex, :qrcode, "0.1.5", "551271830515c150f34568345b060c625deb0e6691db2a01b0a6de3aafc93886", [:mix], [], "hexpm", "a266b7fb7be0d3b713912055dde3575927eca920e5d604ded45cd534f6b7a447"}, "que": {:hex, :que, "0.10.1", "788ed0ec92ed69bdf9cfb29bf41a94ca6355b8d44959bd0669cf706e557ac891", [:mix], [{:ex_utils, "~> 0.1.6", [hex: :ex_utils, repo: "hexpm", optional: false]}, {:memento, "~> 0.3.0", [hex: :memento, repo: "hexpm", optional: false]}], "hexpm", "a737b365253e75dbd24b2d51acc1d851049e87baae08cd0c94e2bc5cd65088d5"}, "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"}, - "rustler": {:hex, :rustler, "0.21.1", "5299980be32da997c54382e945bacaa015ed97a60745e1e639beaf6a7b278c65", [:mix], [{:toml, "~> 0.5.2", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "6ee1651e10645b2b2f3bb70502bf180341aa058709177e9bc28c105934094bc6"}, + "rustler": {:hex, :rustler, "0.22.0", "e2930f9d6933e910f87526bb0a7f904e32b62a7e838a3ca4a884ee7fdfb957ed", [:mix], [{:toml, "~> 0.5.2", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "01f5989dd511ebec09be481e07d3c59773d5373c5061e09d3ebc3ef61811b49d"}, "sobelow": {:hex, :sobelow, "0.10.6", "ac9ebd742035b119eb00a4b1416098b88a4d54d2f262a42602e1e9e3ed4c2afd", [:mix], [], "hexpm", "06e426b8dc0bc80ab1333ce89b904c720474824825b9ceb3dc424eb0f731b6e9"}, "spandex": {:hex, :spandex, "3.0.3", "91aa318f3de696bb4d931adf65f7ebdbe5df25cccce1fe8fd376a44c46bcf69b", [:mix], [{:decorator, "~> 1.2", [hex: :decorator, repo: "hexpm", optional: true]}, {:optimal, "~> 0.3.3", [hex: :optimal, repo: "hexpm", optional: false]}, {:plug, ">= 1.0.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "e3e6c319d0ab478ddc9a39102a727a410c962b4d51c0932c72279b86d3b17044"}, "spandex_datadog": {:hex, :spandex_datadog, "1.0.0", "20db83c10600210a36a1ac95ed8cef3efb400ae948f48252437c2cc21dfd3969", [:mix], [{:msgpax, "~> 2.2.1", [hex: :msgpax, repo: "hexpm", optional: false]}, {:spandex, "~> 3.0", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm", "d1a499ed3e8580b88ca8ba10208004849b3bd6cfa045b90e4b69055b78474045"},