fix: reth compatibility (#10335)

* fix: ignore blockTimestamp field

* fix: transaction test
pull/10369/head
Kirill Fedoseev 5 months ago committed by GitHub
parent 8bbe2c97ec
commit f67801e9e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/log.ex
  2. 7
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
  3. 2
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs

@ -174,9 +174,8 @@ defmodule EthereumJSONRPC.Log do
end
end
# zkSync specific log fields
defp entry_to_elixir({key, _}) when key in ~w(l1BatchNumber logType) do
{nil, nil}
defp entry_to_elixir(_) do
{:ignore, :ignore}
end
defp put_topics(params, topics) when is_map(params) and is_list(topics) do

@ -673,13 +673,8 @@ defmodule EthereumJSONRPC.Transaction do
end
end
# ZkSync fields
defp entry_to_elixir({key, _}) when key in ~w(l1BatchNumber l1BatchTxIndex) do
{:ignore, :ignore}
end
defp entry_to_elixir(_) do
{nil, nil}
{:ignore, :ignore}
end
def put_if_present(result, transaction, keys) do

@ -9,7 +9,7 @@ defmodule EthereumJSONRPC.TransactionTest do
test "skips unsupported keys" do
map = %{"key" => "value", "key1" => "value1"}
assert %{nil: nil} = Transaction.to_elixir(map)
assert %{ignore: :ignore} = Transaction.to_elixir(map)
end
end
end

Loading…
Cancel
Save