]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Implement `Clone` for `SecretKey`
authorMatt Corallo <git@bluematt.me>
Thu, 3 Mar 2022 03:20:07 +0000 (03:20 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 3 Mar 2022 03:20:07 +0000 (03:20 +0000)
c-bindings-gen/src/types.rs
lightning-c-bindings/src/c_types/mod.rs

index aebeb487ece66605a3770677b9d386041bc29a13..346f588221fa91e0d50a8ee75014f3d60775e799 100644 (file)
@@ -723,6 +723,7 @@ fn initial_clonable_types() -> HashSet<String> {
        let mut res = HashSet::new();
        res.insert("crate::c_types::u5".to_owned());
        res.insert("crate::c_types::ThirtyTwoBytes".to_owned());
+       res.insert("crate::c_types::SecretKey".to_owned());
        res.insert("crate::c_types::PublicKey".to_owned());
        res.insert("crate::c_types::Transaction".to_owned());
        res.insert("crate::c_types::TxOut".to_owned());
index 0bd976bac8f1e47ee75ad5995a0bf123ce8f01dd..f31d55bd1b2c7d9ec67f30552f0036d27e5b28a6 100644 (file)
@@ -67,6 +67,7 @@ impl PublicKey {
 }
 
 #[repr(C)]
+#[derive(Clone)]
 /// Represents a valid secp256k1 secret key serialized as a 32 byte array.
 pub struct SecretKey {
        /// The bytes of the secret key