mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-20 08:26:31 +00:00
[rpc] do not try to parse params if they were not provided (Refs #708)
This commit is contained in:
@ -534,9 +534,13 @@ func (wsc *wsConnection) readRoutine() {
|
|||||||
var args []reflect.Value
|
var args []reflect.Value
|
||||||
if rpcFunc.ws {
|
if rpcFunc.ws {
|
||||||
wsCtx := types.WSRPCContext{Request: request, WSRPCConnection: wsc}
|
wsCtx := types.WSRPCContext{Request: request, WSRPCConnection: wsc}
|
||||||
args, err = jsonParamsToArgsWS(rpcFunc, request.Params, wsCtx)
|
if request.Params != nil {
|
||||||
|
args, err = jsonParamsToArgsWS(rpcFunc, request.Params, wsCtx)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
args, err = jsonParamsToArgsRPC(rpcFunc, request.Params)
|
if request.Params != nil {
|
||||||
|
args, err = jsonParamsToArgsRPC(rpcFunc, request.Params)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wsc.WriteRPCResponse(types.RPCInternalError(request.ID, errors.Wrap(err, "Error converting json params to arguments")))
|
wsc.WriteRPCResponse(types.RPCInternalError(request.ID, errors.Wrap(err, "Error converting json params to arguments")))
|
||||||
|
Reference in New Issue
Block a user