]> git.bitcoin.ninja Git - rust-lightning/commit
Expose Offer/InvoiceRequest methods in Invoice
authorJeffrey Czyz <jkczyz@gmail.com>
Wed, 16 Aug 2023 21:35:16 +0000 (16:35 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 22 Aug 2023 00:14:29 +0000 (19:14 -0500)
commit7f641da655810ef78cd61b796b79cbc4707d28bf
treef86d8583f8d82e6b814ea525d7581a5d98f1a23b
parent57e62da9f44a4da9044a6ef8993bb280ef3cbfd8
Expose Offer/InvoiceRequest methods in Invoice

Bolt12Invoice can either be for an Offer (via an InvoiceRequest) or a
Refund. It wraps those types, so expose their methods on both
Bolt12Invoice and UnsignedBolt12Invoice.

Since Refund does not have all the Offer/InvoiceRequest methods, use an
Option return type such that None can returned for refund-based
invoices.

For methods that are duplicated between Offer/InvoiceRequest and
Bolt12Invoice, prefer the (non-Option, if applicable) method from
Bolt12Invoice (e.g., amount_msats, signing_pubkey).
lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/payer.rs
lightning/src/offers/refund.rs