mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
common: remove json_tok.
Make local copies for tests, and fundchannel plugin (which just passes params through). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
a9b992ff4a
commit
f12f0d6929
@ -146,14 +146,6 @@ struct command_result *param_u64(struct command *cmd, const char *name,
|
||||
"should be an unsigned 64 bit integer");
|
||||
}
|
||||
|
||||
struct command_result *param_tok(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t * tok,
|
||||
const jsmntok_t **out)
|
||||
{
|
||||
*out = tok;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct command_result *param_msat(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t *tok,
|
||||
struct amount_msat **msat)
|
||||
|
@ -114,17 +114,6 @@ struct command_result *param_short_channel_id(struct command *cmd,
|
||||
const jsmntok_t *tok,
|
||||
struct short_channel_id **scid);
|
||||
|
||||
/*
|
||||
* Set the address of @out to @tok. Used as a callback by handlers that
|
||||
* want to unmarshal @tok themselves.
|
||||
*
|
||||
* Usage of this is discouraged. Writing a local static bespoke handler is
|
||||
* preferred.
|
||||
*/
|
||||
struct command_result *param_tok(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t * tok,
|
||||
const jsmntok_t **out);
|
||||
|
||||
/* Ignore the token. Not usually used. */
|
||||
struct command_result *param_ignore(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t *tok,
|
||||
|
@ -220,6 +220,14 @@ static void sanity(void)
|
||||
}
|
||||
}
|
||||
|
||||
static struct command_result *param_tok(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t * tok,
|
||||
const jsmntok_t **out)
|
||||
{
|
||||
*out = tok;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure toks are passed through correctly, and also make sure
|
||||
* optional missing toks are set to NULL.
|
||||
|
@ -28,6 +28,15 @@ fundchannel_get_result(struct command *cmd,
|
||||
const jsmntok_t *result,
|
||||
void *nothing UNUSED);
|
||||
|
||||
/* Generally a bad idea, but makes sense here. */
|
||||
static struct command_result *param_tok(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t * tok,
|
||||
const jsmntok_t **out)
|
||||
{
|
||||
*out = tok;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Thin wrapper aroud multifundchannel. */
|
||||
static struct command_result *
|
||||
json_fundchannel(struct command *cmd,
|
||||
|
Loading…
Reference in New Issue
Block a user