Merge pull request #60 from TheBlueMatt/main
[ldk-c-bindings] / lightning-c-bindings / src / lightning / ln / msgs.rs
index 8c20bdd8c13c8d23c2db5dd07deba759b7e762ac..1976040fd7da7d464a15f39b7e28e7ed8c02795c 100644 (file)
 //! raw socket events into your non-internet-facing system and then send routing events back to
 //! track the network on the less-secure system.
 
-use std::str::FromStr;
-use std::ffi::c_void;
+use alloc::str::FromStr;
+use core::ffi::c_void;
 use core::convert::Infallible;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
+#[cfg(feature="no-std")]
+use alloc::{vec::Vec, boxed::Box};
 
 
 use lightning::ln::msgs::DecodeError as nativeDecodeErrorImport;
@@ -76,14 +78,14 @@ impl DecodeError {
        pub(crate) fn take_inner(mut self) -> *mut nativeDecodeError {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
 impl Clone for DecodeError {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeDecodeError>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeDecodeError>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -146,7 +148,7 @@ impl Init {
        pub(crate) fn take_inner(mut self) -> *mut nativeInit {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -172,7 +174,7 @@ pub extern "C" fn Init_new(mut features_arg: crate::lightning::ln::features::Ini
 impl Clone for Init {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeInit>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeInit>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -235,34 +237,40 @@ impl ErrorMessage {
        pub(crate) fn take_inner(mut self) -> *mut nativeErrorMessage {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
-/// The channel ID involved in the error
+/// The channel ID involved in the error.
+///
+/// All-0s indicates a general error unrelated to a specific channel, after which all channels
+/// with the sending peer should be closed.
 #[no_mangle]
 pub extern "C" fn ErrorMessage_get_channel_id(this_ptr: &ErrorMessage) -> *const [u8; 32] {
        let mut inner_val = &mut this_ptr.get_native_mut_ref().channel_id;
        inner_val
 }
-/// The channel ID involved in the error
+/// The channel ID involved in the error.
+///
+/// All-0s indicates a general error unrelated to a specific channel, after which all channels
+/// with the sending peer should be closed.
 #[no_mangle]
 pub extern "C" fn ErrorMessage_set_channel_id(this_ptr: &mut ErrorMessage, mut val: crate::c_types::ThirtyTwoBytes) {
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.channel_id = val.data;
 }
 /// A possibly human-readable error description.
-/// The string should be sanitized before it is used (e.g. emitted to logs
-/// or printed to stdout).  Otherwise, a well crafted error message may trigger a security
-/// vulnerability in the terminal emulator or the logging subsystem.
+/// The string should be sanitized before it is used (e.g. emitted to logs or printed to
+/// stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+/// the terminal emulator or the logging subsystem.
 #[no_mangle]
 pub extern "C" fn ErrorMessage_get_data(this_ptr: &ErrorMessage) -> crate::c_types::Str {
        let mut inner_val = &mut this_ptr.get_native_mut_ref().data;
        inner_val.as_str().into()
 }
 /// A possibly human-readable error description.
-/// The string should be sanitized before it is used (e.g. emitted to logs
-/// or printed to stdout).  Otherwise, a well crafted error message may trigger a security
-/// vulnerability in the terminal emulator or the logging subsystem.
+/// The string should be sanitized before it is used (e.g. emitted to logs or printed to
+/// stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+/// the terminal emulator or the logging subsystem.
 #[no_mangle]
 pub extern "C" fn ErrorMessage_set_data(this_ptr: &mut ErrorMessage, mut val: crate::c_types::Str) {
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.data = val.into_string();
@@ -279,7 +287,7 @@ pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwo
 impl Clone for ErrorMessage {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeErrorMessage>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeErrorMessage>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -296,6 +304,117 @@ pub extern "C" fn ErrorMessage_clone(orig: &ErrorMessage) -> ErrorMessage {
        orig.clone()
 }
 
+use lightning::ln::msgs::WarningMessage as nativeWarningMessageImport;
+pub(crate) type nativeWarningMessage = nativeWarningMessageImport;
+
+/// A warning message to be sent or received from a peer
+#[must_use]
+#[repr(C)]
+pub struct WarningMessage {
+       /// A pointer to the opaque Rust object.
+
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeWarningMessage,
+       /// Indicates that this is the only struct which contains the same pointer.
+
+       /// Rust functions which take ownership of an object provided via an argument require
+       /// this to be true and invalidate the object pointed to by inner.
+       pub is_owned: bool,
+}
+
+impl Drop for WarningMessage {
+       fn drop(&mut self) {
+               if self.is_owned && !<*mut nativeWarningMessage>::is_null(self.inner) {
+                       let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+               }
+       }
+}
+/// Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn WarningMessage_free(this_obj: WarningMessage) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn WarningMessage_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeWarningMessage); }
+}
+#[allow(unused)]
+impl WarningMessage {
+       pub(crate) fn get_native_ref(&self) -> &'static nativeWarningMessage {
+               unsafe { &*ObjOps::untweak_ptr(self.inner) }
+       }
+       pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeWarningMessage {
+               unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
+       }
+       /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+       pub(crate) fn take_inner(mut self) -> *mut nativeWarningMessage {
+               assert!(self.is_owned);
+               let ret = ObjOps::untweak_ptr(self.inner);
+               self.inner = core::ptr::null_mut();
+               ret
+       }
+}
+/// The channel ID involved in the warning.
+///
+/// All-0s indicates a warning unrelated to a specific channel.
+#[no_mangle]
+pub extern "C" fn WarningMessage_get_channel_id(this_ptr: &WarningMessage) -> *const [u8; 32] {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().channel_id;
+       inner_val
+}
+/// The channel ID involved in the warning.
+///
+/// All-0s indicates a warning unrelated to a specific channel.
+#[no_mangle]
+pub extern "C" fn WarningMessage_set_channel_id(this_ptr: &mut WarningMessage, mut val: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.channel_id = val.data;
+}
+/// A possibly human-readable warning description.
+/// The string should be sanitized before it is used (e.g. emitted to logs or printed to
+/// stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+/// the terminal emulator or the logging subsystem.
+#[no_mangle]
+pub extern "C" fn WarningMessage_get_data(this_ptr: &WarningMessage) -> crate::c_types::Str {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().data;
+       inner_val.as_str().into()
+}
+/// A possibly human-readable warning description.
+/// The string should be sanitized before it is used (e.g. emitted to logs or printed to
+/// stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+/// the terminal emulator or the logging subsystem.
+#[no_mangle]
+pub extern "C" fn WarningMessage_set_data(this_ptr: &mut WarningMessage, mut val: crate::c_types::Str) {
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.data = val.into_string();
+}
+/// Constructs a new WarningMessage given each field
+#[must_use]
+#[no_mangle]
+pub extern "C" fn WarningMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut data_arg: crate::c_types::Str) -> WarningMessage {
+       WarningMessage { inner: ObjOps::heap_alloc(nativeWarningMessage {
+               channel_id: channel_id_arg.data,
+               data: data_arg.into_string(),
+       }), is_owned: true }
+}
+impl Clone for WarningMessage {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if <*mut nativeWarningMessage>::is_null(self.inner) { core::ptr::null_mut() } else {
+                               ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn WarningMessage_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeWarningMessage)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the WarningMessage
+pub extern "C" fn WarningMessage_clone(orig: &WarningMessage) -> WarningMessage {
+       orig.clone()
+}
+
 use lightning::ln::msgs::Ping as nativePingImport;
 pub(crate) type nativePing = nativePingImport;
 
@@ -342,7 +461,7 @@ impl Ping {
        pub(crate) fn take_inner(mut self) -> *mut nativePing {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -382,7 +501,7 @@ pub extern "C" fn Ping_new(mut ponglen_arg: u16, mut byteslen_arg: u16) -> Ping
 impl Clone for Ping {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativePing>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativePing>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -445,7 +564,7 @@ impl Pong {
        pub(crate) fn take_inner(mut self) -> *mut nativePong {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -473,7 +592,7 @@ pub extern "C" fn Pong_new(mut byteslen_arg: u16) -> Pong {
 impl Clone for Pong {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativePong>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativePong>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -536,7 +655,7 @@ impl OpenChannel {
        pub(crate) fn take_inner(mut self) -> *mut nativeOpenChannel {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -738,10 +857,31 @@ pub extern "C" fn OpenChannel_get_channel_flags(this_ptr: &OpenChannel) -> u8 {
 pub extern "C" fn OpenChannel_set_channel_flags(this_ptr: &mut OpenChannel, mut val: u8) {
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.channel_flags = val;
 }
+/// The channel type that this channel will represent. If none is set, we derive the channel
+/// type from the intersection of our feature bits with our counterparty's feature bits from
+/// the Init message.
+///
+/// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+#[no_mangle]
+pub extern "C" fn OpenChannel_get_channel_type(this_ptr: &OpenChannel) -> crate::lightning::ln::features::ChannelTypeFeatures {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().channel_type;
+       let mut local_inner_val = crate::lightning::ln::features::ChannelTypeFeatures { inner: unsafe { (if inner_val.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::features::ChannelTypeFeatures<>) as *mut _ }, is_owned: false };
+       local_inner_val
+}
+/// The channel type that this channel will represent. If none is set, we derive the channel
+/// type from the intersection of our feature bits with our counterparty's feature bits from
+/// the Init message.
+///
+/// Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+#[no_mangle]
+pub extern "C" fn OpenChannel_set_channel_type(this_ptr: &mut OpenChannel, mut val: crate::lightning::ln::features::ChannelTypeFeatures) {
+       let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.channel_type = local_val;
+}
 impl Clone for OpenChannel {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeOpenChannel>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeOpenChannel>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -804,7 +944,7 @@ impl AcceptChannel {
        pub(crate) fn take_inner(mut self) -> *mut nativeAcceptChannel {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -962,10 +1102,35 @@ pub extern "C" fn AcceptChannel_get_first_per_commitment_point(this_ptr: &Accept
 pub extern "C" fn AcceptChannel_set_first_per_commitment_point(this_ptr: &mut AcceptChannel, mut val: crate::c_types::PublicKey) {
        unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.first_per_commitment_point = val.into_rust();
 }
+/// The channel type that this channel will represent. If none is set, we derive the channel
+/// type from the intersection of our feature bits with our counterparty's feature bits from
+/// the Init message.
+///
+/// This is required to match the equivalent field in [`OpenChannel::channel_type`].
+///
+/// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+#[no_mangle]
+pub extern "C" fn AcceptChannel_get_channel_type(this_ptr: &AcceptChannel) -> crate::lightning::ln::features::ChannelTypeFeatures {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().channel_type;
+       let mut local_inner_val = crate::lightning::ln::features::ChannelTypeFeatures { inner: unsafe { (if inner_val.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::features::ChannelTypeFeatures<>) as *mut _ }, is_owned: false };
+       local_inner_val
+}
+/// The channel type that this channel will represent. If none is set, we derive the channel
+/// type from the intersection of our feature bits with our counterparty's feature bits from
+/// the Init message.
+///
+/// This is required to match the equivalent field in [`OpenChannel::channel_type`].
+///
+/// Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+#[no_mangle]
+pub extern "C" fn AcceptChannel_set_channel_type(this_ptr: &mut AcceptChannel, mut val: crate::lightning::ln::features::ChannelTypeFeatures) {
+       let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.channel_type = local_val;
+}
 impl Clone for AcceptChannel {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeAcceptChannel>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeAcceptChannel>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1028,7 +1193,7 @@ impl FundingCreated {
        pub(crate) fn take_inner(mut self) -> *mut nativeFundingCreated {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1090,7 +1255,7 @@ pub extern "C" fn FundingCreated_new(mut temporary_channel_id_arg: crate::c_type
 impl Clone for FundingCreated {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeFundingCreated>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeFundingCreated>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1153,7 +1318,7 @@ impl FundingSigned {
        pub(crate) fn take_inner(mut self) -> *mut nativeFundingSigned {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1191,7 +1356,7 @@ pub extern "C" fn FundingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw
 impl Clone for FundingSigned {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeFundingSigned>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeFundingSigned>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1254,7 +1419,7 @@ impl FundingLocked {
        pub(crate) fn take_inner(mut self) -> *mut nativeFundingLocked {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1292,7 +1457,7 @@ pub extern "C" fn FundingLocked_new(mut channel_id_arg: crate::c_types::ThirtyTw
 impl Clone for FundingLocked {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeFundingLocked>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeFundingLocked>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1355,7 +1520,7 @@ impl Shutdown {
        pub(crate) fn take_inner(mut self) -> *mut nativeShutdown {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1395,7 +1560,7 @@ pub extern "C" fn Shutdown_new(mut channel_id_arg: crate::c_types::ThirtyTwoByte
 impl Clone for Shutdown {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeShutdown>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeShutdown>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1460,7 +1625,7 @@ impl ClosingSignedFeeRange {
        pub(crate) fn take_inner(mut self) -> *mut nativeClosingSignedFeeRange {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1502,7 +1667,7 @@ pub extern "C" fn ClosingSignedFeeRange_new(mut min_fee_satoshis_arg: u64, mut m
 impl Clone for ClosingSignedFeeRange {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeClosingSignedFeeRange>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeClosingSignedFeeRange>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1565,7 +1730,7 @@ impl ClosingSigned {
        pub(crate) fn take_inner(mut self) -> *mut nativeClosingSigned {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1609,7 +1774,7 @@ pub extern "C" fn ClosingSigned_set_signature(this_ptr: &mut ClosingSigned, mut
 #[no_mangle]
 pub extern "C" fn ClosingSigned_get_fee_range(this_ptr: &ClosingSigned) -> crate::lightning::ln::msgs::ClosingSignedFeeRange {
        let mut inner_val = &mut this_ptr.get_native_mut_ref().fee_range;
-       let mut local_inner_val = crate::lightning::ln::msgs::ClosingSignedFeeRange { inner: unsafe { (if inner_val.is_none() { std::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::msgs::ClosingSignedFeeRange<>) as *mut _ }, is_owned: false };
+       let mut local_inner_val = crate::lightning::ln::msgs::ClosingSignedFeeRange { inner: unsafe { (if inner_val.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::msgs::ClosingSignedFeeRange<>) as *mut _ }, is_owned: false };
        local_inner_val
 }
 /// The minimum and maximum fees which the sender is willing to accept, provided only by new
@@ -1636,7 +1801,7 @@ pub extern "C" fn ClosingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw
 impl Clone for ClosingSigned {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeClosingSigned>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeClosingSigned>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1699,7 +1864,7 @@ impl UpdateAddHTLC {
        pub(crate) fn take_inner(mut self) -> *mut nativeUpdateAddHTLC {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1761,7 +1926,7 @@ pub extern "C" fn UpdateAddHTLC_set_cltv_expiry(this_ptr: &mut UpdateAddHTLC, mu
 impl Clone for UpdateAddHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUpdateAddHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateAddHTLC>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1824,7 +1989,7 @@ impl UpdateFulfillHTLC {
        pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFulfillHTLC {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1874,7 +2039,7 @@ pub extern "C" fn UpdateFulfillHTLC_new(mut channel_id_arg: crate::c_types::Thir
 impl Clone for UpdateFulfillHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUpdateFulfillHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFulfillHTLC>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -1937,7 +2102,7 @@ impl UpdateFailHTLC {
        pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFailHTLC {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -1966,7 +2131,7 @@ pub extern "C" fn UpdateFailHTLC_set_htlc_id(this_ptr: &mut UpdateFailHTLC, mut
 impl Clone for UpdateFailHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUpdateFailHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFailHTLC>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2029,7 +2194,7 @@ impl UpdateFailMalformedHTLC {
        pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFailMalformedHTLC {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2069,7 +2234,7 @@ pub extern "C" fn UpdateFailMalformedHTLC_set_failure_code(this_ptr: &mut Update
 impl Clone for UpdateFailMalformedHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUpdateFailMalformedHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFailMalformedHTLC>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2132,7 +2297,7 @@ impl CommitmentSigned {
        pub(crate) fn take_inner(mut self) -> *mut nativeCommitmentSigned {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2178,7 +2343,7 @@ pub extern "C" fn CommitmentSigned_new(mut channel_id_arg: crate::c_types::Thirt
 impl Clone for CommitmentSigned {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeCommitmentSigned>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeCommitmentSigned>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2241,7 +2406,7 @@ impl RevokeAndACK {
        pub(crate) fn take_inner(mut self) -> *mut nativeRevokeAndACK {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2291,7 +2456,7 @@ pub extern "C" fn RevokeAndACK_new(mut channel_id_arg: crate::c_types::ThirtyTwo
 impl Clone for RevokeAndACK {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeRevokeAndACK>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeRevokeAndACK>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2354,7 +2519,7 @@ impl UpdateFee {
        pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFee {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2392,7 +2557,7 @@ pub extern "C" fn UpdateFee_new(mut channel_id_arg: crate::c_types::ThirtyTwoByt
 impl Clone for UpdateFee {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUpdateFee>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFee>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2458,7 +2623,7 @@ impl DataLossProtect {
        pub(crate) fn take_inner(mut self) -> *mut nativeDataLossProtect {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2498,7 +2663,7 @@ pub extern "C" fn DataLossProtect_new(mut your_last_per_commitment_secret_arg: c
 impl Clone for DataLossProtect {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeDataLossProtect>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeDataLossProtect>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2561,7 +2726,7 @@ impl ChannelReestablish {
        pub(crate) fn take_inner(mut self) -> *mut nativeChannelReestablish {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2601,7 +2766,7 @@ pub extern "C" fn ChannelReestablish_set_next_remote_commitment_number(this_ptr:
 impl Clone for ChannelReestablish {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeChannelReestablish>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeChannelReestablish>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2664,7 +2829,7 @@ impl AnnouncementSignatures {
        pub(crate) fn take_inner(mut self) -> *mut nativeAnnouncementSignatures {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -2726,7 +2891,7 @@ pub extern "C" fn AnnouncementSignatures_new(mut channel_id_arg: crate::c_types:
 impl Clone for AnnouncementSignatures {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeAnnouncementSignatures>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeAnnouncementSignatures>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -2762,12 +2927,10 @@ pub enum NetAddress {
                port: u16,
        },
        /// An old-style Tor onion address/port on which the peer is listening.
-       OnionV2 {
-               /// The bytes (usually encoded in base32 with \".onion\" appended)
-               addr: crate::c_types::TenBytes,
-               /// The port on which the node is listening
-               port: u16,
-       },
+       ///
+       /// This field is deprecated and the Tor network generally no longer supports V2 Onion
+       /// addresses. Thus, the details are not parsed here.
+       OnionV2(crate::c_types::TwelveBytes),
        /// A new-style Tor onion address/port on which the peer is listening.
        /// To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
        /// wrap as base32 and append \".onion\".
@@ -2803,13 +2966,11 @@ impl NetAddress {
                                        port: port_nonref,
                                }
                        },
-                       NetAddress::OnionV2 {ref addr, ref port, } => {
-                               let mut addr_nonref = (*addr).clone();
-                               let mut port_nonref = (*port).clone();
-                               nativeNetAddress::OnionV2 {
-                                       addr: addr_nonref.data,
-                                       port: port_nonref,
-                               }
+                       NetAddress::OnionV2 (ref a, ) => {
+                               let mut a_nonref = (*a).clone();
+                               nativeNetAddress::OnionV2 (
+                                       a_nonref.data,
+                               )
                        },
                        NetAddress::OnionV3 {ref ed25519_pubkey, ref checksum, ref version, ref port, } => {
                                let mut ed25519_pubkey_nonref = (*ed25519_pubkey).clone();
@@ -2840,11 +3001,10 @@ impl NetAddress {
                                        port: port,
                                }
                        },
-                       NetAddress::OnionV2 {mut addr, mut port, } => {
-                               nativeNetAddress::OnionV2 {
-                                       addr: addr.data,
-                                       port: port,
-                               }
+                       NetAddress::OnionV2 (mut a, ) => {
+                               nativeNetAddress::OnionV2 (
+                                       a.data,
+                               )
                        },
                        NetAddress::OnionV3 {mut ed25519_pubkey, mut checksum, mut version, mut port, } => {
                                nativeNetAddress::OnionV3 {
@@ -2875,13 +3035,11 @@ impl NetAddress {
                                        port: port_nonref,
                                }
                        },
-                       nativeNetAddress::OnionV2 {ref addr, ref port, } => {
-                               let mut addr_nonref = (*addr).clone();
-                               let mut port_nonref = (*port).clone();
-                               NetAddress::OnionV2 {
-                                       addr: crate::c_types::TenBytes { data: addr_nonref },
-                                       port: port_nonref,
-                               }
+                       nativeNetAddress::OnionV2 (ref a, ) => {
+                               let mut a_nonref = (*a).clone();
+                               NetAddress::OnionV2 (
+                                       crate::c_types::TwelveBytes { data: a_nonref },
+                               )
                        },
                        nativeNetAddress::OnionV3 {ref ed25519_pubkey, ref checksum, ref version, ref port, } => {
                                let mut ed25519_pubkey_nonref = (*ed25519_pubkey).clone();
@@ -2912,11 +3070,10 @@ impl NetAddress {
                                        port: port,
                                }
                        },
-                       nativeNetAddress::OnionV2 {mut addr, mut port, } => {
-                               NetAddress::OnionV2 {
-                                       addr: crate::c_types::TenBytes { data: addr },
-                                       port: port,
-                               }
+                       nativeNetAddress::OnionV2 (mut a, ) => {
+                               NetAddress::OnionV2 (
+                                       crate::c_types::TwelveBytes { data: a },
+                               )
                        },
                        nativeNetAddress::OnionV3 {mut ed25519_pubkey, mut checksum, mut version, mut port, } => {
                                NetAddress::OnionV3 {
@@ -2955,11 +3112,8 @@ pub extern "C" fn NetAddress_ipv6(addr: crate::c_types::SixteenBytes, port: u16)
 }
 #[no_mangle]
 /// Utility method to constructs a new OnionV2-variant NetAddress
-pub extern "C" fn NetAddress_onion_v2(addr: crate::c_types::TenBytes, port: u16) -> NetAddress {
-       NetAddress::OnionV2 {
-               addr,
-               port,
-       }
+pub extern "C" fn NetAddress_onion_v2(a: crate::c_types::TwelveBytes) -> NetAddress {
+       NetAddress::OnionV2(a, )
 }
 #[no_mangle]
 /// Utility method to constructs a new OnionV3-variant NetAddress
@@ -2979,7 +3133,7 @@ pub extern "C" fn NetAddress_write(obj: &NetAddress) -> crate::c_types::derived:
 #[no_mangle]
 /// Read a NetAddress from a byte array, created by NetAddress_write
 pub extern "C" fn NetAddress_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NetAddressDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::NetAddress, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::NetAddress::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -3030,7 +3184,7 @@ impl UnsignedNodeAnnouncement {
        pub(crate) fn take_inner(mut self) -> *mut nativeUnsignedNodeAnnouncement {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3102,7 +3256,7 @@ pub extern "C" fn UnsignedNodeAnnouncement_set_addresses(this_ptr: &mut Unsigned
 impl Clone for UnsignedNodeAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUnsignedNodeAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUnsignedNodeAnnouncement>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3165,7 +3319,7 @@ impl NodeAnnouncement {
        pub(crate) fn take_inner(mut self) -> *mut nativeNodeAnnouncement {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3203,7 +3357,7 @@ pub extern "C" fn NodeAnnouncement_new(mut signature_arg: crate::c_types::Signat
 impl Clone for NodeAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeNodeAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeNodeAnnouncement>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3266,7 +3420,7 @@ impl UnsignedChannelAnnouncement {
        pub(crate) fn take_inner(mut self) -> *mut nativeUnsignedChannelAnnouncement {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3350,7 +3504,7 @@ pub extern "C" fn UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr: &mut U
 impl Clone for UnsignedChannelAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUnsignedChannelAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUnsignedChannelAnnouncement>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3413,7 +3567,7 @@ impl ChannelAnnouncement {
        pub(crate) fn take_inner(mut self) -> *mut nativeChannelAnnouncement {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3487,7 +3641,7 @@ pub extern "C" fn ChannelAnnouncement_new(mut node_signature_1_arg: crate::c_typ
 impl Clone for ChannelAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeChannelAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeChannelAnnouncement>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3550,7 +3704,7 @@ impl UnsignedChannelUpdate {
        pub(crate) fn take_inner(mut self) -> *mut nativeUnsignedChannelUpdate {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3659,7 +3813,7 @@ pub extern "C" fn UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr
 impl Clone for UnsignedChannelUpdate {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeUnsignedChannelUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUnsignedChannelUpdate>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3722,7 +3876,7 @@ impl ChannelUpdate {
        pub(crate) fn take_inner(mut self) -> *mut nativeChannelUpdate {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3760,7 +3914,7 @@ pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature
 impl Clone for ChannelUpdate {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeChannelUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeChannelUpdate>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3826,7 +3980,7 @@ impl QueryChannelRange {
        pub(crate) fn take_inner(mut self) -> *mut nativeQueryChannelRange {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -3876,7 +4030,7 @@ pub extern "C" fn QueryChannelRange_new(mut chain_hash_arg: crate::c_types::Thir
 impl Clone for QueryChannelRange {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeQueryChannelRange>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeQueryChannelRange>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -3945,7 +4099,7 @@ impl ReplyChannelRange {
        pub(crate) fn take_inner(mut self) -> *mut nativeReplyChannelRange {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -4015,7 +4169,7 @@ pub extern "C" fn ReplyChannelRange_new(mut chain_hash_arg: crate::c_types::Thir
 impl Clone for ReplyChannelRange {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeReplyChannelRange>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeReplyChannelRange>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -4085,7 +4239,7 @@ impl QueryShortChannelIds {
        pub(crate) fn take_inner(mut self) -> *mut nativeQueryShortChannelIds {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -4119,7 +4273,7 @@ pub extern "C" fn QueryShortChannelIds_new(mut chain_hash_arg: crate::c_types::T
 impl Clone for QueryShortChannelIds {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeQueryShortChannelIds>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeQueryShortChannelIds>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -4185,7 +4339,7 @@ impl ReplyShortChannelIdsEnd {
        pub(crate) fn take_inner(mut self) -> *mut nativeReplyShortChannelIdsEnd {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -4225,7 +4379,7 @@ pub extern "C" fn ReplyShortChannelIdsEnd_new(mut chain_hash_arg: crate::c_types
 impl Clone for ReplyShortChannelIdsEnd {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeReplyShortChannelIdsEnd>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeReplyShortChannelIdsEnd>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -4290,7 +4444,7 @@ impl GossipTimestampFilter {
        pub(crate) fn take_inner(mut self) -> *mut nativeGossipTimestampFilter {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -4340,7 +4494,7 @@ pub extern "C" fn GossipTimestampFilter_new(mut chain_hash_arg: crate::c_types::
 impl Clone for GossipTimestampFilter {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeGossipTimestampFilter>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeGossipTimestampFilter>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -4373,11 +4527,24 @@ pub enum ErrorAction {
        /// The peer did something harmless that we weren't able to meaningfully process.
        /// If the error is logged, log it at the given level.
        IgnoreAndLog(crate::lightning::util::logger::Level),
+       /// The peer provided us with a gossip message which we'd already seen. In most cases this
+       /// should be ignored, but it may result in the message being forwarded if it is a duplicate of
+       /// our own channel announcements.
+       IgnoreDuplicateGossip,
        /// The peer did something incorrect. Tell them.
        SendErrorMessage {
                /// The message to send.
                msg: crate::lightning::ln::msgs::ErrorMessage,
        },
+       /// The peer did something incorrect. Tell them without closing any channels.
+       SendWarningMessage {
+               /// The message to send.
+               msg: crate::lightning::ln::msgs::WarningMessage,
+               /// The peer may have done something harmless that we weren't able to meaningfully process,
+               /// though we should still tell them about it.
+               /// If this event is logged, log it at the given level.
+               log_level: crate::lightning::util::logger::Level,
+       },
 }
 use lightning::ln::msgs::ErrorAction as nativeErrorAction;
 impl ErrorAction {
@@ -4398,12 +4565,21 @@ impl ErrorAction {
                                        a_nonref.into_native(),
                                )
                        },
+                       ErrorAction::IgnoreDuplicateGossip => nativeErrorAction::IgnoreDuplicateGossip,
                        ErrorAction::SendErrorMessage {ref msg, } => {
                                let mut msg_nonref = (*msg).clone();
                                nativeErrorAction::SendErrorMessage {
                                        msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
                                }
                        },
+                       ErrorAction::SendWarningMessage {ref msg, ref log_level, } => {
+                               let mut msg_nonref = (*msg).clone();
+                               let mut log_level_nonref = (*log_level).clone();
+                               nativeErrorAction::SendWarningMessage {
+                                       msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
+                                       log_level: log_level_nonref.into_native(),
+                               }
+                       },
                }
        }
        #[allow(unused)]
@@ -4421,11 +4597,18 @@ impl ErrorAction {
                                        a.into_native(),
                                )
                        },
+                       ErrorAction::IgnoreDuplicateGossip => nativeErrorAction::IgnoreDuplicateGossip,
                        ErrorAction::SendErrorMessage {mut msg, } => {
                                nativeErrorAction::SendErrorMessage {
                                        msg: *unsafe { Box::from_raw(msg.take_inner()) },
                                }
                        },
+                       ErrorAction::SendWarningMessage {mut msg, mut log_level, } => {
+                               nativeErrorAction::SendWarningMessage {
+                                       msg: *unsafe { Box::from_raw(msg.take_inner()) },
+                                       log_level: log_level.into_native(),
+                               }
+                       },
                }
        }
        #[allow(unused)]
@@ -4433,7 +4616,7 @@ impl ErrorAction {
                match native {
                        nativeErrorAction::DisconnectPeer {ref msg, } => {
                                let mut msg_nonref = (*msg).clone();
-                               let mut local_msg_nonref = crate::lightning::ln::msgs::ErrorMessage { inner: if msg_nonref.is_none() { std::ptr::null_mut() } else {  { ObjOps::heap_alloc((msg_nonref.unwrap())) } }, is_owned: true };
+                               let mut local_msg_nonref = crate::lightning::ln::msgs::ErrorMessage { inner: if msg_nonref.is_none() { core::ptr::null_mut() } else {  { ObjOps::heap_alloc((msg_nonref.unwrap())) } }, is_owned: true };
                                ErrorAction::DisconnectPeer {
                                        msg: local_msg_nonref,
                                }
@@ -4445,19 +4628,28 @@ impl ErrorAction {
                                        crate::lightning::util::logger::Level::native_into(a_nonref),
                                )
                        },
+                       nativeErrorAction::IgnoreDuplicateGossip => ErrorAction::IgnoreDuplicateGossip,
                        nativeErrorAction::SendErrorMessage {ref msg, } => {
                                let mut msg_nonref = (*msg).clone();
                                ErrorAction::SendErrorMessage {
                                        msg: crate::lightning::ln::msgs::ErrorMessage { inner: ObjOps::heap_alloc(msg_nonref), is_owned: true },
                                }
                        },
+                       nativeErrorAction::SendWarningMessage {ref msg, ref log_level, } => {
+                               let mut msg_nonref = (*msg).clone();
+                               let mut log_level_nonref = (*log_level).clone();
+                               ErrorAction::SendWarningMessage {
+                                       msg: crate::lightning::ln::msgs::WarningMessage { inner: ObjOps::heap_alloc(msg_nonref), is_owned: true },
+                                       log_level: crate::lightning::util::logger::Level::native_into(log_level_nonref),
+                               }
+                       },
                }
        }
        #[allow(unused)]
        pub(crate) fn native_into(native: nativeErrorAction) -> Self {
                match native {
                        nativeErrorAction::DisconnectPeer {mut msg, } => {
-                               let mut local_msg = crate::lightning::ln::msgs::ErrorMessage { inner: if msg.is_none() { std::ptr::null_mut() } else {  { ObjOps::heap_alloc((msg.unwrap())) } }, is_owned: true };
+                               let mut local_msg = crate::lightning::ln::msgs::ErrorMessage { inner: if msg.is_none() { core::ptr::null_mut() } else {  { ObjOps::heap_alloc((msg.unwrap())) } }, is_owned: true };
                                ErrorAction::DisconnectPeer {
                                        msg: local_msg,
                                }
@@ -4468,11 +4660,18 @@ impl ErrorAction {
                                        crate::lightning::util::logger::Level::native_into(a),
                                )
                        },
+                       nativeErrorAction::IgnoreDuplicateGossip => ErrorAction::IgnoreDuplicateGossip,
                        nativeErrorAction::SendErrorMessage {mut msg, } => {
                                ErrorAction::SendErrorMessage {
                                        msg: crate::lightning::ln::msgs::ErrorMessage { inner: ObjOps::heap_alloc(msg), is_owned: true },
                                }
                        },
+                       nativeErrorAction::SendWarningMessage {mut msg, mut log_level, } => {
+                               ErrorAction::SendWarningMessage {
+                                       msg: crate::lightning::ln::msgs::WarningMessage { inner: ObjOps::heap_alloc(msg), is_owned: true },
+                                       log_level: crate::lightning::util::logger::Level::native_into(log_level),
+                               }
+                       },
                }
        }
 }
@@ -4501,12 +4700,24 @@ pub extern "C" fn ErrorAction_ignore_and_log(a: crate::lightning::util::logger::
        ErrorAction::IgnoreAndLog(a, )
 }
 #[no_mangle]
+/// Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
+pub extern "C" fn ErrorAction_ignore_duplicate_gossip() -> ErrorAction {
+       ErrorAction::IgnoreDuplicateGossip}
+#[no_mangle]
 /// Utility method to constructs a new SendErrorMessage-variant ErrorAction
 pub extern "C" fn ErrorAction_send_error_message(msg: crate::lightning::ln::msgs::ErrorMessage) -> ErrorAction {
        ErrorAction::SendErrorMessage {
                msg,
        }
 }
+#[no_mangle]
+/// Utility method to constructs a new SendWarningMessage-variant ErrorAction
+pub extern "C" fn ErrorAction_send_warning_message(msg: crate::lightning::ln::msgs::WarningMessage, log_level: crate::lightning::util::logger::Level) -> ErrorAction {
+       ErrorAction::SendWarningMessage {
+               msg,
+               log_level,
+       }
+}
 
 use lightning::ln::msgs::LightningError as nativeLightningErrorImport;
 pub(crate) type nativeLightningError = nativeLightningErrorImport;
@@ -4554,7 +4765,7 @@ impl LightningError {
        pub(crate) fn take_inner(mut self) -> *mut nativeLightningError {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -4592,7 +4803,7 @@ pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::Str, mut actio
 impl Clone for LightningError {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeLightningError>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeLightningError>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -4656,7 +4867,7 @@ impl CommitmentUpdate {
        pub(crate) fn take_inner(mut self) -> *mut nativeCommitmentUpdate {
                assert!(self.is_owned);
                let ret = ObjOps::untweak_ptr(self.inner);
-               self.inner = std::ptr::null_mut();
+               self.inner = core::ptr::null_mut();
                ret
        }
 }
@@ -4718,7 +4929,7 @@ pub extern "C" fn CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr: &mu
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_get_update_fee(this_ptr: &CommitmentUpdate) -> crate::lightning::ln::msgs::UpdateFee {
        let mut inner_val = &mut this_ptr.get_native_mut_ref().update_fee;
-       let mut local_inner_val = crate::lightning::ln::msgs::UpdateFee { inner: unsafe { (if inner_val.is_none() { std::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::msgs::UpdateFee<>) as *mut _ }, is_owned: false };
+       let mut local_inner_val = crate::lightning::ln::msgs::UpdateFee { inner: unsafe { (if inner_val.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::msgs::UpdateFee<>) as *mut _ }, is_owned: false };
        local_inner_val
 }
 /// An update_fee message which should be sent
@@ -4761,7 +4972,7 @@ pub extern "C" fn CommitmentUpdate_new(mut update_add_htlcs_arg: crate::c_types:
 impl Clone for CommitmentUpdate {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeCommitmentUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeCommitmentUpdate>::is_null(self.inner) { core::ptr::null_mut() } else {
                                ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
                        is_owned: true,
                }
@@ -4939,7 +5150,7 @@ impl rustChannelMessageHandler for ChannelMessageHandler {
 
 // We're essentially a pointer already, or at least a set of pointers, so allow us to be used
 // directly as a Deref trait in higher-level structs:
-impl std::ops::Deref for ChannelMessageHandler {
+impl core::ops::Deref for ChannelMessageHandler {
        type Target = Self;
        fn deref(&self) -> &Self {
                self
@@ -5104,7 +5315,7 @@ impl rustRoutingMessageHandler for RoutingMessageHandler {
 
 // We're essentially a pointer already, or at least a set of pointers, so allow us to be used
 // directly as a Deref trait in higher-level structs:
-impl std::ops::Deref for RoutingMessageHandler {
+impl core::ops::Deref for RoutingMessageHandler {
        type Target = Self;
        fn deref(&self) -> &Self {
                self
@@ -5122,11 +5333,13 @@ impl Drop for RoutingMessageHandler {
 }
 mod fuzzy_internal_msgs {
 
-use std::str::FromStr;
-use std::ffi::c_void;
+use alloc::str::FromStr;
+use core::ffi::c_void;
 use core::convert::Infallible;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
+#[cfg(feature="no-std")]
+use alloc::{vec::Vec, boxed::Box};
 
 }
 #[no_mangle]
@@ -5141,7 +5354,7 @@ pub(crate) extern "C" fn AcceptChannel_write_void(obj: *const c_void) -> crate::
 #[no_mangle]
 /// Read a AcceptChannel from a byte array, created by AcceptChannel_write
 pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AcceptChannelDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::AcceptChannel, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::AcceptChannel { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5157,7 +5370,7 @@ pub(crate) extern "C" fn AnnouncementSignatures_write_void(obj: *const c_void) -
 #[no_mangle]
 /// Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
 pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AnnouncementSignaturesDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::AnnouncementSignatures, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::AnnouncementSignatures { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5173,7 +5386,7 @@ pub(crate) extern "C" fn ChannelReestablish_write_void(obj: *const c_void) -> cr
 #[no_mangle]
 /// Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
 pub extern "C" fn ChannelReestablish_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelReestablishDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ChannelReestablish, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ChannelReestablish { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5189,7 +5402,7 @@ pub(crate) extern "C" fn ClosingSigned_write_void(obj: *const c_void) -> crate::
 #[no_mangle]
 /// Read a ClosingSigned from a byte array, created by ClosingSigned_write
 pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ClosingSignedDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ClosingSigned, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ClosingSigned { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5205,7 +5418,7 @@ pub(crate) extern "C" fn ClosingSignedFeeRange_write_void(obj: *const c_void) ->
 #[no_mangle]
 /// Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
 pub extern "C" fn ClosingSignedFeeRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ClosingSignedFeeRangeDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ClosingSignedFeeRange, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ClosingSignedFeeRange { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5221,7 +5434,7 @@ pub(crate) extern "C" fn CommitmentSigned_write_void(obj: *const c_void) -> crat
 #[no_mangle]
 /// Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
 pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CommitmentSignedDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::CommitmentSigned, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::CommitmentSigned { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5237,7 +5450,7 @@ pub(crate) extern "C" fn FundingCreated_write_void(obj: *const c_void) -> crate:
 #[no_mangle]
 /// Read a FundingCreated from a byte array, created by FundingCreated_write
 pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingCreatedDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::FundingCreated, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::FundingCreated { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5253,7 +5466,7 @@ pub(crate) extern "C" fn FundingSigned_write_void(obj: *const c_void) -> crate::
 #[no_mangle]
 /// Read a FundingSigned from a byte array, created by FundingSigned_write
 pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingSignedDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::FundingSigned, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::FundingSigned { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5269,7 +5482,7 @@ pub(crate) extern "C" fn FundingLocked_write_void(obj: *const c_void) -> crate::
 #[no_mangle]
 /// Read a FundingLocked from a byte array, created by FundingLocked_write
 pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingLockedDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::FundingLocked, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::FundingLocked { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5285,7 +5498,7 @@ pub(crate) extern "C" fn Init_write_void(obj: *const c_void) -> crate::c_types::
 #[no_mangle]
 /// Read a Init from a byte array, created by Init_write
 pub extern "C" fn Init_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::Init, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::Init { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5301,7 +5514,7 @@ pub(crate) extern "C" fn OpenChannel_write_void(obj: *const c_void) -> crate::c_
 #[no_mangle]
 /// Read a OpenChannel from a byte array, created by OpenChannel_write
 pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OpenChannelDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::OpenChannel, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::OpenChannel { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5317,7 +5530,7 @@ pub(crate) extern "C" fn RevokeAndACK_write_void(obj: *const c_void) -> crate::c
 #[no_mangle]
 /// Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
 pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RevokeAndACKDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::RevokeAndACK, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::RevokeAndACK { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5333,7 +5546,7 @@ pub(crate) extern "C" fn Shutdown_write_void(obj: *const c_void) -> crate::c_typ
 #[no_mangle]
 /// Read a Shutdown from a byte array, created by Shutdown_write
 pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ShutdownDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::Shutdown, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::Shutdown { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5349,7 +5562,7 @@ pub(crate) extern "C" fn UpdateFailHTLC_write_void(obj: *const c_void) -> crate:
 #[no_mangle]
 /// Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
 pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailHTLCDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UpdateFailHTLC, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UpdateFailHTLC { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5365,7 +5578,7 @@ pub(crate) extern "C" fn UpdateFailMalformedHTLC_write_void(obj: *const c_void)
 #[no_mangle]
 /// Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
 pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailMalformedHTLCDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UpdateFailMalformedHTLC, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UpdateFailMalformedHTLC { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5381,7 +5594,7 @@ pub(crate) extern "C" fn UpdateFee_write_void(obj: *const c_void) -> crate::c_ty
 #[no_mangle]
 /// Read a UpdateFee from a byte array, created by UpdateFee_write
 pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFeeDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UpdateFee, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UpdateFee { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5397,7 +5610,7 @@ pub(crate) extern "C" fn UpdateFulfillHTLC_write_void(obj: *const c_void) -> cra
 #[no_mangle]
 /// Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
 pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFulfillHTLCDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UpdateFulfillHTLC, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UpdateFulfillHTLC { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5413,7 +5626,7 @@ pub(crate) extern "C" fn UpdateAddHTLC_write_void(obj: *const c_void) -> crate::
 #[no_mangle]
 /// Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
 pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateAddHTLCDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UpdateAddHTLC, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UpdateAddHTLC { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5429,7 +5642,7 @@ pub(crate) extern "C" fn Ping_write_void(obj: *const c_void) -> crate::c_types::
 #[no_mangle]
 /// Read a Ping from a byte array, created by Ping_write
 pub extern "C" fn Ping_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_PingDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::Ping, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::Ping { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5445,7 +5658,7 @@ pub(crate) extern "C" fn Pong_write_void(obj: *const c_void) -> crate::c_types::
 #[no_mangle]
 /// Read a Pong from a byte array, created by Pong_write
 pub extern "C" fn Pong_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_PongDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::Pong, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::Pong { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5461,7 +5674,7 @@ pub(crate) extern "C" fn UnsignedChannelAnnouncement_write_void(obj: *const c_vo
 #[no_mangle]
 /// Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
 pub extern "C" fn UnsignedChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedChannelAnnouncementDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UnsignedChannelAnnouncement, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UnsignedChannelAnnouncement { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5477,7 +5690,7 @@ pub(crate) extern "C" fn ChannelAnnouncement_write_void(obj: *const c_void) -> c
 #[no_mangle]
 /// Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
 pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelAnnouncementDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ChannelAnnouncement, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ChannelAnnouncement { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5493,7 +5706,7 @@ pub(crate) extern "C" fn UnsignedChannelUpdate_write_void(obj: *const c_void) ->
 #[no_mangle]
 /// Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
 pub extern "C" fn UnsignedChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedChannelUpdateDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UnsignedChannelUpdate, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UnsignedChannelUpdate { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5509,7 +5722,7 @@ pub(crate) extern "C" fn ChannelUpdate_write_void(obj: *const c_void) -> crate::
 #[no_mangle]
 /// Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
 pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelUpdateDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ChannelUpdate, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ChannelUpdate { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5525,11 +5738,27 @@ pub(crate) extern "C" fn ErrorMessage_write_void(obj: *const c_void) -> crate::c
 #[no_mangle]
 /// Read a ErrorMessage from a byte array, created by ErrorMessage_write
 pub extern "C" fn ErrorMessage_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ErrorMessageDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ErrorMessage, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ErrorMessage { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
 #[no_mangle]
+/// Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
+pub extern "C" fn WarningMessage_write(obj: &WarningMessage) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
+}
+#[no_mangle]
+pub(crate) extern "C" fn WarningMessage_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeWarningMessage) })
+}
+#[no_mangle]
+/// Read a WarningMessage from a byte array, created by WarningMessage_write
+pub extern "C" fn WarningMessage_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_WarningMessageDecodeErrorZ {
+       let res: Result<lightning::ln::msgs::WarningMessage, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::WarningMessage { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
 /// Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
 pub extern "C" fn UnsignedNodeAnnouncement_write(obj: &UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
        crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
@@ -5541,7 +5770,7 @@ pub(crate) extern "C" fn UnsignedNodeAnnouncement_write_void(obj: *const c_void)
 #[no_mangle]
 /// Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
 pub extern "C" fn UnsignedNodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedNodeAnnouncementDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::UnsignedNodeAnnouncement, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::UnsignedNodeAnnouncement { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5557,14 +5786,14 @@ pub(crate) extern "C" fn NodeAnnouncement_write_void(obj: *const c_void) -> crat
 #[no_mangle]
 /// Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
 pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeAnnouncementDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::NodeAnnouncement, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::NodeAnnouncement { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
 #[no_mangle]
 /// Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
 pub extern "C" fn QueryShortChannelIds_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryShortChannelIdsDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::QueryShortChannelIds, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::QueryShortChannelIds { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5589,7 +5818,7 @@ pub(crate) extern "C" fn ReplyShortChannelIdsEnd_write_void(obj: *const c_void)
 #[no_mangle]
 /// Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
 pub extern "C" fn ReplyShortChannelIdsEnd_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ReplyShortChannelIdsEndDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ReplyShortChannelIdsEnd, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ReplyShortChannelIdsEnd { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5613,14 +5842,14 @@ pub(crate) extern "C" fn QueryChannelRange_write_void(obj: *const c_void) -> cra
 #[no_mangle]
 /// Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
 pub extern "C" fn QueryChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryChannelRangeDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::QueryChannelRange, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::QueryChannelRange { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
 #[no_mangle]
 /// Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
 pub extern "C" fn ReplyChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ReplyChannelRangeDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::ReplyChannelRange, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::ReplyChannelRange { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }
@@ -5645,7 +5874,7 @@ pub(crate) extern "C" fn GossipTimestampFilter_write_void(obj: *const c_void) ->
 #[no_mangle]
 /// Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
 pub extern "C" fn GossipTimestampFilter_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_GossipTimestampFilterDecodeErrorZ {
-       let res = crate::c_types::deserialize_obj(ser);
+       let res: Result<lightning::ln::msgs::GossipTimestampFilter, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
        let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::GossipTimestampFilter { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: ObjOps::heap_alloc(e), is_owned: true } }).into() };
        local_res
 }