diff --git a/common/json_tok.c b/common/json_tok.c index a91eb63ed..29a75884e 100644 --- a/common/json_tok.c +++ b/common/json_tok.c @@ -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) diff --git a/common/json_tok.h b/common/json_tok.h index 2b6f9e724..40bd32060 100644 --- a/common/json_tok.h +++ b/common/json_tok.h @@ -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, diff --git a/common/test/run-param.c b/common/test/run-param.c index 6577f5b29..c3611cfb5 100644 --- a/common/test/run-param.c +++ b/common/test/run-param.c @@ -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. diff --git a/plugins/spender/fundchannel.c b/plugins/spender/fundchannel.c index 1feb639af..5b235f911 100644 --- a/plugins/spender/fundchannel.c +++ b/plugins/spender/fundchannel.c @@ -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,