| 590 | } |
| 591 | |
| 592 | struct command_result *WARN_UNUSED_RESULT |
| 593 | command_success(struct command *cmd, const struct json_out *result) |
| 594 | { |
| 595 | struct json_stream *js = jsonrpc_stream_start(cmd); |
| 596 | assert(cmd->type == COMMAND_TYPE_NORMAL |
| 597 | || cmd->type == COMMAND_TYPE_HOOK); |
| 598 | |
| 599 | json_out_add_splice(js->jout, "result", result); |
| 600 | return command_complete(cmd, js); |
| 601 | } |
| 602 | |
| 603 | struct command_result *command_done_err(struct command *cmd, |
| 604 | enum jsonrpc_errcode code, |