aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/util.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-11 08:10:02 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-11 08:10:02 +0800
commit499f816e3034c3e781f8ad35da070c9989cf6e3c (patch)
tree48deb90b7f363a7744aa4f076b2960b8f836c0ef /rpc/util.go
parentfda4d02f946dcef8b6896c8798c318876de0138d (diff)
downloadgo-tangerine-499f816e3034c3e781f8ad35da070c9989cf6e3c.tar.gz
go-tangerine-499f816e3034c3e781f8ad35da070c9989cf6e3c.tar.zst
go-tangerine-499f816e3034c3e781f8ad35da070c9989cf6e3c.zip
Output hex should be prepended with 0x
Diffstat (limited to 'rpc/util.go')
-rw-r--r--rpc/util.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpc/util.go b/rpc/util.go
index a0d858a67..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,6 +127,7 @@ func toHex(b []byte) string {
}
return "0x" + hex
}
+
func fromHex(s string) []byte {
if len(s) > 1 {
if s[0:2] == "0x" {