merge
This commit is contained in:
13
rpc/util.go
13
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()
|
||||
|
Reference in New Issue
Block a user