diff --git a/lib/remote_chain/edge.ex b/lib/remote_chain/edge.ex index 1021fb6..c6a960c 100644 --- a/lib/remote_chain/edge.ex +++ b/lib/remote_chain/edge.ex @@ -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)