Merge pull request #7936 from blockscout/vb-small-refactoring

Small refactoring
pull/7939/head
Victor Baranov 1 year ago committed by GitHub
commit ce4f28c982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .dialyzer-ignore
  2. 2
      CHANGELOG.md
  3. 4
      apps/block_scout_web/lib/block_scout_web/api_router.ex
  4. 2
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/rolling_window.ex
  5. 4
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
  6. 2
      apps/indexer/lib/indexer/fetcher/block_reward.ex

@ -3,7 +3,7 @@
:0: Unknown type 'Elixir.Map':t/0 :0: Unknown type 'Elixir.Map':t/0
:0: Unknown type 'Elixir.Hash':t/0 :0: Unknown type 'Elixir.Hash':t/0
:0: Unknown type 'Elixir.Address':t/0 :0: Unknown type 'Elixir.Address':t/0
lib/ethereum_jsonrpc/rolling_window.ex:173 lib/ethereum_jsonrpc/rolling_window.ex:171
lib/explorer/smart_contract/solidity/publisher_worker.ex:1 lib/explorer/smart_contract/solidity/publisher_worker.ex:1
lib/explorer/smart_contract/vyper/publisher_worker.ex:1 lib/explorer/smart_contract/vyper/publisher_worker.ex:1
lib/explorer/smart_contract/solidity/publisher_worker.ex:6 lib/explorer/smart_contract/solidity/publisher_worker.ex:6

@ -26,7 +26,7 @@
### Chore ### Chore
- [#7934](https://github.com/blockscout/blockscout/pull/7934) - Explicitly set consensus == true in queries (convenient for search) - [#7934](https://github.com/blockscout/blockscout/pull/7934), [#7936](https://github.com/blockscout/blockscout/pull/7936) - Explicitly set consensus == true in queries (convenient for search), remove logger requirements, where it is not used anymore
- [#7901](https://github.com/blockscout/blockscout/pull/7901) - Fix Docker image build - [#7901](https://github.com/blockscout/blockscout/pull/7901) - Fix Docker image build
- [#7890](https://github.com/blockscout/blockscout/pull/7890), [#7918](https://github.com/blockscout/blockscout/pull/7918) - Resolve warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead - [#7890](https://github.com/blockscout/blockscout/pull/7890), [#7918](https://github.com/blockscout/blockscout/pull/7918) - Resolve warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
- [#7863](https://github.com/blockscout/blockscout/pull/7863) - Add max_age for account sessions - [#7863](https://github.com/blockscout/blockscout/pull/7863) - Add max_age for account sessions

@ -203,7 +203,7 @@ defmodule BlockScoutWeb.ApiRouter do
scope "/v1", as: :api_v1 do scope "/v1", as: :api_v1 do
pipe_through(:api) pipe_through(:api)
alias BlockScoutWeb.API.{EthRPC, RPC, V1} alias BlockScoutWeb.API.{EthRPC, RPC, V1}
alias BlockScoutWeb.API.V1.HealthController alias BlockScoutWeb.API.V1.{GasPriceOracleController, HealthController}
alias BlockScoutWeb.API.V2.SearchController alias BlockScoutWeb.API.V2.SearchController
# leave the same endpoint in v1 in order to keep backward compatibility # leave the same endpoint in v1 in order to keep backward compatibility
@ -215,7 +215,7 @@ defmodule BlockScoutWeb.ApiRouter do
get("/readiness", HealthController, :readiness) get("/readiness", HealthController, :readiness)
end end
get("/gas-price-oracle", V1.GasPriceOracleController, :gas_price_oracle) get("/gas-price-oracle", GasPriceOracleController, :gas_price_oracle)
if Application.compile_env(:block_scout_web, __MODULE__)[:reading_enabled] do if Application.compile_env(:block_scout_web, __MODULE__)[:reading_enabled] do
get("/supply", V1.SupplyController, :supply) get("/supply", V1.SupplyController, :supply)

@ -21,8 +21,6 @@ defmodule EthereumJSONRPC.RollingWindow do
use GenServer use GenServer
require Logger
def child_spec([init_arguments]) do def child_spec([init_arguments]) do
child_spec([init_arguments, []]) child_spec([init_arguments, []])
end end

@ -7,8 +7,6 @@ defmodule EthereumJSONRPC.Transaction do
[`eth_getTransactionByBlockHashAndIndex`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyblockhashandindex), [`eth_getTransactionByBlockHashAndIndex`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyblockhashandindex),
and [`eth_getTransactionByBlockNumberAndIndex`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyblocknumberandindex) and [`eth_getTransactionByBlockNumberAndIndex`](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyblocknumberandindex)
""" """
require Logger
import EthereumJSONRPC, only: [quantity_to_integer: 1, integer_to_quantity: 1, request: 1] import EthereumJSONRPC, only: [quantity_to_integer: 1, integer_to_quantity: 1, request: 1]
alias EthereumJSONRPC alias EthereumJSONRPC
@ -425,8 +423,6 @@ defmodule EthereumJSONRPC.Transaction do
end end
def to_elixir(transaction) when is_binary(transaction) do def to_elixir(transaction) when is_binary(transaction) do
# Logger.warn(["Fetched transaction is not full: ", transaction])
nil nil
end end

@ -100,7 +100,7 @@ defmodule Indexer.Fetcher.BlockReward do
{:error, reason} -> {:error, reason} ->
Logger.error( Logger.error(
fn -> fn ->
["failed to fetch: ", inspect(reason)] ["failed to fetch: ", inspect(reason), " hash: ", inspect(hash_string_by_number)]
end, end,
error_count: consensus_number_count error_count: consensus_number_count
) )

Loading…
Cancel
Save