| 535 | } |
| 536 | |
| 537 | struct command_result *command_success(struct command *cmd, |
| 538 | struct json_stream *result) |
| 539 | { |
| 540 | assert(cmd); |
| 541 | assert(cmd->json_stream == result); |
| 542 | |
| 543 | /* Filter will get upset if we close "result" object it didn't |
| 544 | * see! */ |
| 545 | if (cmd->filter) { |
| 546 | const char *err = json_stream_detach_filter(tmpctx, result); |
| 547 | if (err) |
| 548 | json_add_string(result, "warning_parameter_filter", |
| 549 | err); |
| 550 | } |
| 551 | |
| 552 | json_object_end(result); |
| 553 | json_object_end(result); |
| 554 | |
| 555 | return command_raw_complete(cmd, result); |
| 556 | } |
| 557 | |
| 558 | struct command_result *command_failed(struct command *cmd, |
| 559 | struct json_stream *result) |
no test coverage detected