chore: bump elixir to 1.16.3 and Erlang OTP to 26.2.5.1 (#9256)

* feat: bump elixir to 1.16.0

* fix: failing tests

* fix: one more test

* fix: qemu arm build

* fix: failing market test

* fix: override version in ci

* chore: bump to 1.16.1

* fix: ci config override

* chore: bump to 1.16.3

* chore: mix format

* fix: faulty explorer tests

* fix: faulty block_scout_web tests

* chore: lint

* ci: remove arm build workaround

* chore: fix negative slice warnings

* Erlang 26.2.5.1

---------

Co-authored-by: Viktor Baranov <baranov.viktor.27@gmail.com>
pull/6801/merge
Kirill Fedoseev 5 months ago committed by GitHub
parent 18c0a61c34
commit 7fe5bb98de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/ISSUE_TEMPLATE/bug_report.yml
  2. 4
      .github/workflows/config.yml
  3. 4
      .tool-versions
  4. 2
      apps/block_scout_web/lib/block_scout_web/controllers/api/v2/import_controller.ex
  5. 2
      apps/block_scout_web/lib/block_scout_web/models/user_from_auth.ex
  6. 4
      apps/block_scout_web/lib/block_scout_web/templates/address_contract_verification_via_multi_part_files/new.html.eex
  7. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction/index.html.eex
  8. 6
      apps/block_scout_web/lib/block_scout_web/views/abi_encoded_value_view.ex
  9. 2
      apps/block_scout_web/lib/block_scout_web/views/address_decompiled_contract_view.ex
  10. 4
      apps/block_scout_web/lib/block_scout_web/views/api/v2/smart_contract_view.ex
  11. 2
      apps/block_scout_web/lib/block_scout_web/views/nft_helper.ex
  12. 4
      apps/block_scout_web/lib/block_scout_web/views/smart_contract_view.ex
  13. 2
      apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
  14. 7
      apps/block_scout_web/mix.exs
  15. 8
      apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs
  16. 28
      apps/block_scout_web/test/block_scout_web/controllers/api/v2/address_controller_test.exs
  17. 7
      apps/block_scout_web/test/block_scout_web/controllers/block_controller_test.exs
  18. 14
      apps/block_scout_web/test/block_scout_web/controllers/transaction_token_transfer_controller_test.exs
  19. 8
      apps/block_scout_web/test/block_scout_web/controllers/verified_contracts_controller_test.exs
  20. 5
      apps/block_scout_web/test/block_scout_web/controllers/withdrawal_controller_test.exs
  21. 4
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex
  22. 19
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/variant.ex
  23. 2
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc/receipt_test.exs
  24. 3
      apps/explorer/lib/explorer/account/custom_abi.ex
  25. 3
      apps/explorer/lib/explorer/account/identity.ex
  26. 9
      apps/explorer/lib/explorer/account/notifier/email.ex
  27. 3
      apps/explorer/lib/explorer/account/tag_address.ex
  28. 3
      apps/explorer/lib/explorer/account/tag_transaction.ex
  29. 3
      apps/explorer/lib/explorer/account/watchlist_address.ex
  30. 9
      apps/explorer/lib/explorer/account/watchlist_notification.ex
  31. 4
      apps/explorer/lib/explorer/chain.ex
  32. 4
      apps/explorer/lib/explorer/chain/address.ex
  33. 4
      apps/explorer/lib/explorer/chain/address/counters.ex
  34. 2
      apps/explorer/lib/explorer/chain/hash.ex
  35. 2
      apps/explorer/lib/explorer/chain/log.ex
  36. 4
      apps/explorer/lib/explorer/chain/mud.ex
  37. 2
      apps/explorer/lib/explorer/chain/smart_contract.ex
  38. 4
      apps/explorer/lib/explorer/chain/smart_contract/audit_report.ex
  39. 5
      apps/explorer/lib/explorer/chain/stability/validator.ex
  40. 4
      apps/explorer/lib/explorer/chain/transaction.ex
  41. 8
      apps/explorer/lib/explorer/chain_spec/genesis_data.ex
  42. 2
      apps/explorer/lib/explorer/chain_spec/geth/importer.ex
  43. 4
      apps/explorer/lib/explorer/chain_spec/parity/importer.ex
  44. 2
      apps/explorer/lib/explorer/chain_spec/poa/importer.ex
  45. 2
      apps/explorer/lib/explorer/eth_rpc.ex
  46. 2
      apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex
  47. 2
      apps/explorer/lib/explorer/history/process.ex
  48. 6
      apps/explorer/lib/explorer/market/history/cataloger.ex
  49. 4
      apps/explorer/lib/explorer/smart_contract/reader.ex
  50. 4
      apps/explorer/lib/explorer/smart_contract/solidity/code_compiler.ex
  51. 4
      apps/explorer/lib/explorer/smart_contract/solidity/verifier.ex
  52. 7
      apps/explorer/lib/explorer/third_party_integrations/sourcify.ex
  53. 18
      apps/explorer/lib/explorer/token/metadata_retriever.ex
  54. 3
      apps/explorer/mix.exs
  55. 5
      apps/explorer/test/explorer/chain/block_test.exs
  56. 2
      apps/explorer/test/explorer/chain/cache/gas_price_oracle_test.exs
  57. 2
      apps/explorer/test/explorer/chain/smart_contract/proxy_test.exs
  58. 10
      apps/explorer/test/explorer/chain_test.exs
  59. 6
      apps/explorer/test/explorer/counters/average_block_time_test.exs
  60. 2
      apps/explorer/test/explorer/exchange_rates/source/coin_gecko_test.exs
  61. 3
      apps/explorer/test/explorer/market/history/cataloger_test.exs
  62. 2
      apps/explorer/test/explorer/market/market_test.exs
  63. 2
      apps/indexer/lib/indexer/block/realtime/fetcher.ex
  64. 2
      apps/indexer/lib/indexer/buffered_task.ex
  65. 2
      apps/indexer/lib/indexer/fetcher/on_demand/token_balance.ex
  66. 2
      apps/indexer/lib/indexer/fetcher/token_instance/helper.ex
  67. 2
      apps/indexer/lib/indexer/fetcher/transaction_action.ex
  68. 2
      apps/indexer/lib/indexer/fetcher/withdrawal.ex
  69. 4
      apps/indexer/lib/indexer/memory/monitor.ex
  70. 4
      apps/indexer/lib/indexer/transform/transaction_actions.ex
  71. 3
      apps/indexer/test/indexer/buffered_task_test.exs
  72. 4
      docker/Dockerfile
  73. 2
      mix.lock

@ -81,7 +81,7 @@ body:
attributes:
label: Elixir & Erlang/OTP versions
description: Elixir & Erlang/OTP versions.
placeholder: Elixir 1.14.5 (compiled with Erlang/OTP 25)
placeholder: Elixir 1.16.3 (compiled with Erlang/OTP 26)
validations:
required: true

@ -32,8 +32,8 @@ on:
env:
MIX_ENV: test
OTP_VERSION: ${{ vars.OTP_VERSION || '25.3.2.8' }}
ELIXIR_VERSION: ${{ vars.ELIXIR_VERSION || '1.14.5' }}
OTP_VERSION: ${{ github.ref_name == '9256/merge' && '26.2.5.1' || vars.OTP_VERSION }}
ELIXIR_VERSION: ${{ github.ref_name == '9256/merge' && '1.16.3' || vars.ELIXIR_VERSION }}
ACCOUNT_AUTH0_DOMAIN: "blockscoutcom.us.auth0.com"
jobs:

@ -1,3 +1,3 @@
elixir 1.14.5-otp-25
erlang 25.3.2.8
elixir 1.16.3-otp-26
erlang 26.2.5.1
nodejs 18.17.1

@ -42,7 +42,7 @@ defmodule BlockScoutWeb.API.V2.ImportController do
|> render(:message, %{message: "Success"})
error ->
Logger.warn(fn -> ["Error on importing token info: ", inspect(error)] end)
Logger.warning(fn -> ["Error on importing token info: ", inspect(error)] end)
conn
|> put_view(ApiView)

@ -117,7 +117,7 @@ defmodule BlockScoutWeb.Models.UserFromAuth do
# default case if nothing matches
defp avatar_from_auth(auth) do
Logger.warn(auth.provider <> " needs to find an avatar URL!")
Logger.warning(auth.provider <> " needs to find an avatar URL!")
Logger.debug(Poison.encode!(auth))
nil
end

@ -4,7 +4,7 @@
<%= render BlockScoutWeb.CommonComponentsView, "_channel_disconnected_message.html", text: gettext("Connection Lost") %>
<div class="new-smart-contract-form">
<h1 class="smart-contract-title"><%= if RustVerifierInterface.enabled?(), do: gettext "New Solidity/Yul Smart Contract Verification", else: gettext "New Solidity Smart Contract Verification" %></h1>
<h1 class="smart-contract-title"><%= if RustVerifierInterface.enabled?(), do: gettext("New Solidity/Yul Smart Contract Verification"), else: gettext("New Solidity Smart Contract Verification") %></h1>
<%= form_for changeset,
address_contract_verification_path(@conn, :create),
@ -69,7 +69,7 @@
</div>
</div>
</div>
<div class="smart-contract-form-group-tooltip"><%= if RustVerifierInterface.enabled?(), do: gettext "Drop all Solidity or Yul contract source files into the drop zone.", else: gettext "Drop all Solidity contract source files into the drop zone." %></div>
<div class="smart-contract-form-group-tooltip"><%= if RustVerifierInterface.enabled?(), do: gettext("Drop all Solidity or Yul contract source files into the drop zone."), else: gettext("Drop all Solidity contract source files into the drop zone.") %></div>
</div>
<div class="add-contract-libraries-wrapper">

@ -11,7 +11,7 @@
<div class="card-body" data-async-listing="<%= @current_path %>">
<h1 class="card-title list-title-description"><%= gettext "Validated Transactions" %></h1>
<div class="list-top-pagination-container-wrapper">
<%= render BlockScoutWeb.CommonComponentsView, "_rap_pagination_container.html", position: "top", showing_limit: if Chain.transactions_available_count() == Chain.limit_showing_transactions(), do: Chain.limit_showing_transactions(), else: nil %>
<%= render BlockScoutWeb.CommonComponentsView, "_rap_pagination_container.html", position: "top", showing_limit: if(Chain.transactions_available_count() == Chain.limit_showing_transactions(), do: Chain.limit_showing_transactions(), else: nil) %>
</div>
<div data-selector="channel-batching-message" class="d-none">

@ -20,7 +20,7 @@ defmodule BlockScoutWeb.ABIEncodedValueView do
do_value_html(decoded_type, value, no_links)
rescue
exception ->
Logger.warn(fn ->
Logger.warning(fn ->
["Error determining value html for #{inspect(type)}: ", Exception.format(:error, exception, __STACKTRACE__)]
end)
@ -33,7 +33,7 @@ defmodule BlockScoutWeb.ABIEncodedValueView do
do_value_json(decoded_type, value)
rescue
exception ->
Logger.warn(fn ->
Logger.warning(fn ->
["Error determining value json for #{inspect(type)}: ", Exception.format(:error, exception, __STACKTRACE__)]
end)
@ -46,7 +46,7 @@ defmodule BlockScoutWeb.ABIEncodedValueView do
do_copy_text(decoded_type, value)
rescue
exception ->
Logger.warn(fn ->
Logger.warning(fn ->
["Error determining copy text for #{inspect(type)}: ", Exception.format(:error, exception, __STACKTRACE__)]
end)

@ -266,7 +266,7 @@ defmodule BlockScoutWeb.AddressDecompiledContractView do
|> Enum.reduce("", fn p, a ->
a <> new_style <> p <> "</span>\n"
end)
|> String.slice(0..-2)
|> String.slice(0..-2//1)
end
end
end

@ -301,7 +301,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractView do
result
rescue
exception ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"Error formatting constructor arguments for abi: #{inspect(abi)}, args: #{inspect(constructor_arguments)}: ",
Exception.format(:error, exception)
@ -382,7 +382,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractView do
tuple_item_types =
rest
|> String.split("]")
|> Enum.slice(0..-3)
|> Enum.slice(0..-3//1)
|> Enum.join("]")
array_str = "[" <> (rest |> String.split("[") |> List.last())

@ -81,7 +81,7 @@ defmodule BlockScoutWeb.NFTHelper do
end
defp ipfs_link(image_url, prefix) do
ipfs_uid = String.slice(image_url, String.length(prefix)..-1)
ipfs_uid = String.slice(image_url, String.length(prefix)..-1//1)
"https://ipfs.io/ipfs/" <> ipfs_uid
end

@ -56,7 +56,7 @@ defmodule BlockScoutWeb.SmartContractView do
String.starts_with?(type, "tuple") ->
tuple_types =
type
|> String.slice(0..-3)
|> String.slice(0..-3//1)
|> supplement_type_with_components(components)
values =
@ -132,7 +132,7 @@ defmodule BlockScoutWeb.SmartContractView do
to_string(address)
_ ->
Logger.warn(fn -> ["Error decoding address value: #{inspect(value)}"] end)
Logger.warning(fn -> ["Error decoding address value: #{inspect(value)}"] end)
"(decoding error)"
end
end

@ -597,7 +597,7 @@ defmodule BlockScoutWeb.TransactionView do
end
def trim(length, string) do
%{show: String.slice(string, 0..length), hide: String.slice(string, (length + 1)..String.length(string))}
%{show: String.slice(string, 0..length), hide: String.slice(string, (length + 1)..-1//1)}
end
defp template_to_string(template) when is_list(template) do

@ -135,8 +135,11 @@ defmodule BlockScoutWeb.Mixfile do
{:prometheus_phoenix, "~> 1.2"},
# Expose metrics from URL Prometheus server can scrape
{:prometheus_plugs, "~> 1.1"},
# OS process metrics for Prometheus
{:prometheus_process_collector, "~> 1.3"},
# OS process metrics for Prometheus, custom ref to include https://github.com/deadtrickster/prometheus_process_collector/pull/30
{:prometheus_process_collector,
git: "https://github.com/Phybbit/prometheus_process_collector.git",
ref: "3dc94dcff422d7b9cbd7ddf6bf2a896446705f3f",
override: true},
{:remote_ip, "~> 1.0"},
{:qrcode, "~> 0.1.0"},
{:sobelow, ">= 0.7.0", only: [:dev, :test], runtime: false},

@ -207,11 +207,9 @@ defmodule BlockScoutWeb.AddressTokenTransferControllerTest do
:index,
Address.checksum(address.hash),
Address.checksum(token.contract_address_hash),
%{
block_number: page_last_transfer.block_number,
index: page_last_transfer.index,
items_count: "50"
}
block_number: page_last_transfer.block_number,
index: page_last_transfer.index,
items_count: "50"
)
assert Map.get(json_response(conn, 200), "next_page_path") == expected_path

@ -876,7 +876,12 @@ defmodule BlockScoutWeb.API.V2.AddressControllerTest do
for _ <- 0..50 do
tx = insert(:transaction, input: "0xabcd010203040506") |> with_block()
insert(:token_transfer, transaction: tx, block: tx.block, block_number: tx.block_number, from_address: address)
insert(:token_transfer,
transaction: tx,
block: tx.block,
block_number: tx.block_number,
from_address: address
)
insert(:token_transfer,
transaction: tx,
@ -941,7 +946,12 @@ defmodule BlockScoutWeb.API.V2.AddressControllerTest do
for _ <- 0..50 do
tx = insert(:transaction, input: "0xabcd010203040506") |> with_block()
insert(:token_transfer, transaction: tx, block: tx.block, block_number: tx.block_number, from_address: address)
insert(:token_transfer,
transaction: tx,
block: tx.block,
block_number: tx.block_number,
from_address: address
)
end
request = get(conn, "/api/v2/addresses/#{address.hash}/token-transfers")
@ -986,7 +996,12 @@ defmodule BlockScoutWeb.API.V2.AddressControllerTest do
for _ <- 0..50 do
tx = insert(:transaction, input: "0xabcd010203040506") |> with_block()
insert(:token_transfer, transaction: tx, block: tx.block, block_number: tx.block_number, from_address: address)
insert(:token_transfer,
transaction: tx,
block: tx.block,
block_number: tx.block_number,
from_address: address
)
end
for _ <- 0..50 do
@ -1013,7 +1028,12 @@ defmodule BlockScoutWeb.API.V2.AddressControllerTest do
for _ <- 0..49 do
tx = insert(:transaction, input: "0xabcd010203040506") |> with_block()
insert(:token_transfer, transaction: tx, block: tx.block, block_number: tx.block_number, from_address: address)
insert(:token_transfer,
transaction: tx,
block: tx.block,
block_number: tx.block_number,
from_address: address
)
end
tt_to =

@ -98,12 +98,7 @@ defmodule BlockScoutWeb.BlockControllerTest do
conn = get(conn, blocks_path(conn, :index), %{"type" => "JSON"})
expected_path =
blocks_path(conn, :index, %{
block_number: number,
block_type: "Block",
items_count: "50"
})
expected_path = blocks_path(conn, :index, block_number: number, block_type: "Block", items_count: "50")
assert Map.get(json_response(conn, 200), "next_page_path") == expected_path
end

@ -53,9 +53,17 @@ defmodule BlockScoutWeb.TransactionTokenTransferControllerTest do
test "includes token transfers for the transaction", %{conn: conn} do
transaction = insert(:transaction) |> with_block()
insert(:token_transfer, transaction: transaction, block: transaction.block, block_number: transaction.block_number)
insert(:token_transfer, transaction: transaction, block: transaction.block, block_number: transaction.block_number)
insert(:token_transfer,
transaction: transaction,
block: transaction.block,
block_number: transaction.block_number
)
insert(:token_transfer,
transaction: transaction,
block: transaction.block,
block_number: transaction.block_number
)
path = transaction_token_transfer_path(BlockScoutWeb.Endpoint, :index, transaction.hash)

@ -63,12 +63,12 @@ defmodule BlockScoutWeb.VerifiedContractsControllerTest do
conn = get(conn, verified_contracts_path(conn, :index), %{"type" => "JSON"})
expected_path =
verified_contracts_path(conn, :index, %{
smart_contract_id: id,
items_count: "50",
verified_contracts_path(conn, :index,
coin_balance: nil,
items_count: "50",
smart_contract_id: id,
tx_count: nil
})
)
assert Map.get(json_response(conn, 200), "next_page_path") == expected_path
end

@ -41,10 +41,7 @@ defmodule BlockScoutWeb.WithdrawalControllerTest do
conn = get(conn, withdrawal_path(conn, :index), %{"type" => "JSON"})
expected_path =
withdrawal_path(conn, :index, %{
index: index,
items_count: "50"
})
withdrawal_path(conn, :index, index: index, items_count: "50")
assert Map.get(json_response(conn, 200), "next_page_path") == expected_path
end

@ -101,7 +101,7 @@ defmodule EthereumJSONRPC.Encoder do
decoded_data =
result
|> String.slice(2..-1)
|> String.slice(2..-1//1)
|> Base.decode16!(case: :lower)
|> TypeDecoder.decode_raw(types_list)
|> Enum.zip(types_list)
@ -120,7 +120,7 @@ defmodule EthereumJSONRPC.Encoder do
def unescape(data) do
if String.starts_with?(data, "\\x") do
charlist = String.to_charlist(data)
erlang_literal = '"#{charlist}"'
erlang_literal = ~c"\"#{charlist}\""
{:ok, [{:string, _, unescaped_charlist}], _} = :erl_scan.string(erlang_literal)
List.to_string(unescaped_charlist)
else

@ -100,18 +100,13 @@ defmodule EthereumJSONRPC.Variant do
variant = System.get_env("ETHEREUM_JSONRPC_VARIANT", default_variant)
cond do
is_nil(variant) ->
"nethermind"
variant == "parity" ->
"nethermind"
true ->
variant
|> String.split(".")
|> List.last()
|> String.downcase()
if variant == "parity" do
"nethermind"
else
variant
|> String.split(".")
|> List.last()
|> String.downcase()
end
end

@ -15,7 +15,7 @@ defmodule EthereumJSONRPC.ReceiptTest do
%{"new_key" => "new_value", "transactionHash" => "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060"}
Errors:
{:unknown_key, %{key: "new_key", value: "new_value"}}
{:unknown_key, %{value: "new_value", key: "new_key"}}
""",
fn ->
Receipt.to_elixir(%{

@ -50,8 +50,9 @@ defmodule Explorer.Account.CustomABI do
end
defp put_hashed_fields(changeset) do
# Using force_change instead of put_change due to https://github.com/danielberkompas/cloak_ecto/issues/53
changeset
|> put_change(:address_hash_hash, hash_to_lower_case_string(get_field(changeset, :address_hash)))
|> force_change(:address_hash_hash, hash_to_lower_case_string(get_field(changeset, :address_hash)))
end
defp check_smart_contract_address(%Changeset{changes: %{address_hash: address_hash}} = custom_abi) do

@ -36,7 +36,8 @@ defmodule Explorer.Account.Identity do
end
defp put_hashed_fields(changeset) do
# Using force_change instead of put_change due to https://github.com/danielberkompas/cloak_ecto/issues/53
changeset
|> put_change(:uid_hash, get_field(changeset, :uid))
|> force_change(:uid_hash, get_field(changeset, :uid))
end
end

@ -5,7 +5,6 @@ defmodule Explorer.Account.Notifier.Email do
require Logger
alias BlockScoutWeb.Routers.WebRouter.Helpers
alias Explorer.Account.{Identity, Watchlist, WatchlistAddress, WatchlistNotification}
alias Explorer.Repo
@ -121,15 +120,15 @@ defmodule Explorer.Account.Notifier.Email do
end
defp address_url(address_hash) do
Helpers.address_url(uri(), :show, address_hash)
uri() |> URI.append_path("/address/#{address_hash}") |> to_string()
end
defp block_url(notification) do
Helpers.block_url(uri(), :show, Integer.to_string(notification.block_number))
uri() |> URI.append_path("/block/#{notification.block_number}") |> to_string()
end
defp transaction_url(notification) do
Helpers.transaction_url(uri(), :show, notification.transaction_hash)
uri() |> URI.append_path("/tx/#{notification.transaction_hash}") |> to_string()
end
defp url_params do
@ -156,7 +155,7 @@ defmodule Explorer.Account.Notifier.Email do
raw_path = url_params()[:path]
if raw_path |> String.ends_with?("/") do
raw_path |> String.slice(0..-2)
raw_path |> String.slice(0..-2//1)
else
raw_path
end

@ -50,8 +50,9 @@ defmodule Explorer.Account.TagAddress do
end
defp put_hashed_fields(changeset) do
# Using force_change instead of put_change due to https://github.com/danielberkompas/cloak_ecto/issues/53
changeset
|> put_change(:address_hash_hash, hash_to_lower_case_string(get_field(changeset, :address_hash)))
|> force_change(:address_hash_hash, hash_to_lower_case_string(get_field(changeset, :address_hash)))
end
defp check_existence_or_create_address(%Changeset{changes: %{address_hash: address_hash}, valid?: true} = changeset) do

@ -48,8 +48,9 @@ defmodule Explorer.Account.TagTransaction do
end
defp put_hashed_fields(changeset) do
# Using force_change instead of put_change due to https://github.com/danielberkompas/cloak_ecto/issues/53
changeset
|> put_change(:tx_hash_hash, hash_to_lower_case_string(get_field(changeset, :tx_hash)))
|> force_change(:tx_hash_hash, hash_to_lower_case_string(get_field(changeset, :tx_hash)))
end
defp check_transaction_existence(%Changeset{changes: %{tx_hash: tx_hash}} = changeset) do

@ -68,8 +68,9 @@ defmodule Explorer.Account.WatchlistAddress do
end
defp put_hashed_fields(changeset) do
# Using force_change instead of put_change due to https://github.com/danielberkompas/cloak_ecto/issues/53
changeset
|> put_change(:address_hash_hash, hash_to_lower_case_string(get_field(changeset, :address_hash)))
|> force_change(:address_hash_hash, hash_to_lower_case_string(get_field(changeset, :address_hash)))
end
def create(attrs) do

@ -58,11 +58,12 @@ defmodule Explorer.Account.WatchlistNotification do
end
defp put_hashed_fields(changeset) do
# Using force_change instead of put_change due to https://github.com/danielberkompas/cloak_ecto/issues/53
changeset
|> put_change(:from_address_hash_hash, hash_to_lower_case_string(get_field(changeset, :from_address_hash)))
|> put_change(:to_address_hash_hash, hash_to_lower_case_string(get_field(changeset, :to_address_hash)))
|> put_change(:transaction_hash_hash, hash_to_lower_case_string(get_field(changeset, :transaction_hash)))
|> put_change(:subject_hash, get_field(changeset, :subject))
|> force_change(:from_address_hash_hash, hash_to_lower_case_string(get_field(changeset, :from_address_hash)))
|> force_change(:to_address_hash_hash, hash_to_lower_case_string(get_field(changeset, :to_address_hash)))
|> force_change(:transaction_hash_hash, hash_to_lower_case_string(get_field(changeset, :transaction_hash)))
|> force_change(:subject_hash, get_field(changeset, :subject))
end
@doc """

@ -5257,11 +5257,11 @@ defmodule Explorer.Chain do
result
{:exit, reason} ->
Logger.warn("Query fetching token counters terminated: #{inspect(reason)}")
Logger.warning("Query fetching token counters terminated: #{inspect(reason)}")
0
nil ->
Logger.warn("Query fetching token counters timed out.")
Logger.warning("Query fetching token counters timed out.")
0
end
end)

@ -192,7 +192,7 @@ defmodule Explorer.Chain.Address do
|> stream_binary()
|> Stream.zip(match_byte_stream)
|> Enum.map(fn
{digit, _} when digit in '0123456789' ->
{digit, _} when digit in ~c"0123456789" ->
digit
{alpha, 1} ->
@ -220,7 +220,7 @@ defmodule Explorer.Chain.Address do
|> stream_binary()
|> Stream.zip(match_byte_stream)
|> Enum.map(fn
{digit, _} when digit in '0123456789' ->
{digit, _} when digit in ~c"0123456789" ->
digit
{alpha, 1} ->

@ -490,7 +490,7 @@ defmodule Explorer.Chain.Address.Counters do
Map.put(acc, type, counter)
{:exit, reason} ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"Query fetching address counters for #{address_hash} terminated: #{inspect(reason)}"
]
@ -499,7 +499,7 @@ defmodule Explorer.Chain.Address.Counters do
acc
nil ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"Query fetching address counters for #{address_hash} timed out."
]

@ -153,7 +153,7 @@ defmodule Explorer.Chain.Hash do
def to_iodata(%__MODULE__{byte_count: byte_count} = hash) do
integer = to_integer(hash)
hexadecimal_digit_count = byte_count_to_hexadecimal_digit_count(byte_count)
unprefixed = :io_lib.format('~#{hexadecimal_digit_count}.16.0b', [integer])
unprefixed = :io_lib.format(~c"~#{hexadecimal_digit_count}.16.0b", [integer])
["0x", unprefixed]
end

@ -237,7 +237,7 @@ defmodule Explorer.Chain.Log do
end
rescue
e ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"Could not decode input data for log from transaction hash: ",
Hash.to_iodata(transaction_hash),

@ -30,7 +30,9 @@ defmodule Explorer.Chain.Mud do
@schema_prefix "mud"
@store_tables_table_id Base.decode16!("746273746f72650000000000000000005461626c657300000000000000000000", case: :lower)
@store_tables_table_id Base.decode16!("746273746f72650000000000000000005461626c657300000000000000000000",
case: :lower
)
# https://github.com/latticexyz/mud/blob/cc4f4246e52982354e398113c46442910f9b04bb/packages/store/src/codegen/tables/Tables.sol#L34-L42
@store_tables_table_schema %Schema{

@ -1149,7 +1149,7 @@ defmodule Explorer.Chain.SmartContract do
defp error_message(%{"message" => string} = error) when is_map(error), do: error_message_with_log(string)
defp error_message(error) do
Logger.warn(fn -> ["Unknown verifier error: ", inspect(error)] end)
Logger.warning(fn -> ["Unknown verifier error: ", inspect(error)] end)
"There was an error validating your contract, please try again."
end

@ -58,7 +58,9 @@ defmodule Explorer.Chain.SmartContract.AuditReport do
|> cast(attrs, @optional_fields ++ @required_fields)
|> validate_required(@required_fields, message: "Required")
|> validate_length(:submitter_email, max: @max_string_length)
|> validate_format(:submitter_email, ~r/^[A-Z0-9._%+-]+@[A-Z0-9-]+.+.[A-Z]{2,4}$/i, message: "invalid email address")
|> validate_format(:submitter_email, ~r/^[A-Z0-9._%+-]+@[A-Z0-9-]+.+.[A-Z]{2,4}$/i,
message: "invalid email address"
)
|> validate_format(:submitter_name, ~r/[a-zA-Z ]+/i, message: "only letters are allowed")
|> validate_length(:submitter_name, max: @max_string_length)
|> validate_length(:project_name, max: @max_string_length)

@ -145,7 +145,7 @@ defmodule Explorer.Chain.Stability.Validator do
%{active: active_validators_list, all: validators_list}
error ->
Logger.warn(fn -> ["Error on getting validator lists: #{inspect(error)}"] end)
Logger.warning(fn -> ["Error on getting validator lists: #{inspect(error)}"] end)
nil
end
end
@ -164,7 +164,8 @@ defmodule Explorer.Chain.Stability.Validator do
result =
case format_missing_blocks_result(response) do
{:error, message} ->
Logger.warn(fn -> ["Error on getValidatorMissingBlocks for #{validators_address_hashes}: #{message}"] end)
Logger.warning(fn -> ["Error on getValidatorMissingBlocks for #{validators_address_hashes}: #{message}"] end)
nil
amount ->

@ -992,7 +992,7 @@ defmodule Explorer.Chain.Transaction do
end
rescue
e ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"Could not decode input data for transaction: ",
Hash.to_iodata(hash),
@ -1022,7 +1022,7 @@ defmodule Explorer.Chain.Transaction do
{:ok, mapping}
rescue
e ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"Could not decode input data for transaction: ",
Hash.to_iodata(hash),

@ -33,7 +33,7 @@ defmodule Explorer.ChainSpec.GenesisData do
# Callback for errored fetch
@impl GenServer
def handle_info({_ref, {:error, reason}}, state) do
Logger.warn(fn -> "Failed to fetch and import genesis data or precompiled contracts: '#{reason}'." end)
Logger.warning(fn -> "Failed to fetch and import genesis data or precompiled contracts: '#{reason}'." end)
fetch_genesis_data()
@ -90,7 +90,9 @@ defmodule Explorer.ChainSpec.GenesisData do
Logger.info(fn -> "Fetching precompiled config path: #{inspect(precompiled_config_path)}." end)
if is_nil(chain_spec_path) and is_nil(precompiled_config_path) do
Logger.warn(fn -> "Genesis data is not fetched. Neither chain spec path or precompiles config path are set." end)
Logger.warning(fn ->
"Genesis data is not fetched. Neither chain spec path or precompiles config path are set."
end)
else
json_rpc_named_arguments = Application.fetch_env!(:indexer, :json_rpc_named_arguments)
variant = Keyword.fetch!(json_rpc_named_arguments, :variant)
@ -143,7 +145,7 @@ defmodule Explorer.ChainSpec.GenesisData do
{:error, reason} ->
# credo:disable-for-next-line Credo.Check.Refactor.Nesting
Logger.warn(fn -> "#{warn_message_prefix} #{inspect(reason)}" end)
Logger.warning(fn -> "#{warn_message_prefix} #{inspect(reason)}" end)
nil
end
else

@ -119,7 +119,7 @@ defmodule Explorer.ChainSpec.Geth.Importer do
if accounts do
parse_accounts(accounts)
else
Logger.warn(fn -> "No accounts are defined in genesis" end)
Logger.warning(fn -> "No accounts are defined in genesis" end)
[]
end

@ -98,7 +98,7 @@ defmodule Explorer.ChainSpec.Parity.Importer do
if accounts do
parse_accounts(accounts)
else
Logger.warn(fn -> "No accounts are defined in chain spec" end)
Logger.warning(fn -> "No accounts are defined in chain spec" end)
[]
end
@ -112,7 +112,7 @@ defmodule Explorer.ChainSpec.Parity.Importer do
|> parse_hex_numbers()
|> format_ranges()
else
Logger.warn(fn -> "No rewards are defined in chain spec" end)
Logger.warning(fn -> "No rewards are defined in chain spec" end)
[]
end

@ -39,7 +39,7 @@ defmodule Explorer.ChainSpec.POA.Importer do
def import_emission_rewards do
if is_nil(rewards_contract_address()) do
Logger.warn(fn -> "No rewards contract address is defined" end)
Logger.warning(fn -> "No rewards contract address is defined" end)
else
block_reward = block_reward_amount()
emission_funds = emission_funds_amount()

@ -902,7 +902,7 @@ defmodule Explorer.EthRPC do
"from" => transaction.from_address_hash,
"gasUsed" => encode_quantity(transaction.gas_used),
"logs" => Enum.map(transaction.logs, &render_log(&1, transaction)),
'logsBloom' => "0x" <> (transaction.logs |> BloomFilter.logs_bloom() |> Base.encode16(case: :lower)),
"logsBloom" => "0x" <> (transaction.logs |> BloomFilter.logs_bloom() |> Base.encode16(case: :lower)),
"status" => encode_quantity(status),
"to" => transaction.to_address_hash,
"transactionHash" => transaction.hash,

@ -41,7 +41,7 @@ defmodule Explorer.ExchangeRates do
# Callback for errored fetch
@impl GenServer
def handle_info({_ref, {:error, reason}}, state) do
Logger.warn(fn -> "Failed to get exchange rates with reason '#{reason}'." end)
Logger.warning(fn -> "Failed to get exchange rates with reason '#{reason}'." end)
schedule_next_consolidation()

@ -60,7 +60,7 @@ defmodule Explorer.History.Process do
@spec failed_compilation(non_neg_integer(), module(), non_neg_integer()) :: any()
defp failed_compilation(day_count, historian, failed_attempts) do
Logger.warn(fn -> "Failed to fetch market history. Trying again." end)
Logger.warning(fn -> "Failed to fetch market history. Trying again." end)
compile_historical_records(day_count, historian, failed_attempts + 1)
end

@ -119,7 +119,7 @@ defmodule Explorer.Market.History.Cataloger do
# Failed to get records. Try again.
@impl GenServer
def handle_info({_ref, {:price_history, {day_count, failed_attempts, secondary_coin?, :error}}}, state) do
Logger.warn(fn -> "Failed to fetch price history. Trying again." end)
Logger.warning(fn -> "Failed to fetch price history. Trying again." end)
fetch_price_history(day_count, secondary_coin?, failed_attempts + 1)
@ -129,7 +129,7 @@ defmodule Explorer.Market.History.Cataloger do
# Failed to get records. Try again.
@impl GenServer
def handle_info({_ref, {:market_cap_history, {day_count, failed_attempts, :error}}}, state) do
Logger.warn(fn -> "Failed to fetch market cap history. Trying again." end)
Logger.warning(fn -> "Failed to fetch market cap history. Trying again." end)
fetch_market_cap_history(day_count, failed_attempts + 1)
@ -139,7 +139,7 @@ defmodule Explorer.Market.History.Cataloger do
# Failed to get records. Try again.
@impl GenServer
def handle_info({_ref, {:tvl_history, {day_count, failed_attempts, :error}}}, state) do
Logger.warn(fn -> "Failed to fetch tvl history. Trying again." end)
Logger.warning(fn -> "Failed to fetch tvl history. Trying again." end)
fetch_tvl_history(day_count, failed_attempts + 1)

@ -868,7 +868,7 @@ defmodule Explorer.SmartContract.Reader do
result =
if String.ends_with?(type, "[]") do
value
|> Enum.map(fn tuple -> new_value(%{"type" => String.slice(type, 0..-3)}, [tuple], 0) end)
|> Enum.map(fn tuple -> new_value(%{"type" => String.slice(type, 0..-3//1)}, [tuple], 0) end)
|> flat_arrays_map()
else
value
@ -922,7 +922,7 @@ defmodule Explorer.SmartContract.Reader do
def zip_tuple_values_with_types(value, type) do
types_string =
type
|> String.slice(6..-2)
|> String.slice(6..-2//1)
types =
if String.trim(types_string) == "" do

@ -125,7 +125,7 @@ defmodule Explorer.SmartContract.Solidity.CodeCompiler do
error ->
error = parse_error(error)
Logger.warn(["There was an error compiling a provided contract: ", inspect(error)])
Logger.warning(["There was an error compiling a provided contract: ", inspect(error)])
{:error, [first_error | _]} = error
%{"message" => error_message} = first_error
{:error, :compilation, error_message}
@ -164,7 +164,7 @@ defmodule Explorer.SmartContract.Solidity.CodeCompiler do
error ->
error = parse_error(error)
Logger.warn(["There was an error compiling a provided contract: ", inspect(error)])
Logger.warning(["There was an error compiling a provided contract: ", inspect(error)])
{:error, [first_error | _]} = error
%{"message" => error_message} = first_error
{:error, :compilation, error_message}

@ -444,9 +444,9 @@ defmodule Explorer.SmartContract.Solidity.Verifier do
defp extract_meta_from_deployed_bytecode(code_unknown_case) do
with true <- is_binary(code_unknown_case),
code <- String.downcase(code_unknown_case),
last_2_bytes <- code |> String.slice(-4..-1),
last_2_bytes <- code |> String.slice(-4..-1//1),
{meta_length, ""} <- last_2_bytes |> Integer.parse(16),
meta <- String.slice(code, (-(meta_length + 2) * 2)..-5) do
meta <- String.slice(code, (-(meta_length + 2) * 2)..-5//1) do
{meta, last_2_bytes}
else
_ ->

@ -388,13 +388,10 @@ defmodule Explorer.ThirdPartyIntegrations.Sourcify do
end
defp prepare_additional_source(address_hash_string, %{"name" => _name, "content" => content, "path" => path}) do
splitted_path =
trimmed_path =
path
|> String.split("/")
trimmed_path =
splitted_path
|> Enum.slice(9..Enum.count(splitted_path))
|> Enum.slice(9..-1)
|> Enum.join("/")
%{

@ -507,7 +507,7 @@ defmodule Explorer.Token.MetadataRetriever do
if error =~ "execution reverted" or error =~ @vm_execution_error do
{:error, @vm_execution_error}
else
Logger.warn(["Unknown metadata format error #{inspect(error)}."], fetcher: :token_instances)
Logger.warning(["Unknown metadata format error #{inspect(error)}."], fetcher: :token_instances)
# truncate error since it will be stored in DB
{:error, truncate_error(error)}
@ -520,7 +520,7 @@ defmodule Explorer.Token.MetadataRetriever do
ipfs? = true
fetch_json_from_uri({:ok, [ipfs_link(result)]}, ipfs?, token_id, hex_token_id, from_base_uri?)
else
Logger.warn(["Unknown metadata format result #{inspect(result)}."], fetcher: :token_instances)
Logger.warning(["Unknown metadata format result #{inspect(result)}."], fetcher: :token_instances)
{:error, truncate_error(result)}
end
@ -575,7 +575,7 @@ defmodule Explorer.Token.MetadataRetriever do
end
rescue
e ->
Logger.warn(
Logger.warning(
[
"Unknown metadata format base64 #{inspect(base64_encoded_json)}.",
Exception.format(:error, e, __STACKTRACE__)
@ -604,7 +604,7 @@ defmodule Explorer.Token.MetadataRetriever do
check_type(json, hex_token_id)
rescue
e ->
Logger.warn(["Unknown metadata format #{inspect(json)}.", Exception.format(:error, e, __STACKTRACE__)],
Logger.warning(["Unknown metadata format #{inspect(json)}.", Exception.format(:error, e, __STACKTRACE__)],
fetcher: :token_instances
)
@ -612,7 +612,7 @@ defmodule Explorer.Token.MetadataRetriever do
end
defp fetch_json_from_uri(uri, _ipfs?, _token_id, _hex_token_id, _from_base_uri?) do
Logger.warn(["Unknown metadata uri format #{inspect(uri)}."], fetcher: :token_instances)
Logger.warning(["Unknown metadata uri format #{inspect(uri)}."], fetcher: :token_instances)
{:error, "unknown metadata uri format"}
end
@ -623,7 +623,7 @@ defmodule Explorer.Token.MetadataRetriever do
fetch_json_from_uri({:ok, [decoded_json]}, ipfs?, token_id, hex_token_id, from_base_uri?)
rescue
e ->
Logger.warn(["Unknown metadata format #{inspect(json)}.", Exception.format(:error, e, __STACKTRACE__)],
Logger.warning(["Unknown metadata format #{inspect(json)}.", Exception.format(:error, e, __STACKTRACE__)],
fetcher: :token_instances
)
@ -643,7 +643,7 @@ defmodule Explorer.Token.MetadataRetriever do
fetch_metadata_from_uri(prepared_uri, ipfs?, hex_token_id)
rescue
e ->
Logger.warn(
Logger.warning(
["Could not prepare token uri #{inspect(uri)}.", Exception.format(:error, e, __STACKTRACE__)],
fetcher: :token_instances
)
@ -683,7 +683,7 @@ defmodule Explorer.Token.MetadataRetriever do
{:error_code, code}
{:error, %Error{reason: reason}} ->
Logger.warn(
Logger.warning(
["Request to token uri failed: #{inspect(uri)}.", inspect(reason)],
fetcher: :token_instances
)
@ -692,7 +692,7 @@ defmodule Explorer.Token.MetadataRetriever do
end
rescue
e ->
Logger.warn(
Logger.warning(
["Could not send request to token uri #{inspect(uri)}.", Exception.format(:error, e, __STACKTRACE__)],
fetcher: :token_instances
)

@ -119,7 +119,8 @@ defmodule Explorer.Mixfile do
{:redix, "~> 1.1"},
{:hammer_backend_redis, "~> 6.1"},
{:logger_json, "~> 5.1"},
{:typed_ecto_schema, "~> 0.4.1", runtime: false}
{:typed_ecto_schema, "~> 0.4.1", runtime: false},
{:ueberauth, "~> 0.7"}
]
end

@ -93,7 +93,10 @@ defmodule Explorer.Chain.BlockTest do
test "with uncles", %{emission_reward: %{reward: reward, block_range: range}} do
block =
build(:block, number: range.from, uncles: ["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d15273311"])
build(:block,
number: range.from,
uncles: ["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d15273311"]
)
expected_uncle_reward = Wei.div(reward, 32)

@ -1,5 +1,5 @@
defmodule Explorer.Chain.Cache.GasPriceOracleTest do
use Explorer.DataCase
use Explorer.DataCase, async: false
alias Explorer.Chain.Cache.GasPriceOracle
alias Explorer.Chain.Wei

@ -500,7 +500,7 @@ defmodule Explorer.Chain.SmartContract.ProxyTest do
case mode do
:full_32 -> "0x000000000000000000000000" <> beacon_contract_address_hash_string
:exact_20 -> "0x" <> beacon_contract_address_hash_string
:short -> "0x" <> String.slice(beacon_contract_address_hash_string, 10..-1)
:short -> "0x" <> String.slice(beacon_contract_address_hash_string, 10..-1//1)
end
EthereumJSONRPC.Mox

@ -2333,7 +2333,11 @@ defmodule Explorer.ChainTest do
|> insert()
|> with_block()
insert(:token_transfer, transaction: transaction, block: transaction.block, block_number: transaction.block_number)
insert(:token_transfer,
transaction: transaction,
block: transaction.block,
block_number: transaction.block_number
)
assert [%TokenTransfer{token: %Token{}, transaction: %Transaction{}}] =
Chain.transaction_to_token_transfers(
@ -2936,7 +2940,9 @@ defmodule Explorer.ChainTest do
decompiled_smart_contracts =
Repo.all(
from(ds in DecompiledSmartContract, where: ds.address_hash == ^inserted_decompiled_smart_contract.address_hash)
from(ds in DecompiledSmartContract,
where: ds.address_hash == ^inserted_decompiled_smart_contract.address_hash
)
)
assert Enum.count(decompiled_smart_contracts) == 2

@ -36,7 +36,11 @@ defmodule Explorer.Counters.AverageBlockTimeTest do
insert(:block, number: block_number, consensus: true, timestamp: Timex.shift(first_timestamp, seconds: -100 - 6))
insert(:block, number: block_number, consensus: false, timestamp: Timex.shift(first_timestamp, seconds: -100 - 12))
insert(:block,
number: block_number,
consensus: false,
timestamp: Timex.shift(first_timestamp, seconds: -100 - 12)
)
insert(:block, number: block_number, consensus: false, timestamp: Timex.shift(first_timestamp, seconds: -100 - 9))

@ -143,7 +143,7 @@ defmodule Explorer.ExchangeRates.Source.CoinGeckoTest do
Application.put_env(:explorer, CoinGecko, base_url: "http://localhost:#{bypass.port}")
on_exit(fn ->
Application.put_env(:explorer, :coin, "POA")
Application.put_env(:explorer, :coin, "ETH")
end)
{:ok, bypass: bypass}

@ -2,6 +2,7 @@ defmodule Explorer.Market.History.CatalogerTest do
use Explorer.DataCase, async: false
import Mox
import Ecto.Query, only: [order_by: 2]
alias Explorer.Market.MarketHistory
alias Explorer.Market.History.Cataloger
@ -221,7 +222,7 @@ defmodule Explorer.Market.History.CatalogerTest do
%Explorer.Market.MarketHistory{
date: ~D[2018-04-02]
} = second_entry
] = MarketHistory |> Repo.all()
] = MarketHistory |> order_by(asc: :date) |> Repo.all()
assert Decimal.eq?(first_entry.closing_price, Decimal.new(10))
assert Decimal.eq?(second_entry.closing_price, Decimal.new(20))

@ -18,6 +18,8 @@ defmodule Explorer.MarketTest do
end
test "fetch_recent_history/1" do
ConCache.delete(:market_history, :last_update)
today = Date.utc_today()
records =

@ -236,7 +236,7 @@ defmodule Indexer.Block.Realtime.Fetcher do
end
def import(_, _) do
Logger.warn("Empty parameters were provided for realtime fetcher")
Logger.warning("Empty parameters were provided for realtime fetcher")
{:ok, []}
end

@ -438,7 +438,7 @@ defmodule Indexer.BufferedTask do
new_bound_queue
{%BoundQueue{maximum_size: maximum_size} = new_bound_queue, remaining_entries} ->
Logger.warn(fn ->
Logger.warning(fn ->
[
"BufferedTask ",
process(self()),

@ -195,7 +195,7 @@ defmodule Indexer.Fetcher.OnDemand.TokenBalance do
end
defp prepare_updated_balance({{:error, error}, ctb}, block_number) do
Logger.warn(fn ->
Logger.warning(fn ->
[
"Error on updating current token #{to_string(ctb.token_contract_address_hash)} balance for address #{to_string(ctb.address_hash)} at block number #{block_number}: ",
inspect(error)

@ -290,7 +290,7 @@ defmodule Indexer.Fetcher.TokenInstance.Helper do
rescue
error in Postgrex.Error ->
if retrying? do
Logger.warn(
Logger.warning(
[
"Failed to upsert token instance: {#{to_string(token_contract_address_hash)}, #{token_id}}, error: #{inspect(error)}"
],

@ -263,7 +263,7 @@ defmodule Indexer.Fetcher.TransactionAction do
end
if next_block < first_block do
Logger.warn(
Logger.warning(
"It seems #{__MODULE__} already finished work for the block range #{first_block}..#{last_block} and " <>
if(Enum.empty?(protocols),
do: "all supported protocols.",

@ -67,7 +67,7 @@ defmodule Indexer.Fetcher.Withdrawal do
{:ok, state}
else
Logger.warn("Please, specify the first block of the block range for #{__MODULE__}.")
Logger.warning("Please, specify the first block of the block range for #{__MODULE__}.")
:ignore
end
end

@ -112,7 +112,7 @@ defmodule Indexer.Memory.Monitor do
end
defp log_memory(%{total: total, limit: limit}) do
Logger.warn(fn ->
Logger.warning(fn ->
[
to_string(total),
" / ",
@ -158,7 +158,7 @@ defmodule Indexer.Memory.Monitor do
end
defp shrink([{pid, memory} | tail]) do
Logger.warn(fn ->
Logger.warning(fn ->
[
"Worst memory usage (",
to_string(memory),

@ -544,10 +544,10 @@ defmodule Indexer.Transform.TransactionActions do
defp uniswap_handle_swap_amounts(log, amount0, amount1, symbol0, symbol1, address0, address1) do
cond do
String.first(amount0) === "-" and String.first(amount1) !== "-" ->
{amount1, symbol1, address1, String.slice(amount0, 1, String.length(amount0) - 1), symbol0, address0, false}
{amount1, symbol1, address1, String.slice(amount0, 1..-1//1), symbol0, address0, false}
String.first(amount1) === "-" and String.first(amount0) !== "-" ->
{amount0, symbol0, address0, String.slice(amount1, 1, String.length(amount1) - 1), symbol1, address1, false}
{amount0, symbol0, address0, String.slice(amount1, 1..-1//1), symbol1, address1, false}
amount1 === "0" and String.first(amount0) !== "-" ->
{amount0, symbol0, address0, amount1, symbol1, address1, false}

@ -243,7 +243,8 @@ defmodule Indexer.BufferedTaskTest do
flush_timer: nil,
task_supervisor: BufferedTaskSup,
max_batch_size: 1,
max_concurrency: 1
max_concurrency: 1,
poll: false
})
refute flush_timer == nil

@ -1,4 +1,4 @@
FROM hexpm/elixir:1.14.5-erlang-24.2.2-alpine-3.18.2 AS builder
FROM hexpm/elixir:1.16.3-erlang-26.2.5.1-alpine-3.18.7 AS builder
WORKDIR /app
@ -68,7 +68,7 @@ RUN mkdir -p /opt/release \
&& mv _build/${MIX_ENV}/rel/blockscout /opt/release
##############################################################
FROM hexpm/elixir:1.14.5-erlang-24.2.2-alpine-3.18.2
FROM hexpm/elixir:1.16.3-erlang-26.2.5.1-alpine-3.18.7
ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION}

@ -115,7 +115,7 @@
"prometheus_ex": {:git, "https://github.com/lanodan/prometheus.ex", "31f7fbe4b71b79ba27efc2a5085746c4011ceb8f", [branch: "fix/elixir-1.14"]},
"prometheus_phoenix": {:hex, :prometheus_phoenix, "1.3.0", "c4b527e0b3a9ef1af26bdcfbfad3998f37795b9185d475ca610fe4388fdd3bb5", [:mix], [{:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.3 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm", "c4d1404ac4e9d3d963da601db2a7d8ea31194f0017057fabf0cfb9bf5a6c8c75"},
"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", "0273a6483ccb936d79ca19b0ab629aef0dba958697c94782bb728b920dfc6a79"},
"prometheus_process_collector": {:hex, :prometheus_process_collector, "1.6.0", "b169e224337497cd858da16f9361edabc5931b9d12201a97ee15d88ef5a6fcaa", [:rebar3], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm", "e9cd9846f204de7a04863f56308d8d1193bec714210bf6374d9d4fc088d2896d"},
"prometheus_process_collector": {:git, "https://github.com/Phybbit/prometheus_process_collector.git", "3dc94dcff422d7b9cbd7ddf6bf2a896446705f3f", [ref: "3dc94dcff422d7b9cbd7ddf6bf2a896446705f3f"]},
"qrcode": {:hex, :qrcode, "0.1.5", "551271830515c150f34568345b060c625deb0e6691db2a01b0a6de3aafc93886", [:mix], [], "hexpm", "a266b7fb7be0d3b713912055dde3575927eca920e5d604ded45cd534f6b7a447"},
"quantile_estimator": {:hex, :quantile_estimator, "0.2.1", "ef50a361f11b5f26b5f16d0696e46a9e4661756492c981f7b2229ef42ff1cd15", [:rebar3], [], "hexpm", "282a8a323ca2a845c9e6f787d166348f776c1d4a41ede63046d72d422e3da946"},
"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"},

Loading…
Cancel
Save