From: Matt Corallo Date: Mon, 3 Oct 2022 21:15:58 +0000 (+0000) Subject: Add a convinience constructor for the new BigEndianScalar X-Git-Tag: v0.0.111.0^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=ecd28c5438784a2f6e0a561386d037af99a00f92;p=ldk-c-bindings Add a convinience constructor for the new BigEndianScalar --- diff --git a/lightning-c-bindings/src/c_types/mod.rs b/lightning-c-bindings/src/c_types/mod.rs index 0c46581..3f8c900 100644 --- a/lightning-c-bindings/src/c_types/mod.rs +++ b/lightning-c-bindings/src/c_types/mod.rs @@ -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