Commit 15765517 authored by Taylor Gerring's avatar Taylor Gerring

Output 0x0 instead of 0x

parent 9b0f00ba
...@@ -63,7 +63,12 @@ func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error) ...@@ -63,7 +63,12 @@ func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error)
} }
func toHex(b []byte) string { func toHex(b []byte) string {
return "0x" + ethutil.Bytes2Hex(b) hex := ethutil.Bytes2Hex(b)
// Prefer output of "0x0" instead of "0x"
if len(hex) == 0 {
hex = "0"
}
return "0x" + hex
} }
func fromHex(s string) []byte { func fromHex(s string) []byte {
if len(s) > 1 { if len(s) > 1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment