Skip to content

Commit

Permalink
fix issue retrieving genesis block
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Apr 9, 2024
1 parent d686d94 commit e5dcac1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/remote_chain/edge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,14 @@ defmodule RemoteChain.Edge do
end

defp hex_blockref(ref) when ref in ["latest", "earliest"], do: ref
defp hex_blockref(ref), do: Base16.encode(ref)

defp hex_blockref(ref) do
case Base16.encode(ref) do
"0x" -> "0x0"
"0x0" <> rest -> "0x" <> rest
other -> other
end
end

defp hex_address(<<_::binary-size(20)>> = address) do
Base16.encode(address)
Expand Down

0 comments on commit e5dcac1

Please sign in to comment.