aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/util.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-18 20:46:55 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-18 20:46:55 +0800
commite30c32339132d678b428ae531932a3f048665f59 (patch)
treeec68d48217e26aeff8dd96b1d5f8a6abfef95ff7 /rpc/util.go
parent67c9d9c2fa6d1cb74188dccf7e25422db72983c8 (diff)
parent3ea99f989ff98432cbfa864d2e7e26628e16cc6f (diff)
downloaddexon-e30c32339132d678b428ae531932a3f048665f59.tar.gz
dexon-e30c32339132d678b428ae531932a3f048665f59.tar.zst
dexon-e30c32339132d678b428ae531932a3f048665f59.zip
merge develop
Diffstat (limited to 'rpc/util.go')
-rw-r--r--rpc/util.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/rpc/util.go b/rpc/util.go
index 413ec4887..3209c4540 100644
--- a/rpc/util.go
+++ b/rpc/util.go
@@ -90,17 +90,8 @@ func UnmarshalRawMessages(b []byte, iface interface{}, number *int64) (err error
return 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 {
@@ -121,11 +112,11 @@ func toLogs(logs state.Logs) (ls []Log) {
for i, log := range logs {
var l Log
l.Topic = make([]string, len(log.Topics()))
- l.Address = toHex(log.Address())
- l.Data = toHex(log.Data())
+ l.Address = common.ToHex(log.Address())
+ l.Data = common.ToHex(log.Data())
l.Number = log.Number()
for j, topic := range log.Topics() {
- l.Topic[j] = toHex(topic)
+ l.Topic[j] = common.ToHex(topic)
}
ls[i] = l
}