Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/apps/ethereum_jsonrpc/test/ethereum_jsonrpc/mox_test.exs

31 lines
786 B

defmodule EthereumJSONRPC.MoxTest do
@moduledoc """
Tests that only work with `EthereumJSONRPC.Mox` because they need precise data back from the network that can't be
gotten reliably.
"""
use ExUnit.Case, async: true
import Mox
setup do
%{
json_rpc_named_arguments: [
transport: EthereumJSONRPC.Mox,
transport_options: []
]
}
end
setup :verify_on_exit!
describe "fetch_block_number_by_tag/2" do
test "with pending with null result", %{json_rpc_named_arguments: json_rpc_named_arguments} do
expect(EthereumJSONRPC.Mox, :json_rpc, fn _json, _options ->
{:ok, nil}
end)
assert {:error, :not_found} = EthereumJSONRPC.fetch_block_number_by_tag("pending", json_rpc_named_arguments)
end
end
end