global: change all type_to_string to fmt_X.

This has the benefit of being shorter, as well as more reliable (you
will get a link error if we can't print it, not a runtime one!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2024-03-20 11:17:52 +10:30
parent d8c06dccac
commit 37d22f9141
108 changed files with 1526 additions and 2123 deletions

View File

@@ -339,8 +339,8 @@ static void add_amount_sent(struct plugin *p,
plugin_log(p, LOG_BROKEN,
"Cannot add amount_sent_msat for %s: %s + %s",
invstring,
type_to_string(tmpctx, struct amount_msat, &mpp->amount_sent),
type_to_string(tmpctx, struct amount_msat, &sent));
fmt_amount_msat(tmpctx, mpp->amount_sent),
fmt_amount_msat(tmpctx, sent));
msattok = json_get_member(buf, t, "amount_msat");
@@ -366,8 +366,8 @@ static void add_amount_sent(struct plugin *p,
plugin_log(p, LOG_BROKEN,
"Cannot add amount_msat for %s: %s + %s",
invstring,
type_to_string(tmpctx, struct amount_msat, mpp->amount),
type_to_string(tmpctx, struct amount_msat, &sent));
fmt_amount_msat(tmpctx, *mpp->amount),
fmt_amount_msat(tmpctx, sent));
}
static void add_new_entry(struct json_stream *ret,