diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-18 05:38:05 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-18 05:38:05 +0800 |
commit | 8fd243ee2303946dd520dd87513bbe0ec4184301 (patch) | |
tree | 1656f7c7f15e7228929d422d64416e12d376b9b1 /rpc/util.go | |
parent | fe819f3b9f7a2d8d842c53b7269ccceace533569 (diff) | |
download | dexon-8fd243ee2303946dd520dd87513bbe0ec4184301.tar.gz dexon-8fd243ee2303946dd520dd87513bbe0ec4184301.tar.zst dexon-8fd243ee2303946dd520dd87513bbe0ec4184301.zip |
Add JSON RPC batch support
http://www.jsonrpc.org/specification#batch
Diffstat (limited to 'rpc/util.go')
-rw-r--r-- | rpc/util.go | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/rpc/util.go b/rpc/util.go index e5610dc2c..6eb1faefb 100644 --- a/rpc/util.go +++ b/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" |