mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 23:14:37 +00:00
RawMessage fix
This commit is contained in:
+6
-2
@@ -49,11 +49,15 @@ type RPCResponse struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewRPCResponse(id string, res interface{}, err string) RPCResponse {
|
func NewRPCResponse(id string, res interface{}, err string) RPCResponse {
|
||||||
raw := json.RawMessage(wire.JSONBytes(res))
|
var raw *json.RawMessage
|
||||||
|
if res != nil {
|
||||||
|
rawMsg := json.RawMessage(wire.JSONBytes(res))
|
||||||
|
raw = &rawMsg
|
||||||
|
}
|
||||||
return RPCResponse{
|
return RPCResponse{
|
||||||
JSONRPC: "2.0",
|
JSONRPC: "2.0",
|
||||||
ID: id,
|
ID: id,
|
||||||
Result: &raw,
|
Result: raw,
|
||||||
Error: err,
|
Error: err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user