json_tok_len, json_tok_contents: rename to json_tok_full_len and json_tok_full

These are only supposed to be used when you want the token contents including
surrounding "".  We should use this when reporting errors, but usually
we just want to access the tok members directly.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-12-16 15:18:06 +10:30
parent 465d5d5649
commit 12731c4a60
12 changed files with 32 additions and 32 deletions

View File

@@ -114,7 +114,7 @@ bool json_tok_pubkey(struct command *cmd, const char *name,
command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"'%s' should be a pubkey, not '%.*s'",
name, tok->end - tok->start, buffer + tok->start);
name, json_tok_full_len(tok), json_tok_full(buffer, tok));
return false;
}
@@ -143,7 +143,7 @@ bool json_tok_short_channel_id(struct command *cmd, const char *name,
command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"'%s' should be a short channel id, not '%.*s'",
name, tok->end - tok->start, buffer + tok->start);
name, json_tok_full_len(tok), json_tok_full(buffer, tok));
return false;
}
@@ -178,7 +178,7 @@ bool json_tok_feerate_style(struct command *cmd, const char *name,
name,
json_feerate_style_name(FEERATE_PER_KSIPA),
json_feerate_style_name(FEERATE_PER_KBYTE),
tok->end - tok->start, buffer + tok->start);
json_tok_full_len(tok), json_tok_full(buffer, tok));
return false;
}