| 86 | } |
| 87 | |
| 88 | static struct command_result *param_newaddr(struct command *cmd, |
| 89 | const char *name, |
| 90 | const char *buffer, |
| 91 | const jsmntok_t *tok, |
| 92 | enum addrtype **addrtype) |
| 93 | { |
| 94 | *addrtype = tal(cmd, enum addrtype); |
| 95 | if (json_tok_streq(buffer, tok, "bech32")) |
| 96 | **addrtype = ADDR_BECH32; |
| 97 | else if (!chainparams->is_elements && json_tok_streq(buffer, tok, "p2tr")) |
| 98 | **addrtype = ADDR_P2TR; |
| 99 | else if (json_tok_streq(buffer, tok, "all")) |
| 100 | **addrtype = ADDR_ALL; |
| 101 | else |
| 102 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 103 | "'%s' should be 'p2tr', 'bech32', or 'all', not '%.*s'", |
| 104 | name, tok->end - tok->start, buffer + tok->start); |
| 105 | return NULL; |
| 106 | } |
| 107 | |
| 108 | bool WARN_UNUSED_RESULT newaddr_inner(struct command *cmd, struct pubkey *pubkey, enum addrtype addrtype) |
| 109 | { |
nothing calls this directly
no test coverage detected