| 943 | AUTODATA(json_command, &signpsbt_command); |
| 944 | |
| 945 | static struct command_result *json_setpsbtversion(struct command *cmd, |
| 946 | const char *buffer, |
| 947 | const jsmntok_t *obj UNNEEDED, |
| 948 | const jsmntok_t *params) |
| 949 | { |
| 950 | struct json_stream *response; |
| 951 | unsigned int *version; |
| 952 | struct wally_psbt *psbt; |
| 953 | |
| 954 | if (!param_check(cmd, buffer, params, |
| 955 | p_req("psbt", param_psbt, &psbt), |
| 956 | p_req("version", param_number, &version), |
| 957 | NULL)) |
| 958 | return command_param_failed(); |
| 959 | |
| 960 | if (!psbt_set_version(psbt, *version)) { |
| 961 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 962 | "Could not set PSBT version"); |
| 963 | } |
| 964 | if (command_check_only(cmd)) |
| 965 | return command_check_done(cmd); |
| 966 | |
| 967 | response = json_stream_success(cmd); |
| 968 | json_add_psbt(response, "psbt", psbt); |
| 969 | |
| 970 | return command_success(cmd, response); |
| 971 | } |
| 972 | |
| 973 | static const struct json_command setpsbtversion_command = { |
| 974 | "setpsbtversion", |
nothing calls this directly
no test coverage detected