json: rename json_add_amount_sat to json_add_amount_sat_compat.

New fields don't have to be spelled out twice.

The raw version are called _only, so we don't miss a call
accidentally.  We can rename them when we finally deprecated old
fields.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-05-20 14:37:40 +09:30
committed by neil saitug
parent f3d30f1267
commit 401bd9f8ef
11 changed files with 156 additions and 126 deletions

View File

@@ -143,17 +143,29 @@ void json_add_hex_talarr(struct json_stream *result,
const tal_t *data);
/* Adds both a 'raw' number field and an 'amount_msat' field */
void json_add_amount_msat(struct json_stream *result,
struct amount_msat msat,
const char *rawfieldname,
const char *msatfieldname)
void json_add_amount_msat_compat(struct json_stream *result,
struct amount_msat msat,
const char *rawfieldname,
const char *msatfieldname)
NO_NULL_ARGS;
/* Adds both a 'raw' number field and an 'amount_msat' field */
void json_add_amount_sat(struct json_stream *result,
struct amount_sat sat,
const char *rawfieldname,
const char *msatfieldname)
void json_add_amount_sat_compat(struct json_stream *result,
struct amount_sat sat,
const char *rawfieldname,
const char *msatfieldname)
NO_NULL_ARGS;
/* Adds an 'msat' field */
void json_add_amount_msat_only(struct json_stream *result,
const char *msatfieldname,
struct amount_msat msat)
NO_NULL_ARGS;
/* Adds an 'msat' field */
void json_add_amount_sat_only(struct json_stream *result,
const char *msatfieldname,
struct amount_sat sat)
NO_NULL_ARGS;
enum address_parse_result {