Update to Erlang/OTP 24

pull/4704/head
Viktor Baranov 3 years ago
parent 94286f548a
commit 907a473c24
  1. 3
      .dialyzer-ignore
  2. 2
      .github/workflows/config.yml
  3. 4
      .tool-versions
  4. 1
      CHANGELOG.md
  5. 2
      apps/explorer/lib/explorer/chain/bridged_token.ex
  6. 2
      apps/explorer/lib/explorer/chain/token/instance.ex
  7. 3
      apps/explorer/lib/explorer/smart_contract/writer.ex
  8. 2
      apps/explorer/lib/explorer/token/metadata_retriever.ex
  9. 4
      apps/explorer/test/explorer/chain_spec/parity/importer_test.exs
  10. 1
      apps/indexer/lib/indexer/fetcher/token_balance_on_demand.ex
  11. 2
      docker/Dockerfile

@ -5,11 +5,10 @@
:0: Unknown type 'Elixir.Address':t/0
apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex:400: Function timestamp_to_datetime/1 has no local return
lib/explorer/repo/prometheus_logger.ex:8
lib/explorer/smart_contract/publisher_worker.ex:1
lib/explorer/smart_contract/publisher_worker.ex:6
apps/explorer/lib/explorer/repo/prometheus_logger.ex:8: Function microseconds_time/1 has no local return
apps/explorer/lib/explorer/repo/prometheus_logger.ex:8: The call 'Elixir.System':convert_time_unit(__@1::any(),'native','microseconds') breaks the contract (integer(),time_unit() | 'native',time_unit() | 'native') -> integer()
apps/explorer/lib/explorer/smart_contract/publisher_worker.ex:6: The pattern 'false' can never match the type 'true'
apps/explorer/lib/explorer/smart_contract/publisher_worker.ex:6: The test 5 == 'infinity' can never evaluate to 'true'
lib/block_scout_web/router.ex:1
lib/block_scout_web/schema/types.ex:31
lib/phoenix/router.ex:324

@ -11,7 +11,7 @@ on:
env:
MIX_ENV: test
OTP_VERSION: '23.3.4.7'
OTP_VERSION: '24.1'
ELIXIR_VERSION: '1.12.3'
jobs:

@ -1,3 +1,3 @@
elixir 1.12.3-otp-23
erlang 23.3.4.7
elixir 1.12.3-otp-24
erlang 24.1
nodejs 14.17.0

@ -33,6 +33,7 @@
- [#4582](https://github.com/blockscout/blockscout/pull/4582) - Fix NaN input on write contract page
### Chore
- [#4704](https://github.com/blockscout/blockscout/pull/4704) - Update to Erlang/OTP 24
- [#4682](https://github.com/blockscout/blockscout/pull/4682) - Update all possible outdated mix dependencies
- [#4663](https://github.com/blockscout/blockscout/pull/4663) - Migrate to Elixir 1.12.x
- [#4661](https://github.com/blockscout/blockscout/pull/4661) - Update NPM packages to resolve vulnerabilities

@ -8,7 +8,7 @@ defmodule Explorer.Chain.BridgedToken do
import Ecto.Changeset
alias Explorer.Chain.{BridgedToken, Hash, Token}
alias Explorer.Chain.{Address, BridgedToken, Hash, Token}
alias Explorer.Repo
@typedoc """

@ -18,7 +18,7 @@ defmodule Explorer.Chain.Token.Instance do
@type t :: %Instance{
token_id: non_neg_integer(),
token_contract_address_hash: Hash.Address.t(),
metadata: Map.t(),
metadata: map(),
error: String.t()
}

@ -4,6 +4,7 @@ defmodule Explorer.SmartContract.Writer do
"""
alias Explorer.Chain
alias Explorer.Chain.Hash
alias Explorer.SmartContract.Helper
@spec write_functions(Hash.t()) :: [%{}]
@ -23,7 +24,7 @@ defmodule Explorer.SmartContract.Writer do
end
end
@spec write_functions_proxy(Hash.t()) :: [%{}]
@spec write_functions_proxy(Hash.t() | String.t()) :: [%{}]
def write_functions_proxy(implementation_address_hash_string) do
implementation_abi = Chain.get_implementation_abi(implementation_address_hash_string)

@ -130,7 +130,7 @@ defmodule Explorer.Token.MetadataRetriever do
It will retry to fetch each function in the Smart Contract according to :token_functions_reader_max_retries
configured in the application env case one of them raised error.
"""
@spec get_functions_of([String.t()] | Hash.t() | String.t()) :: Map.t() | {:ok, [Map.t()]}
@spec get_functions_of([String.t()] | Hash.t() | String.t()) :: map() | {:ok, [map()]}
def get_functions_of(hashes) when is_list(hashes) do
requests =
hashes

@ -106,9 +106,9 @@ defmodule Explorer.ChainSpec.Parity.ImporterTest do
assert %{
address_hash: %Hash{
byte_count: 20,
bytes: <<121, 174, 179, 69, 102, 185, 116, 195, 90, 88, 129, 222, 192, 32, 146, 125, 167, 223, 93, 37>>
bytes: <<167, 105, 41, 137, 10, 123, 71, 251, 133, 145, 150, 1, 108, 111, 221, 130, 137, 206, 183, 85>>
},
value: 2_000_000_000_000_000_000_000,
value: 5_000_000_000_000_000_000_000,
contract_code: nil,
nonce: 0
} ==

@ -9,6 +9,7 @@ defmodule Indexer.Fetcher.TokenBalanceOnDemand do
alias Explorer.Chain
alias Explorer.Chain.Address.CurrentTokenBalance
alias Explorer.Chain.Cache.BlockNumber
alias Explorer.Chain.Hash
alias Explorer.Counters.AverageBlockTime
alias Explorer.Token.BalanceReader
alias Timex.Duration

@ -1,4 +1,4 @@
FROM bitwalker/alpine-elixir-phoenix:1.12.2
FROM bitwalker/alpine-elixir-phoenix:1.12.3
RUN apk --no-cache --update add alpine-sdk gmp-dev automake libtool inotify-tools autoconf python3 file

Loading…
Cancel
Save