| 742 | } |
| 743 | |
| 744 | static const char *check_bolt12_condition(const tal_t *ctx, |
| 745 | const struct rune_altern *alt, |
| 746 | const struct tlv_invoice *b12, |
| 747 | enum invoice_field invf) |
| 748 | { |
| 749 | |
| 750 | switch (invf) { |
| 751 | case INV_FIELD_AMOUNT: |
| 752 | if (!b12->invoice_amount) |
| 753 | return rune_alt_single_missing(ctx, alt); |
| 754 | return rune_alt_single_int(ctx, alt, *b12->invoice_amount); |
| 755 | case INV_FIELD_NODE_ID: { |
| 756 | if (!b12->offer_issuer_id) |
| 757 | return rune_alt_single_missing(ctx, alt); |
| 758 | const char *id = fmt_pubkey(tmpctx, b12->offer_issuer_id); |
| 759 | return rune_alt_single_str(ctx, alt, id, strlen(id)); |
| 760 | } |
| 761 | case INV_FIELD_DESCRIPTION: |
| 762 | if (!b12->offer_description) |
| 763 | return rune_alt_single_missing(ctx, alt); |
| 764 | return rune_alt_single_str(ctx, alt, b12->offer_description, |
| 765 | tal_bytelen(b12->offer_description)); |
| 766 | } |
| 767 | abort(); |
| 768 | } |
| 769 | |
| 770 | static const char *check_inv_condition(const tal_t *ctx, |
| 771 | const struct rune_altern *alt, |
no test coverage detected