]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Add a convinience constructor for the new BigEndianScalar
authorMatt Corallo <git@bluematt.me>
Mon, 3 Oct 2022 21:15:58 +0000 (21:15 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 3 Oct 2022 21:21:14 +0000 (21:21 +0000)
lightning-c-bindings/src/c_types/mod.rs

index 0c46581f20266e5abe23dfab1e1d151de0d2b40d..3f8c900be02fd4d767d37eabddb21bcb859fa016 100644 (file)
@@ -166,6 +166,12 @@ impl BigEndianScalar {
        }
 }
 
+#[no_mangle]
+/// Convenience function for constructing a new BigEndianScalar
+pub extern "C" fn BigEndianScalar_new(big_endian_bytes: ThirtyTwoBytes) -> BigEndianScalar {
+       BigEndianScalar { big_endian_bytes: big_endian_bytes.data }
+}
+
 #[repr(C)]
 #[derive(Copy, Clone)]
 /// Represents an error returned from libsecp256k1 during validation of some secp256k1 data