fix net version test

pull/2186/head
Ayrat Badykov 6 years ago
parent 3e2f437d4e
commit 1a3f3c7815
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 10
      apps/ethereum_jsonrpc/test/ethereum_jsonrpc_test.exs

@ -888,13 +888,19 @@ defmodule EthereumJSONRPCTest do
describe "fetch_net_version/1" do
test "fetches net version", %{json_rpc_named_arguments: json_rpc_named_arguments} do
expected_version =
case Keyword.fetch!(json_rpc_named_arguments, :variant) do
EthereumJSONRPC.Parity -> 77
_variant -> 1
end
if json_rpc_named_arguments[:transport] == EthereumJSONRPC.Mox do
expect(EthereumJSONRPC.Mox, :json_rpc, fn _json, _options ->
{:ok, "1"}
{:ok, "#{expected_version}"}
end)
end
assert {:ok, 1} = EthereumJSONRPC.fetch_net_version(json_rpc_named_arguments)
assert {:ok, ^expected_version} = EthereumJSONRPC.fetch_net_version(json_rpc_named_arguments)
end
end

Loading…
Cancel
Save