Add c_bindings version of RefundBuilder
authorJeffrey Czyz <jkczyz@gmail.com>
Sat, 24 Feb 2024 02:30:50 +0000 (20:30 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 6 Mar 2024 15:25:26 +0000 (09:25 -0600)
commitb1ad95158e8cea0119df31fb5318a31fcc70e927
treee7f7afe4f8d249431d09c871fe26b0dc6f01d4fb
parent1af5c409fe860a8ddabaf3475a29bc83fb068b8a
Add c_bindings version of RefundBuilder

Use the macros introduced in the previous commit to define a builder
called RefundMaybeWithDerivedMetadataBuilder.

The difference between this and RefundBuilder is that this has 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. Because of this, the
builder's contents must be cloned when building a Refund.

Keeps RefundBuilder defined so that it can be used internally in
ChannelManager::create_refund_builder even when compiled for c_bindings.
lightning/src/ln/channelmanager.rs
lightning/src/offers/invoice.rs
lightning/src/offers/refund.rs