mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
common: enforce that msat fields are called "xxx_msat".
Now we've fixed them all, make sure no new ones slip in! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -402,6 +402,8 @@ void json_add_amount_msat_compat(struct json_stream *result,
|
||||
const char *msatfieldname)
|
||||
{
|
||||
json_add_u64(result, rawfieldname, msat.millisatoshis); /* Raw: low-level helper */
|
||||
if (!deprecated_apis)
|
||||
assert(strends(msatfieldname, "_msat"));
|
||||
json_add_amount_msat_only(result, msatfieldname, msat);
|
||||
}
|
||||
|
||||
@@ -409,6 +411,8 @@ void json_add_amount_msat_only(struct json_stream *result,
|
||||
const char *msatfieldname,
|
||||
struct amount_msat msat)
|
||||
{
|
||||
if (!deprecated_apis)
|
||||
assert(strends(msatfieldname, "_msat"));
|
||||
json_add_string(result, msatfieldname,
|
||||
type_to_string(tmpctx, struct amount_msat, &msat));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user