fix: missing onlyTopCall option on some geth networks (#10309)

pull/10319/head
Kirill Fedoseev 5 months ago committed by GitHub
parent 5789382e0d
commit 7c08ba0044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth.ex

@ -69,15 +69,20 @@ defmodule EthereumJSONRPC.Geth do
id_to_params
|> debug_trace_transaction_requests(true)
|> json_rpc(json_rpc_named_arguments_corrected_timeout),
{:ok, [first_trace]} <-
{:ok, traces} <-
debug_trace_transaction_responses_to_internal_transactions_params(
responses,
id_to_params,
json_rpc_named_arguments_corrected_timeout
) do
%{block_hash: block_hash} = transactions_params |> Enum.at(0)
case {traces, transactions_params} do
{[%{} = first_trace | _], [%{block_hash: block_hash} | _]} ->
{:ok,
[%{first_trace: first_trace, block_hash: block_hash, json_rpc_named_arguments: json_rpc_named_arguments}]}
{:ok, [%{first_trace: first_trace, block_hash: block_hash, json_rpc_named_arguments: json_rpc_named_arguments}]}
_ ->
{:error, :not_found}
end
end
end

Loading…
Cancel
Save