diff --git a/lib/tt_eth/behaviours/chain_client.ex b/lib/tt_eth/behaviours/chain_client.ex index 76422cc..1f92619 100644 --- a/lib/tt_eth/behaviours/chain_client.ex +++ b/lib/tt_eth/behaviours/chain_client.ex @@ -29,6 +29,9 @@ defmodule TTEth.Behaviours.ChainClient do @callback eth_get_transaction_count(account :: address, block_id) :: any @callback eth_get_transaction_count(account :: address, block_id, opts) :: any + @callback eth_get_logs(filter_params) :: any + @callback eth_get_logs(filter_params, opts) :: any + @callback eth_new_filter(filter_params) :: any @callback eth_new_filter(filter_params, opts) :: any diff --git a/lib/tt_eth/chain_client.ex b/lib/tt_eth/chain_client.ex index 728f4cf..2215863 100644 --- a/lib/tt_eth/chain_client.ex +++ b/lib/tt_eth/chain_client.ex @@ -37,6 +37,10 @@ defmodule TTEth.ChainClient do def eth_get_transaction_count(address, block \\ "latest", opts \\ []), do: address |> HttpClient.eth_get_transaction_count(block, opts) + @impl ChainClient + def eth_get_logs(params, opts \\ []), + do: params |> HttpClient.eth_get_logs(opts) + @impl ChainClient def eth_new_filter(params, opts \\ []), do: params |> HttpClient.eth_new_filter(opts) diff --git a/lib/tt_eth/chain_client_mock_impl.ex b/lib/tt_eth/chain_client_mock_impl.ex index 188a320..822b720 100644 --- a/lib/tt_eth/chain_client_mock_impl.ex +++ b/lib/tt_eth/chain_client_mock_impl.ex @@ -22,6 +22,10 @@ defmodule TTEth.ChainClientMockImpl do def eth_get_transaction_count(_address, _block \\ "latest", _opts \\ []), do: {:ok, "0x42"} + @impl ChainClient + def eth_get_logs(_params, _opts \\ []), + do: :error + @impl ChainClient def eth_new_filter(_params, _opts \\ []), do: :error