json.RawMessage in RPCRequest to defer parsing

This commit is contained in:
Ethan Frey
2017-05-03 16:13:58 +02:00
parent 6dbcfb32d2
commit 6ba799132c
5 changed files with 58 additions and 41 deletions

View File

@@ -67,11 +67,9 @@ func NewJSONRPCClient(remote string) *JSONRPCClient {
}
func (c *JSONRPCClient) Call(method string, params map[string]interface{}, result interface{}) (interface{}, error) {
request := types.RPCRequest{
JSONRPC: "2.0",
Method: method,
Params: params,
ID: "",
request, err := types.MapToRequest("", method, params)
if err != nil {
return nil, err
}
requestBytes, err := json.Marshal(request)
if err != nil {