| 907 | AUTODATA(json_command, &signpsbt_command); |
| 908 | |
| 909 | static struct command_result *json_setpsbtversion(struct command *cmd, |
| 910 | const char *buffer, |
| 911 | const jsmntok_t *obj UNNEEDED, |
| 912 | const jsmntok_t *params) |
| 913 | { |
| 914 | struct json_stream *response; |
| 915 | unsigned int *version; |
| 916 | struct wally_psbt *psbt; |
| 917 | |
| 918 | if (!param_check(cmd, buffer, params, |
| 919 | p_req("psbt", param_psbt, &psbt), |
| 920 | p_req("version", param_number, &version), |
| 921 | NULL)) |
| 922 | return command_param_failed(); |
| 923 | |
| 924 | if (!psbt_set_version(psbt, *version)) { |
| 925 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 926 | "Could not set PSBT version"); |
| 927 | } |
| 928 | if (command_check_only(cmd)) |
| 929 | return command_check_done(cmd); |
| 930 | |
| 931 | response = json_stream_success(cmd); |
| 932 | json_add_psbt(response, "psbt", psbt); |
| 933 | |
| 934 | return command_success(cmd, response); |
| 935 | } |
| 936 | |
| 937 | static const struct json_command setpsbtversion_command = { |
| 938 | "setpsbtversion", |
nothing calls this directly
no test coverage detected