diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-19 01:23:37 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-19 01:23:37 +0800 |
commit | f9a6038f5b82cad6956c9cbb7f1220d97570632b (patch) | |
tree | 78fb61bed1924b60c3c4d59e5a5a471f55f91de7 /rpc/util.go | |
parent | 4d0ae8b0cb32e9de63092bc36022ea4af76cad8b (diff) | |
parent | baca0c2251a2587c136999a91449d9b6f7a6c60f (diff) | |
download | go-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.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() |