mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
json: Rename json_tok_address_scriptpubkey
to json_to_address_scriptpubkey
Our json naming style is like `json_to_***`.
This commit is contained in:
parent
c6a4bac8b6
commit
7db3f1b8a6
@ -300,10 +300,10 @@ static struct command_result *parse_fallback(struct command *cmd,
|
||||
enum address_parse_result fallback_parse;
|
||||
|
||||
fallback_parse
|
||||
= json_tok_address_scriptpubkey(cmd,
|
||||
get_chainparams(cmd->ld),
|
||||
buffer, fallback,
|
||||
fallback_script);
|
||||
= json_to_address_scriptpubkey(cmd,
|
||||
get_chainparams(cmd->ld),
|
||||
buffer, fallback,
|
||||
fallback_script);
|
||||
if (fallback_parse == ADDRESS_PARSE_UNRECOGNIZED) {
|
||||
return command_fail(cmd, LIGHTNINGD,
|
||||
"Fallback address not valid");
|
||||
|
@ -196,7 +196,7 @@ enum address_parse_result {
|
||||
/* Return result of address parsing and fills in *scriptpubkey
|
||||
* allocated off ctx if ADDRESS_PARSE_SUCCESS
|
||||
*/
|
||||
enum address_parse_result json_tok_address_scriptpubkey(const tal_t *ctx,
|
||||
enum address_parse_result json_to_address_scriptpubkey(const tal_t *ctx,
|
||||
const struct chainparams *chainparams,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok, const u8 **scriptpubkey);
|
||||
|
@ -999,10 +999,10 @@ static const char *segwit_addr_net_decode(int *witness_version,
|
||||
}
|
||||
|
||||
enum address_parse_result
|
||||
json_tok_address_scriptpubkey(const tal_t *ctx,
|
||||
const struct chainparams *chainparams,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok, const u8 **scriptpubkey)
|
||||
json_to_address_scriptpubkey(const tal_t *ctx,
|
||||
const struct chainparams *chainparams,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok, const u8 **scriptpubkey)
|
||||
{
|
||||
struct bitcoin_address destination;
|
||||
int witness_version;
|
||||
|
@ -233,12 +233,12 @@ struct json_stream *json_stream_fail(struct command *cmd UNNEEDED,
|
||||
/* Generated stub for json_stream_success */
|
||||
struct json_stream *json_stream_success(struct command *cmd UNNEEDED)
|
||||
{ fprintf(stderr, "json_stream_success called!\n"); abort(); }
|
||||
/* Generated stub for json_tok_address_scriptpubkey */
|
||||
enum address_parse_result json_tok_address_scriptpubkey(const tal_t *ctx UNNEEDED,
|
||||
/* Generated stub for json_to_address_scriptpubkey */
|
||||
enum address_parse_result json_to_address_scriptpubkey(const tal_t *ctx UNNEEDED,
|
||||
const struct chainparams *chainparams UNNEEDED,
|
||||
const char *buffer UNNEEDED,
|
||||
const jsmntok_t *tok UNNEEDED, const u8 **scriptpubkey UNNEEDED)
|
||||
{ fprintf(stderr, "json_tok_address_scriptpubkey called!\n"); abort(); }
|
||||
{ fprintf(stderr, "json_to_address_scriptpubkey called!\n"); abort(); }
|
||||
/* Generated stub for json_tok_channel_id */
|
||||
bool json_tok_channel_id(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
||||
struct channel_id *cid UNNEEDED)
|
||||
|
@ -80,10 +80,10 @@ static struct command_result *param_bitcoin_address(struct command *cmd,
|
||||
const u8 **scriptpubkey)
|
||||
{
|
||||
/* Parse address. */
|
||||
switch (json_tok_address_scriptpubkey(cmd,
|
||||
get_chainparams(cmd->ld),
|
||||
buffer, tok,
|
||||
scriptpubkey)) {
|
||||
switch (json_to_address_scriptpubkey(cmd,
|
||||
get_chainparams(cmd->ld),
|
||||
buffer, tok,
|
||||
scriptpubkey)) {
|
||||
case ADDRESS_PARSE_UNRECOGNIZED:
|
||||
return command_fail(cmd, LIGHTNINGD,
|
||||
"Could not parse destination address, "
|
||||
@ -345,10 +345,10 @@ static struct command_result *json_prepare_tx(struct command *cmd,
|
||||
"The output format must be "
|
||||
"{destination: amount}");
|
||||
|
||||
res = json_tok_address_scriptpubkey(cmd,
|
||||
get_chainparams(cmd->ld),
|
||||
buffer, &t[1],
|
||||
&destination);
|
||||
res = json_to_address_scriptpubkey(cmd,
|
||||
get_chainparams(cmd->ld),
|
||||
buffer, &t[1],
|
||||
&destination);
|
||||
if (res == ADDRESS_PARSE_UNRECOGNIZED)
|
||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||
"Could not parse destination address");
|
||||
|
Loading…
Reference in New Issue
Block a user