| 748 | } |
| 749 | |
| 750 | static const char *check_bolt11_condition(const tal_t *ctx, |
| 751 | const struct rune_altern *alt, |
| 752 | const struct bolt11 *b11, |
| 753 | enum invoice_field invf) |
| 754 | { |
| 755 | |
| 756 | switch (invf) { |
| 757 | case INV_FIELD_AMOUNT: |
| 758 | if (!b11->msat) |
| 759 | return rune_alt_single_missing(ctx, alt); |
| 760 | return rune_alt_single_int(ctx, alt, |
| 761 | b11->msat->millisatoshis /* Raw: rune check */); |
| 762 | case INV_FIELD_NODE_ID: { |
| 763 | const char *id = fmt_node_id(tmpctx, &b11->receiver_id); |
| 764 | return rune_alt_single_str(ctx, alt, id, strlen(id)); |
| 765 | } |
| 766 | case INV_FIELD_DESCRIPTION: |
| 767 | if (!b11->description) |
| 768 | return rune_alt_single_missing(ctx, alt); |
| 769 | return rune_alt_single_str(ctx, alt, b11->description, |
| 770 | strlen(b11->description)); |
| 771 | } |
| 772 | abort(); |
| 773 | } |
| 774 | |
| 775 | static const char *check_bolt12_condition(const tal_t *ctx, |
| 776 | const struct rune_altern *alt, |
no test coverage detected