aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/util.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-19 01:23:37 +0800
committerobscuren <geffobscura@gmail.com>2015-03-19 01:23:37 +0800
commitf9a6038f5b82cad6956c9cbb7f1220d97570632b (patch)
tree78fb61bed1924b60c3c4d59e5a5a471f55f91de7 /rpc/util.go
parent4d0ae8b0cb32e9de63092bc36022ea4af76cad8b (diff)
parentbaca0c2251a2587c136999a91449d9b6f7a6c60f (diff)
downloadgo-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.gz
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.bz2
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.lz
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.xz
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.zst
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.zip
merge
Diffstat (limited to 'rpc/util.go')
-rw-r--r--rpc/util.go13
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()