diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex index b66cc2ebf6..e10a7678e6 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex @@ -282,6 +282,11 @@ defmodule EthereumJSONRPC.Receipt do end end + # fixes for latest ganache JSON RPC + defp entry_to_elixir({key, quantity}) when key in ~w(r s v) do + :ignore + end + defp entry_to_elixir({key, value}) do {:error, {:unknown_key, %{key: key, value: value}}} end diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex index ea56d889fc..4f3ced8ff0 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex @@ -311,6 +311,11 @@ defmodule EthereumJSONRPC.Transaction do {key, quantity_to_integer(quantity)} end + # as always ganache has it's own vision on JSON RPC standard + defp entry_to_elixir({key, quantity}) when key in ~w(r s v) and quantity == nil do + {key, 0} + end + # quantity or nil for pending defp entry_to_elixir({key, quantity_or_nil}) when key in ~w(blockNumber transactionIndex) do elixir =