]> git.bitcoin.ninja Git - rust-lightning/commit
Add c_bindings version of InvoiceBuilder
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 26 Feb 2024 02:42:57 +0000 (20:42 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 8 Mar 2024 16:39:22 +0000 (10:39 -0600)
commit3bd00b943a3f3a101a77ad127b219dad91845aa6
treee63580a63075b802d58823ef77fe908fc368310d
parent07d628e0faf1a953a660144e3da77b0542027f84
Add c_bindings version of InvoiceBuilder

Use the macros introduced in the previous commit to define two builders
for each type parameterization of InvoiceBuilder
- InvoiceWithExplicitSigningPubkeyBuilder
- InvoiceWithDerivedSigningPubkeyBuilder

The difference between these and InvoiceBuilder is that these have
methods that take `self` by mutable reference instead of by value and
don't return anything instead returning the modified builder. This is
required because bindings don't support move semantics nor impl blocks
specific to a certain type parameterization. Because of this, the
builder's contents must be cloned when building a Bolt12Invoice.

Keeps InvoiceBuilder defined so that it can be used internally in
ChannelManager's OffersMessageHandler even when compiled for c_bindings.
lightning/src/ln/channelmanager.rs
lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/refund.rs