From: Matt Corallo Date: Mon, 13 May 2024 14:39:19 +0000 (+0000) Subject: [UPSTREAM] impl `Clone` on BOLT12 builders in bindings X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=7efbfa1e16c57ef35d6cbbff6f12adaa623a1c7d;p=rust-lightning [UPSTREAM] 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. --- diff --git a/lightning/src/offers/offer.rs b/lightning/src/offers/offer.rs index 2b61a55a8..346282352 100644 --- a/lightning/src/offers/offer.rs +++ b/lightning/src/offers/offer.rs @@ -165,6 +165,7 @@ pub struct OfferBuilder<'a, M: MetadataStrategy, T: secp256k1::Signing> { /// /// [module-level documentation]: self #[cfg(c_bindings)] +#[derive(Clone)] pub struct OfferWithExplicitMetadataBuilder<'a> { offer: OfferContents, metadata_strategy: core::marker::PhantomData, @@ -177,6 +178,7 @@ pub struct OfferWithExplicitMetadataBuilder<'a> { /// /// [module-level documentation]: self #[cfg(c_bindings)] +#[derive(Clone)] pub struct OfferWithDerivedMetadataBuilder<'a> { offer: OfferContents, metadata_strategy: core::marker::PhantomData, diff --git a/lightning/src/offers/refund.rs b/lightning/src/offers/refund.rs index 6a1d24106..1988a92aa 100644 --- a/lightning/src/offers/refund.rs +++ b/lightning/src/offers/refund.rs @@ -141,6 +141,7 @@ pub struct RefundBuilder<'a, T: secp256k1::Signing> { /// /// [module-level documentation]: self #[cfg(c_bindings)] +#[derive(Clone)] pub struct RefundMaybeWithDerivedMetadataBuilder<'a> { refund: RefundContents, secp_ctx: Option<&'a Secp256k1>,