]> git.bitcoin.ninja Git - rust-lightning/commitdiff
[UPSTREAM] impl `Clone` on BOLT12 builders in bindings
authorMatt Corallo <git@bluematt.me>
Mon, 13 May 2024 14:39:19 +0000 (14:39 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 13 May 2024 14:42:59 +0000 (14:42 +0000)
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
lightning/src/offers/refund.rs

index 2b61a55a8a006bfa6828ca3c5e5eb61883347e26..3462823528e56a633963cd3b5a929328eed31f7c 100644 (file)
@@ -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<ExplicitMetadata>,
@@ -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<DerivedMetadata>,
index 6a1d24106e906a532f6eec749d4c509d441ad02d..1988a92aaa7450262f0a04d1c2ba00d8545beec3 100644 (file)
@@ -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<secp256k1::All>>,