Update C/C++ demo to latest LDK API
[ldk-c-bindings] / c-bindings-gen / src / types.rs
index 0c4c1d88694e3c5637cd60efb108ef9806894b1c..0da41e60ec5a8c148ee873da61c00eab5ff81c80 100644 (file)
@@ -223,6 +223,15 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> {
                                                        if let Some(path) = types.maybe_resolve_path(&trait_bound.path, None) {
                                                                if types.skip_path(&path) { continue; }
                                                                if path == "Sized" { continue; }
+                                                               if path == "core::fmt::Debug" {
+                                                                       // #[derive(Debug)] will add Debug bounds on each genericin the
+                                                                       // auto-generated impl. In cases where the existing generic
+                                                                       // bound already requires Debug this is redundant and should be
+                                                                       // ignored (which we do here). However, in cases where this is
+                                                                       // not redundant, this may cause spurious Debug impls which may
+                                                                       // fail to compile.
+                                                                       continue;
+                                                               }
                                                                if non_lifetimes_processed { return false; }
                                                                non_lifetimes_processed = true;
                                                                if path != "std::ops::Deref" && path != "core::ops::Deref" &&
@@ -852,6 +861,7 @@ fn initial_clonable_types() -> HashSet<String> {
        let mut res = HashSet::new();
        res.insert("crate::c_types::U5".to_owned());
        res.insert("crate::c_types::U128".to_owned());
+       res.insert("crate::c_types::ThreeBytes".to_owned());
        res.insert("crate::c_types::FourBytes".to_owned());
        res.insert("crate::c_types::TwelveBytes".to_owned());
        res.insert("crate::c_types::SixteenBytes".to_owned());
@@ -860,6 +870,7 @@ fn initial_clonable_types() -> HashSet<String> {
        res.insert("crate::c_types::EightU16s".to_owned());
        res.insert("crate::c_types::SecretKey".to_owned());
        res.insert("crate::c_types::PublicKey".to_owned());
+       res.insert("crate::c_types::TweakedPublicKey".to_owned());
        res.insert("crate::c_types::Transaction".to_owned());
        res.insert("crate::c_types::Witness".to_owned());
        res.insert("crate::c_types::WitnessVersion".to_owned());
@@ -1028,6 +1039,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        // Note that no !is_ref types can map to an array because Rust and C's call semantics
                        // for arrays are different (https://github.com/eqrion/cbindgen/issues/528)
 
+                       "[u8; 33]" if !is_ref => Some("crate::c_types::ThirtyThreeBytes"),
                        "[u8; 32]" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes"),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes"),
@@ -1059,8 +1071,10 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::bech32::u5"|"bech32::u5" => Some("crate::c_types::U5"),
                        "u128" => Some("crate::c_types::U128"),
                        "core::num::NonZeroU8" => Some("u8"),
+                       "core::num::NonZeroU64" => Some("u64"),
 
                        "secp256k1::PublicKey"|"bitcoin::secp256k1::PublicKey" => Some("crate::c_types::PublicKey"),
+                       "bitcoin::key::TweakedPublicKey" => Some("crate::c_types::TweakedPublicKey"),
                        "bitcoin::secp256k1::ecdsa::Signature" => Some("crate::c_types::ECDSASignature"),
                        "bitcoin::secp256k1::schnorr::Signature" => Some("crate::c_types::SchnorrSignature"),
                        "bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some("crate::c_types::RecoverableSignature"),
@@ -1100,21 +1114,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                if is_ref => Some("*const [u8; 32]"),
 
                        // Newtypes that we just expose in their original form.
-                       "bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
                                if is_ref  => Some("*const [u8; 32]"),
-                       "bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"|"bitcoin::hashes::sha256::Hash"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "bitcoin::secp256k1::Message" if is_ref => Some("*const [u8; 32]"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if is_ref => Some("*const [u8; 32]"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
 
                        "lightning::io::Read" => Some("crate::c_types::u8slice"),
@@ -1136,6 +1150,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "Option" if is_ref => Some("&local_"),
                        "Option" => Some("local_"),
 
+                       "[u8; 33]" if !is_ref => Some(""),
                        "[u8; 32]" if is_ref => Some("unsafe { &*"),
                        "[u8; 32]" if !is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(""),
@@ -1168,9 +1183,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::bech32::u5"|"bech32::u5" => Some(""),
                        "u128" => Some(""),
                        "core::num::NonZeroU8" => Some("core::num::NonZeroU8::new("),
+                       "core::num::NonZeroU64" => Some("core::num::NonZeroU64::new("),
 
                        "bitcoin::secp256k1::PublicKey"|"secp256k1::PublicKey" if is_ref => Some("&"),
                        "bitcoin::secp256k1::PublicKey"|"secp256k1::PublicKey" => Some(""),
+                       "bitcoin::key::TweakedPublicKey" if is_ref => Some("&"),
+                       "bitcoin::key::TweakedPublicKey" => Some(""),
                        "bitcoin::secp256k1::ecdsa::Signature"|"bitcoin::secp256k1::schnorr::Signature" if is_ref => Some("&"),
                        "bitcoin::secp256k1::ecdsa::Signature"|"bitcoin::secp256k1::schnorr::Signature" => Some(""),
                        "bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some(""),
@@ -1215,21 +1233,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                Some("&bitcoin::hash_types::WScriptHash::from_raw_hash(bitcoin::hashes::Hash::from_byte_array(unsafe { *"),
 
                        // Newtypes that we just expose in their original form.
-                       "bitcoin::hash_types::Txid" if is_ref => Some("&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*"),
-                       "bitcoin::hash_types::Txid" if !is_ref => Some("::bitcoin::hash_types::Txid::from_slice(&"),
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid" if is_ref => Some("&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*"),
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid" if !is_ref => Some("::bitcoin::hash_types::Txid::from_slice(&"),
                        "bitcoin::hash_types::BlockHash"|"bitcoin::BlockHash" => Some("::bitcoin::hash_types::BlockHash::from_slice(&"),
                        "bitcoin::blockdata::constants::ChainHash" => Some("::bitcoin::blockdata::constants::ChainHash::from(&"),
-                       "lightning::ln::PaymentHash" if !is_ref => Some("::lightning::ln::PaymentHash("),
-                       "lightning::ln::PaymentHash" if is_ref => Some("&::lightning::ln::PaymentHash(unsafe { *"),
-                       "lightning::ln::PaymentPreimage" if !is_ref => Some("::lightning::ln::PaymentPreimage("),
-                       "lightning::ln::PaymentPreimage" if is_ref => Some("&::lightning::ln::PaymentPreimage(unsafe { *"),
-                       "lightning::ln::PaymentSecret" if !is_ref => Some("::lightning::ln::PaymentSecret("),
+                       "bitcoin::hashes::sha256::Hash" if is_ref => Some("&::bitcoin::hashes::sha256::Hash::from_slice(&unsafe { &*"),
+                       "bitcoin::hashes::sha256::Hash" => Some("::bitcoin::hashes::sha256::Hash::from_slice(&"),
+                       "lightning::ln::types::PaymentHash" if !is_ref => Some("::lightning::ln::types::PaymentHash("),
+                       "lightning::ln::types::PaymentHash" if is_ref => Some("&::lightning::ln::types::PaymentHash(unsafe { *"),
+                       "lightning::ln::types::PaymentPreimage" if !is_ref => Some("::lightning::ln::types::PaymentPreimage("),
+                       "lightning::ln::types::PaymentPreimage" if is_ref => Some("&::lightning::ln::types::PaymentPreimage(unsafe { *"),
+                       "lightning::ln::types::PaymentSecret" if !is_ref => Some("::lightning::ln::types::PaymentSecret("),
                        "lightning::ln::channelmanager::PaymentId" if !is_ref => Some("::lightning::ln::channelmanager::PaymentId("),
                        "lightning::ln::channelmanager::PaymentId" if is_ref=> Some("&::lightning::ln::channelmanager::PaymentId( unsafe { *"),
                        "lightning::ln::channelmanager::InterceptId" if !is_ref => Some("::lightning::ln::channelmanager::InterceptId("),
                        "lightning::ln::channelmanager::InterceptId" if is_ref=> Some("&::lightning::ln::channelmanager::InterceptId( unsafe { *"),
-                       "lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId" if !is_ref => Some("::lightning::ln::ChannelId("),
-                       "lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId" if is_ref => Some("&::lightning::ln::ChannelId(unsafe { *"),
                        "lightning::sign::KeyMaterial" if !is_ref => Some("::lightning::sign::KeyMaterial("),
                        "lightning::sign::KeyMaterial" if is_ref=> Some("&::lightning::sign::KeyMaterial( unsafe { *"),
                        "lightning::chain::ClaimId" if !is_ref => Some("::lightning::chain::ClaimId("),
@@ -1250,6 +1268,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "Option" => Some(""),
                        "Result" if !is_ref => Some(""),
 
+                       "[u8; 33]" if !is_ref => Some(".data"),
                        "[u8; 32]" if is_ref => Some("}"),
                        "[u8; 32]" if !is_ref => Some(".data"),
                        "[u8; 20]" if !is_ref => Some(".data"),
@@ -1282,8 +1301,10 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::bech32::u5"|"bech32::u5" => Some(".into()"),
                        "u128" => Some(".into()"),
                        "core::num::NonZeroU8" => Some(").expect(\"Value must be non-zero\")"),
+                       "core::num::NonZeroU64" => Some(").expect(\"Value must be non-zero\")"),
 
                        "bitcoin::secp256k1::PublicKey"|"secp256k1::PublicKey" => Some(".into_rust()"),
+                       "bitcoin::key::TweakedPublicKey" => Some(".into_rust()"),
                        "bitcoin::secp256k1::ecdsa::Signature"|"bitcoin::secp256k1::schnorr::Signature" => Some(".into_rust()"),
                        "bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some(".into_rust()"),
                        "bitcoin::secp256k1::SecretKey" if !is_ref => Some(".into_rust()"),
@@ -1319,19 +1340,20 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                if is_ref => Some(" }.clone()))"),
 
                        // Newtypes that we just expose in their original form.
-                       "bitcoin::hash_types::Txid" if is_ref => Some(" }[..]).unwrap()"),
-                       "bitcoin::hash_types::Txid" => Some(".data[..]).unwrap()"),
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid" if is_ref => Some(" }[..]).unwrap()"),
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid" => Some(".data[..]).unwrap()"),
                        "bitcoin::hash_types::BlockHash"|"bitcoin::BlockHash" if !is_ref => Some(".data[..]).unwrap()"),
                        "bitcoin::blockdata::constants::ChainHash" if !is_ref => Some(".data)"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "bitcoin::hashes::sha256::Hash" => Some(" }[..]).unwrap()"),
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if !is_ref => Some(".data)"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if is_ref => Some(" })"),
 
                        // List of traits we map (possibly during processing of other files):
@@ -1364,12 +1386,14 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "Vec" if !is_ref => Some("local_"),
                        "Option" => Some("local_"),
 
+                       "[u8; 33]" if is_ref => Some(""),
                        "[u8; 32]" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some("crate::c_types::TwentyBytes { data: "),
                        "[u8; 16]" if !is_ref => Some("crate::c_types::SixteenBytes { data: "),
                        "[u8; 12]" if !is_ref => Some("crate::c_types::TwelveBytes { data: "),
                        "[u8; 4]" if !is_ref => Some("crate::c_types::FourBytes { data: "),
+                       "[u8; 3]" if !is_ref => Some("crate::c_types::ThreeBytes { data: "),
                        "[u8; 3]" if is_ref => Some(""),
                        "[u16; 32]" if !is_ref => Some("crate::c_types::ThirtyTwoU16s { data: "),
 
@@ -1399,8 +1423,10 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "bitcoin::bech32::u5"|"bech32::u5" => Some(""),
                        "u128" => Some(""),
+                       "core::num::NonZeroU64" => Some(""),
 
                        "bitcoin::secp256k1::PublicKey"|"secp256k1::PublicKey" => Some("crate::c_types::PublicKey::from_rust(&"),
+                       "bitcoin::key::TweakedPublicKey" => Some("crate::c_types::TweakedPublicKey::from_rust(&"),
                        "bitcoin::secp256k1::ecdsa::Signature" => Some("crate::c_types::ECDSASignature::from_rust(&"),
                        "bitcoin::secp256k1::schnorr::Signature" => Some("crate::c_types::SchnorrSignature::from_rust(&"),
                        "bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some("crate::c_types::RecoverableSignature::from_rust(&"),
@@ -1437,21 +1463,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                if !is_ref => Some("crate::c_types::TwentyBytes { data: *"),
 
                        // Newtypes that we just expose in their original form.
-                       "bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"|"bitcoin::hashes::sha256::Hash"
                                if is_ref => Some(""),
-                       "bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"|"bitcoin::hashes::sha256::Hash"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: *"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
                        "bitcoin::secp256k1::Message" if is_ref => Some(""),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if is_ref => Some("&"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
 
                        "lightning::io::Read" => Some("crate::c_types::u8slice::from_vec(&crate::c_types::reader_to_vec("),
@@ -1468,12 +1494,14 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "Vec" if !is_ref => Some(".into()"),
                        "Option" => Some(""),
 
+                       "[u8; 33]" if is_ref => Some(""),
                        "[u8; 32]" if !is_ref => Some(" }"),
                        "[u8; 32]" if is_ref => Some(""),
                        "[u8; 20]" if !is_ref => Some(" }"),
                        "[u8; 16]" if !is_ref => Some(" }"),
                        "[u8; 12]" if !is_ref => Some(" }"),
                        "[u8; 4]" if !is_ref => Some(" }"),
+                       "[u8; 3]" if !is_ref => Some(" }"),
                        "[u8; 3]" if is_ref => Some(""),
                        "[u16; 32]" if !is_ref => Some(" }"),
 
@@ -1503,8 +1531,10 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
                        "bitcoin::bech32::u5"|"bech32::u5" => Some(".into()"),
                        "u128" => Some(".into()"),
+                       "core::num::NonZeroU64" => Some(".into()"),
 
                        "bitcoin::secp256k1::PublicKey"|"secp256k1::PublicKey" => Some(")"),
+                       "bitcoin::key::TweakedPublicKey" => Some(")"),
                        "bitcoin::secp256k1::ecdsa::Signature"|"bitcoin::secp256k1::schnorr::Signature" => Some(")"),
                        "bitcoin::secp256k1::ecdsa::RecoverableSignature" => Some(")"),
                        "bitcoin::secp256k1::SecretKey" if !is_ref => Some(")"),
@@ -1537,21 +1567,21 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                if !is_ref => Some(".as_ref() }"),
 
                        // Newtypes that we just expose in their original form.
-                       "bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"|"bitcoin::hashes::sha256::Hash"
                                if is_ref => Some(".as_ref()"),
-                       "bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"
+                       "bitcoin::Txid"|"bitcoin::hash_types::Txid"|"bitcoin::BlockHash"|"bitcoin::hash_types::BlockHash"|"bitcoin::hashes::sha256::Hash"|"bitcoin::blockdata::constants::ChainHash"|"bitcoin::hashes::sha256::Hash"
                                if !is_ref => Some(".as_ref() }"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some(".as_ref().clone() }"),
                        "bitcoin::secp256k1::Message" if is_ref => Some(".as_ref()"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if is_ref => Some(".0"),
-                       "lightning::ln::PaymentHash"|"lightning::ln::PaymentPreimage"|"lightning::ln::PaymentSecret"
+                       "lightning::ln::types::PaymentHash"|"lightning::ln::types::PaymentPreimage"
+                       |"lightning::ln::types::PaymentSecret"
                        |"lightning::ln::channelmanager::PaymentId"|"lightning::ln::channelmanager::InterceptId"
                        |"lightning::sign::KeyMaterial"|"lightning::chain::ClaimId"
-                       |"lightning::ln::ChannelId"|"lightning::ln::channel_id::ChannelId"
                                if !is_ref => Some(".0 }"),
 
                        "lightning::io::Read" => Some("))"),