Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{:ok, nil} -> {:error, :not_found} in handle_get_block_by_tag
Fixes #490 Compatibility with openethereum/parity-ethereum#8281, which fixed openethereum/parity-ethereum#8028 and made pending return be compliant with Ethereum docs.
- Loading branch information
1 parent
cf3114c
commit eefaabb
Showing
3 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 EthereumJSONRPC.Case, only: [variant: 0] | ||
import Mox | ||
|
||
setup do | ||
%{ | ||
json_rpc_named_arguments: [ | ||
transport: EthereumJSONRPC.Mox, | ||
transport_options: [], | ||
variant: variant() | ||
] | ||
} | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters