Why: * We were using the `EthereumJSONRPC.Geth` variant for Ganache but we recently learned that it doesn't support the `tracer` option for [debug_traceTransaction](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#debug_tracetransaction). This `tracer` option is what we currently use to fetch internal transactions for Geth. This was the cause of errors as shown on issue 1152 (link below). * Issue link: https://github.com/poanetwork/blockscout/issues/1152 This change addresses the need by: * Creating `EthereumJSONRPC.Ganache`. It ignores fetching beneficiaries, internal transactions, and pending transactions. * Editing ganache config to use the `EthereumJSONRPC.Ganache` variant instead of `EthereumJSONRPC.Geth`. * Updating inaccurate doc in `EthereumJSONRPC.Geth`. It previously said fetching internal transactions was not supported for Geth which is inaccurate.pull/1160/head
parent
3c0c96d738
commit
1bdb8c1166
@ -0,0 +1,31 @@ |
||||
defmodule EthereumJSONRPC.Ganache do |
||||
@moduledoc """ |
||||
Ethereum JSONRPC methods that are only supported by [Ganache](https://github.com/trufflesuite/ganache-core#implemented-methods). |
||||
""" |
||||
|
||||
@behaviour EthereumJSONRPC.Variant |
||||
|
||||
@doc """ |
||||
Block reward contract beneficiary fetching is not supported currently for Ganache. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_beneficiaries(_block_range, _json_rpc_named_arguments), do: :ignore |
||||
|
||||
@doc """ |
||||
Internal transaction fetching is not currently supported for Ganache. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_internal_transactions(_transactions_params, _json_rpc_named_arguments), do: :ignore |
||||
|
||||
@doc """ |
||||
Pending transaction fetching is not supported currently for Ganache. |
||||
|
||||
To signal to the caller that fetching is not supported, `:ignore` is returned. |
||||
""" |
||||
@impl EthereumJSONRPC.Variant |
||||
def fetch_pending_transactions(_json_rpc_named_arguments), do: :ignore |
||||
end |
Loading…
Reference in new issue