fix: Fix fetch_first_trace tests (#10618)

pull/10631/head
Qwerty5Uiop 3 months ago committed by GitHub
parent a9c2a08716
commit 11644455ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs
  2. 5
      apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs
  3. 5
      apps/explorer/test/explorer/chain_test.exs

@ -736,6 +736,9 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
"txhash" => "#{transaction.hash}"
}
init_config = Application.get_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth)
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert response =
conn
|> get("/api", params)
@ -744,6 +747,8 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
assert response["result"]["revertReason"] == hex_reason
assert response["status"] == "1"
assert response["message"] == "OK"
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, init_config)
end
end
@ -836,6 +841,9 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
"txhash" => "#{transaction.hash}"
}
init_config = Application.get_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth)
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert response =
conn
|> get("/api", params)
@ -844,6 +852,8 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do
assert response["result"]["revertReason"] in ["", "0x"]
assert response["status"] == "1"
assert response["message"] == "OK"
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, init_config)
end
defp resolve_schema(result \\ %{}) do

@ -366,6 +366,9 @@ defmodule BlockScoutWeb.TransactionViewTest do
end
)
init_config = Application.get_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth)
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
revert_reason = TransactionView.transaction_revert_reason(transaction, nil)
assert revert_reason ==
@ -373,6 +376,8 @@ defmodule BlockScoutWeb.TransactionViewTest do
[
{"reason", "string", "UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT"}
]}
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, init_config)
end
end
end

@ -4324,6 +4324,9 @@ defmodule Explorer.ChainTest do
end
)
init_config = Application.get_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth)
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, tracer: "call_tracer", debug_trace_timeout: "5s")
assert Chain.transaction_to_revert_reason(transaction) == hex_reason
assert Transaction.decoded_revert_reason(transaction, hex_reason) == {
@ -4332,6 +4335,8 @@ defmodule Explorer.ChainTest do
"Error(string reason)",
[{"reason", "string", "No credit of that type"}]
}
Application.put_env(:ethereum_jsonrpc, EthereumJSONRPC.Geth, init_config)
end
end

Loading…
Cancel
Save