Skip to content

Commit

Permalink
Fix dio_edgev2 return
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Sep 10, 2024
1 parent da1e53c commit 7a15b31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Json do
end

defp conv_validate(conv) do
Keyword.merge([all_hex: false], conv)
conv
end

def decode!(binary) do
Expand Down Expand Up @@ -61,8 +61,8 @@ defmodule Json do
"0x"
end

defp do_encode(bin, conv) when is_binary(bin) do
if conv[:all_hex] == false and String.printable?(bin) do
defp do_encode(bin, _conv) when is_binary(bin) do
if String.printable?(bin) do
bin
else
Base16.encode(bin, false)
Expand Down
2 changes: 1 addition & 1 deletion lib/network/rpc.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ defmodule Network.Rpc do
envelope =
%{"id" => {:raw, id}, "jsonrpc" => "2.0"}
|> Map.merge(ret)
|> Json.prepare!(all_hex: method == "dio_edgev2")
|> Json.prepare!()

{code, envelope}
end
Expand Down
2 changes: 1 addition & 1 deletion test/rpc_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ defmodule RpcTest do
"id" => 1,
"jsonrpc" => "2.0",
"result" => %{
"blockNumber" => blockNum,
"blockNumber" => _blockNum,
"contractAddress" => nil,
"cumulativeGasUsed" => _variable,
"from" => ^from,
Expand Down

0 comments on commit 7a15b31

Please sign in to comment.