Add auto-generated bindings of `lightning_transaction_sync`
[ldk-c-bindings] / c-bindings-gen / src / types.rs
index bd04ba2b8c590889b2b5c4f74b5ffa32f2637cb6..877331e88a6e2eb04133a97fafd6d0c466d59ed0 100644 (file)
@@ -656,7 +656,7 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
                        }
                }
 
-               if p.leading_colon.is_some() {
+               let result = if p.leading_colon.is_some() {
                        let mut res: String = p.segments.iter().enumerate().map(|(idx, seg)| {
                                format!("{}{}", if idx == 0 { "" } else { "::" }, seg.ident)
                        }).collect();
@@ -667,11 +667,10 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
                        Some(res)
                } else if let Some(id) = p.get_ident() {
                        self.maybe_resolve_ident(id)
+               } else if p.segments.len() == 1 {
+                       let seg = p.segments.iter().next().unwrap();
+                       self.maybe_resolve_ident(&seg.ident)
                } else {
-                       if p.segments.len() == 1 {
-                               let seg = p.segments.iter().next().unwrap();
-                               return self.maybe_resolve_ident(&seg.ident);
-                       }
                        let mut seg_iter = p.segments.iter();
                        let first_seg = seg_iter.next().unwrap();
                        let remaining: String = seg_iter.map(|seg| {
@@ -693,6 +692,13 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
                        } else if self.library.modules.get(&format!("{}::{}", self.module_path, first_seg.ident)).is_some() {
                                Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining))
                        } else { None }
+               };
+               // We're only set up to handle `Vec` imported via the prelude, but its often imported
+               // via the alloc stdlib crate, so map it here.
+               if result.as_ref().map(|s| s.as_str()) == Some("alloc::vec::Vec") {
+                       Some("Vec".to_string())
+               } else {
+                       result
                }
        }
 
@@ -861,6 +867,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());
@@ -869,6 +876,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());
@@ -1037,6 +1045,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"),
@@ -1068,8 +1077,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"),
@@ -1109,21 +1120,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"),
@@ -1145,6 +1156,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(""),
@@ -1177,9 +1189,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(""),
@@ -1224,21 +1239,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("),
@@ -1259,6 +1274,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"),
@@ -1291,8 +1307,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()"),
@@ -1328,19 +1346,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):
@@ -1373,12 +1392,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: "),
 
@@ -1408,8 +1429,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(&"),
@@ -1446,21 +1469,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("),
@@ -1477,12 +1500,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(" }"),
 
@@ -1512,8 +1537,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(")"),
@@ -1546,21 +1573,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("))"),