Merge pull request #1321 from konstantinzolotarev/ganache_fixes

Fixes for ganache JSON RPC mistakes
pull/1333/head
Andrew Cravenho 6 years ago committed by GitHub
commit aca3601988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/receipt.ex
  2. 5
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
  3. 2
      docker/README.md

@ -282,6 +282,11 @@ defmodule EthereumJSONRPC.Receipt do
end
end
# fixes for latest ganache JSON RPC
defp entry_to_elixir({key, _}) 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

@ -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, nil}) when key in ~w(r s v) 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 =

@ -15,7 +15,7 @@ Exmaple connecting to local `ganache` instance running on port `2000` on Mac/Win
COIN=DAI \
ETHEREUM_JSONRPC_VARIANT=ganache \
ETHEREUM_JSONRPC_HTTP_URL=http://host.docker.internal:2000 \
ETHEREUM_JSONRPC_WEB_SOCKET_URL=ws://host.docker.internal:2000 \
ETHEREUM_JSONRPC_WS_URL=ws://host.docker.internal:2000 \
make start
```

Loading…
Cancel
Save