Skip to content
This repository has been archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
Fix some tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
enrique committed Oct 14, 2021
1 parent f1d5999 commit 736f7b4
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 16 deletions.
1 change: 1 addition & 0 deletions .dialyzer-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ lib/block_scout_web/views/transaction_view.ex:197
lib/block_scout_web/templates/address_contract/index.html.eex:168
lib/block_scout_web/templates/address_contract/index.html.eex:211
lib/explorer/smart_contract/reader.ex:379
lib/explorer/smart_contract/reader.ex:478

lib/indexer/buffered_task.ex:402
lib/indexer/buffered_task.ex:451
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.12.3-otp-24
elixir 1.12.3
erlang 24.1
nodejs 14.18.0
2 changes: 1 addition & 1 deletion apps/block_scout_web/lib/block_scout_web/web_router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule BlockScoutWeb.WebRouter do

resources("/blocks", BlockController, as: :blocks, only: [:index])

resources "/blocks", BlockController, as: :block_secondary, only: [:show], param: "hash_or_number" do
resources "/blocks", BlockController, only: [:index, :show], param: "hash_or_number" do
resources("/transactions", BlockTransactionController, only: [:index], as: :transaction)
resources("/signers", BlockSignersController, only: [:index], as: :signers)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ defmodule BlockScoutWeb.TransactionTokenTransferControllerTest do
test "preloads to_address smart contract verified", %{conn: conn} do
transaction = insert(:transaction_to_verified_contract)

expect(EthereumJSONRPC.Mox, :json_rpc, fn _, _options ->
expect(EthereumJSONRPC.Mox, :json_rpc, 2, fn _, _options ->
{:ok, "0x0000000000000000000000000000000000000000000000000000000000000000"}
end)

Expand Down
4 changes: 2 additions & 2 deletions apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/block.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ defmodule EthereumJSONRPC.Block do
transactions_root: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
uncles: []
}
[Geth] `elixir` can be converted to params
# [Geth] `elixir` can be converted to params
iex> EthereumJSONRPC.Block.elixir_to_params(
...> %{
...> "difficulty" => 17561410778,
Expand Down Expand Up @@ -583,4 +583,4 @@ defmodule EthereumJSONRPC.Block do
defp entry_to_elixir({"l1BlockNumber", _}) do
{:ignore, :ignore}
end
end
end
3 changes: 2 additions & 1 deletion apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ defmodule EthereumJSONRPC.Transaction do
...> "value" => 31337
...> }
...> )
%{
block_hash: "0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd",
block_number: 46147,
Expand Down Expand Up @@ -551,4 +552,4 @@ defmodule EthereumJSONRPC.Transaction do
defp entry_to_elixir(_) do
{nil, nil}
end
end
end
4 changes: 1 addition & 3 deletions apps/explorer/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ config :explorer, Explorer.ChainSpec.GenesisData,
chain_spec_path:
System.get_env(
"CHAIN_SPEC_PATH",
"https://www.googleapis.com/storage/v1/b/genesis_blocks/o/#{
String.downcase(System.get_env("SUBNETWORK", "Baklava"))
}?alt=media"
"https://www.googleapis.com/storage/v1/b/genesis_blocks/o/#{String.downcase(System.get_env("SUBNETWORK", "Baklava"))}?alt=media"
),
emission_format: System.get_env("EMISSION_FORMAT", "DEFAULT"),
rewards_contract_address: System.get_env("REWARDS_CONTRACT", "0xeca443e8e1ab29971a45a9c57a6a9875701698a5")
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/test/explorer/chain/log_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ defmodule Explorer.Chain.LogTest do
|> insert(to_address: to_address)
|> Repo.preload(to_address: :smart_contract)

expect(EthereumJSONRPC.Mox, :json_rpc, fn _, _options ->
expect(EthereumJSONRPC.Mox, :json_rpc, 2, fn _, _options ->
{:ok, "0x0000000000000000000000000000000000000000000000000000000000000000"}
end)

Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/test/explorer/chain/transaction_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ defmodule Explorer.Chain.TransactionTest do
|> insert()
|> Repo.preload(to_address: :smart_contract)

expect(EthereumJSONRPC.Mox, :json_rpc, fn _, _options ->
expect(EthereumJSONRPC.Mox, :json_rpc, 2, fn _, _options ->
{:ok, "0x0000000000000000000000000000000000000000000000000000000000000000"}
end)

Expand All @@ -283,7 +283,7 @@ defmodule Explorer.Chain.TransactionTest do
|> insert()
|> Repo.preload(to_address: :smart_contract)

expect(EthereumJSONRPC.Mox, :json_rpc, fn _, _options ->
expect(EthereumJSONRPC.Mox, :json_rpc, 2, fn _, _options ->
{:ok, "0x0000000000000000000000000000000000000000000000000000000000000000"}
end)

Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/test/explorer/chain_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ defmodule Explorer.ChainTest do

[_log] = Chain.address_to_logs(address_hash, paging_options: paging_options1)

paging_options2 = %PagingOptions{page_size: 60, key: {transaction.block_number, log1.index}}
paging_options2 = %PagingOptions{page_size: 60, key: {transaction.block_number, 0, log1.index}}

assert Enum.count(Chain.address_to_logs(address_hash, paging_options: paging_options2)) == 50
end
Expand Down
4 changes: 1 addition & 3 deletions apps/indexer/lib/indexer/fetcher/internal_transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ defmodule Indexer.Fetcher.InternalTransaction do
acc
) do
Logger.debug(
"Found #{Enum.count(internal_transactions)} internal tx for block #{block_number} had txs: #{num} used gas #{
used_gas
}"
"Found #{Enum.count(internal_transactions)} internal tx for block #{block_number} had txs: #{num} used gas #{used_gas}"
)

case check_db(num, Decimal.new(used_gas)) do
Expand Down

0 comments on commit 736f7b4

Please sign in to comment.