]> git.bitcoin.ninja Git - rust-lightning/commit
Add c_bindings version of InvoiceRequestBuilder
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 23 Feb 2024 19:34:24 +0000 (13:34 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 6 Mar 2024 15:25:27 +0000 (09:25 -0600)
commitaf318b6efb1398099fc9c42f630b74abcc0b4fba
tree2637f7c3bfbcd44b6a97b7487305094ac34e46a3
parentc7b877efdde29ddfce072dc5ba5eef33f344935c
Add c_bindings version of InvoiceRequestBuilder

Use the macros introduced in the previous commit to define two builders
for each type parameterization of InvoiceRequestBuilder
- InvoiceRequestWithExplicitPayerIdBuilder
- InvoiceRequestWithDerivedPayerIdBuilder

The difference between these and InvoiceRequestBuilder 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 an InvoiceRequest.

Keeps InvoiceRequestBuilder defined so that it can be used internally in
ChannelManager::pay_for_offer even when compiled for c_bindings.
lightning/src/ln/channelmanager.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/offer.rs