From 7efbfa1e16c57ef35d6cbbff6f12adaa623a1c7d Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 13 May 2024 14:39:19 +0000 Subject: [PATCH] [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. --- lightning/src/offers/offer.rs | 2 ++ lightning/src/offers/refund.rs | 1 + 2 files changed, 3 insertions(+) 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>, -- 2.39.5