diff options
Diffstat (limited to 'rpc/util.go')
-rw-r--r-- | rpc/util.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/rpc/util.go b/rpc/util.go index b9b0fa442..d3c3420ae 100644 --- a/rpc/util.go +++ b/rpc/util.go @@ -124,17 +124,8 @@ func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error) return reqParsed, nil } -func toHex(b []byte) string { - hex := common.Bytes2Hex(b) - // Prefer output of "0x0" instead of "0x" - if len(hex) == 0 { - hex = "0" - } - return "0x" + hex -} - func i2hex(n int) string { - return toHex(big.NewInt(int64(n)).Bytes()) + return common.ToHex(big.NewInt(int64(n)).Bytes()) } type RpcServer interface { @@ -156,7 +147,7 @@ func toLogs(logs state.Logs) (ls []Log) { var l Log l.Topic = make([]string, len(log.Topics())) l.Address = log.Address().Hex() - l.Data = toHex(log.Data()) + l.Data = common.ToHex(log.Data()) l.Number = log.Number() for j, topic := range log.Topics() { l.Topic[j] = topic.Hex() |