|
|
@ -7,8 +7,6 @@ defmodule EthereumJSONRPC.HTTP do |
|
|
|
|
|
|
|
|
|
|
|
require Logger |
|
|
|
require Logger |
|
|
|
|
|
|
|
|
|
|
|
import EthereumJSONRPC, only: [quantity_to_integer: 1] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@behaviour Transport |
|
|
|
@behaviour Transport |
|
|
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
@doc """ |
|
|
@ -134,12 +132,7 @@ defmodule EthereumJSONRPC.HTTP do |
|
|
|
# validated, so we can indicate that with switch to atom keys. |
|
|
|
# validated, so we can indicate that with switch to atom keys. |
|
|
|
defp standardize_response(%{"jsonrpc" => "2.0" = jsonrpc, "id" => id} = unstandardized) do |
|
|
|
defp standardize_response(%{"jsonrpc" => "2.0" = jsonrpc, "id" => id} = unstandardized) do |
|
|
|
# Nethermind return string ids |
|
|
|
# Nethermind return string ids |
|
|
|
id = |
|
|
|
id = quantity_to_integer(id) |
|
|
|
if is_binary(id) do |
|
|
|
|
|
|
|
quantity_to_integer(id) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
id |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
standardized = %{jsonrpc: jsonrpc, id: id} |
|
|
|
standardized = %{jsonrpc: jsonrpc, id: id} |
|
|
|
|
|
|
|
|
|
|
|