Skip to content

Commit b26a652

Browse files
committed
impl Clone on BOLT12 builders in bindings
This is required for GC'd languages which need to be able to clone in order to pass owned objects to Rust.
1 parent 09f23a3 commit b26a652

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lightning/src/offers/offer.rs

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ pub struct OfferBuilder<'a, M: MetadataStrategy, T: secp256k1::Signing> {
165165
///
166166
/// [module-level documentation]: self
167167
#[cfg(c_bindings)]
168+
#[derive(Clone)]
168169
pub struct OfferWithExplicitMetadataBuilder<'a> {
169170
offer: OfferContents,
170171
metadata_strategy: core::marker::PhantomData<ExplicitMetadata>,
@@ -177,6 +178,7 @@ pub struct OfferWithExplicitMetadataBuilder<'a> {
177178
///
178179
/// [module-level documentation]: self
179180
#[cfg(c_bindings)]
181+
#[derive(Clone)]
180182
pub struct OfferWithDerivedMetadataBuilder<'a> {
181183
offer: OfferContents,
182184
metadata_strategy: core::marker::PhantomData<DerivedMetadata>,

lightning/src/offers/refund.rs

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ pub struct RefundBuilder<'a, T: secp256k1::Signing> {
141141
///
142142
/// [module-level documentation]: self
143143
#[cfg(c_bindings)]
144+
#[derive(Clone)]
144145
pub struct RefundMaybeWithDerivedMetadataBuilder<'a> {
145146
refund: RefundContents,
146147
secp_ctx: Option<&'a Secp256k1<secp256k1::All>>,

0 commit comments

Comments
 (0)