20
rpc/util.go
20
rpc/util.go
@ -21,7 +21,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
"net/http"
|
||||
// "net/http"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
@ -106,24 +106,6 @@ func (self JsonWrapper) Send(writer io.Writer, v interface{}) (n int, err error)
|
||||
return writer.Write(payload)
|
||||
}
|
||||
|
||||
func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error) {
|
||||
var reqParsed RpcRequest
|
||||
|
||||
// Convert JSON to native types
|
||||
d := json.NewDecoder(req.Body)
|
||||
defer req.Body.Close()
|
||||
err := d.Decode(&reqParsed)
|
||||
|
||||
if err != nil {
|
||||
rpclogger.Errorln("Error decoding JSON: ", err)
|
||||
return reqParsed, err
|
||||
}
|
||||
|
||||
rpclogger.DebugDetailf("Parsed request: %s", reqParsed)
|
||||
|
||||
return reqParsed, nil
|
||||
}
|
||||
|
||||
func toHex(b []byte) string {
|
||||
hex := common.Bytes2Hex(b)
|
||||
// Prefer output of "0x0" instead of "0x"
|
||||
|
Reference in New Issue
Block a user