| 717 | } |
| 718 | |
| 719 | static const char *check_bolt11_condition(const tal_t *ctx, |
| 720 | const struct rune_altern *alt, |
| 721 | const struct bolt11 *b11, |
| 722 | enum invoice_field invf) |
| 723 | { |
| 724 | |
| 725 | switch (invf) { |
| 726 | case INV_FIELD_AMOUNT: |
| 727 | if (!b11->msat) |
| 728 | return rune_alt_single_missing(ctx, alt); |
| 729 | return rune_alt_single_int(ctx, alt, |
| 730 | b11->msat->millisatoshis /* Raw: rune check */); |
| 731 | case INV_FIELD_NODE_ID: { |
| 732 | const char *id = fmt_node_id(tmpctx, &b11->receiver_id); |
| 733 | return rune_alt_single_str(ctx, alt, id, strlen(id)); |
| 734 | } |
| 735 | case INV_FIELD_DESCRIPTION: |
| 736 | if (!b11->description) |
| 737 | return rune_alt_single_missing(ctx, alt); |
| 738 | return rune_alt_single_str(ctx, alt, b11->description, |
| 739 | strlen(b11->description)); |
| 740 | } |
| 741 | abort(); |
| 742 | } |
| 743 | |
| 744 | static const char *check_bolt12_condition(const tal_t *ctx, |
| 745 | const struct rune_altern *alt, |
no test coverage detected