diff options
Diffstat (limited to 'rpc/util.go')
-rw-r--r-- | rpc/util.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rpc/util.go b/rpc/util.go index fb4efdb45..8ff3c6d31 100644 --- a/rpc/util.go +++ b/rpc/util.go @@ -91,7 +91,7 @@ func UnmarshalRawMessages(b []byte, iface interface{}, number *int64) (err error func (self JsonWrapper) Send(writer io.Writer, v interface{}) (n int, err error) { var payload []byte - payload, err = json.Marshal(v) + payload, err = json.MarshalIndent(v, "", "\t") if err != nil { rpclogger.Fatalln("Error marshalling JSON", err) return 0, err @@ -127,11 +127,15 @@ func toHex(b []byte) string { } return "0x" + hex } + func fromHex(s string) []byte { if len(s) > 1 { if s[0:2] == "0x" { s = s[2:] } + if len(s)%2 == 1 { + s = "0" + s + } return ethutil.Hex2Bytes(s) } return nil |