|
|
@ -27,15 +27,7 @@ defmodule EthereumJSONRPC.Geth do |
|
|
|
def fetch_internal_transactions(transactions_params, json_rpc_named_arguments) when is_list(transactions_params) do |
|
|
|
def fetch_internal_transactions(transactions_params, json_rpc_named_arguments) when is_list(transactions_params) do |
|
|
|
id_to_params = id_to_params(transactions_params) |
|
|
|
id_to_params = id_to_params(transactions_params) |
|
|
|
|
|
|
|
|
|
|
|
debug_trace_transaction_timeout = |
|
|
|
json_rpc_named_arguments_corrected_timeout = correct_timeouts(json_rpc_named_arguments) |
|
|
|
Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parsed_timeout = CommonHelper.parse_duration(debug_trace_transaction_timeout) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
json_rpc_named_arguments_corrected_timeout = |
|
|
|
|
|
|
|
json_rpc_named_arguments |
|
|
|
|
|
|
|
|> put_in([:transport_options, :http_options, :timeout], parsed_timeout) |
|
|
|
|
|
|
|
|> put_in([:transport_options, :http_options, :recv_timeout], parsed_timeout) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with {:ok, responses} <- |
|
|
|
with {:ok, responses} <- |
|
|
|
id_to_params |
|
|
|
id_to_params |
|
|
@ -49,6 +41,21 @@ defmodule EthereumJSONRPC.Geth do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp correct_timeouts(json_rpc_named_arguments) do |
|
|
|
|
|
|
|
debug_trace_transaction_timeout = |
|
|
|
|
|
|
|
Application.get_env(:ethereum_jsonrpc, __MODULE__)[:debug_trace_transaction_timeout] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case CommonHelper.parse_duration(debug_trace_transaction_timeout) do |
|
|
|
|
|
|
|
{:error, :invalid_format} -> |
|
|
|
|
|
|
|
json_rpc_named_arguments |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parsed_timeout -> |
|
|
|
|
|
|
|
json_rpc_named_arguments |
|
|
|
|
|
|
|
|> put_in([:transport_options, :http_options, :timeout], parsed_timeout) |
|
|
|
|
|
|
|
|> put_in([:transport_options, :http_options, :recv_timeout], parsed_timeout) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
@doc """ |
|
|
|
Fetches the first trace from the trace URL. |
|
|
|
Fetches the first trace from the trace URL. |
|
|
|
""" |
|
|
|
""" |
|
|
|