| 1471 | } |
| 1472 | |
| 1473 | static struct command_result *json_askrene_listlayers(struct command *cmd, |
| 1474 | const char *buffer, |
| 1475 | const jsmntok_t *params) |
| 1476 | { |
| 1477 | struct askrene *askrene = get_askrene(cmd->plugin); |
| 1478 | struct layer *layer; |
| 1479 | struct json_stream *response; |
| 1480 | |
| 1481 | if (!param(cmd, buffer, params, |
| 1482 | p_opt("layer", param_known_layer, &layer), |
| 1483 | NULL)) |
| 1484 | return command_param_failed(); |
| 1485 | plugin_log(cmd->plugin, LOG_TRACE, "%s called: %.*s", __func__, |
| 1486 | json_tok_full_len(params), json_tok_full(buffer, params)); |
| 1487 | |
| 1488 | response = jsonrpc_stream_success(cmd); |
| 1489 | json_add_layers(response, askrene, "layers", layer); |
| 1490 | return command_finished(cmd, response); |
| 1491 | } |
| 1492 | |
| 1493 | static struct command_result *json_askrene_age(struct command *cmd, |
| 1494 | const char *buffer, |
nothing calls this directly
no test coverage detected