]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Update module paths for hash wrappers
authorMatt Corallo <git@bluematt.me>
Thu, 29 Apr 2021 15:21:35 +0000 (15:21 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 30 Apr 2021 04:35:57 +0000 (04:35 +0000)
c-bindings-gen/src/types.rs

index a45cf2b16f7abbb55e3b53f898e1bfdfa379bd39..99fafd490a065450dd93fc282e29144e47ccc058 100644 (file)
@@ -841,12 +841,12 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash"
                                if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
-                       "lightning::ln::channelmanager::PaymentHash" if is_ref => Some("*const [u8; 32]"),
-                       "lightning::ln::channelmanager::PaymentHash" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
-                       "lightning::ln::channelmanager::PaymentPreimage" if is_ref => Some("*const [u8; 32]"),
-                       "lightning::ln::channelmanager::PaymentPreimage" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
-                       "lightning::ln::channelmanager::PaymentSecret" if is_ref => Some("crate::c_types::ThirtyTwoBytes"),
-                       "lightning::ln::channelmanager::PaymentSecret" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
+                       "lightning::ln::PaymentHash" if is_ref => Some("*const [u8; 32]"),
+                       "lightning::ln::PaymentHash" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
+                       "lightning::ln::PaymentPreimage" if is_ref => Some("*const [u8; 32]"),
+                       "lightning::ln::PaymentPreimage" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
+                       "lightning::ln::PaymentSecret" if is_ref => Some("crate::c_types::ThirtyTwoBytes"),
+                       "lightning::ln::PaymentSecret" if !is_ref => Some("crate::c_types::ThirtyTwoBytes"),
 
                        // Override the default since Records contain an fmt with a lifetime:
                        "lightning::util::logger::Record" => Some("*const std::os::raw::c_char"),
@@ -912,11 +912,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "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::hash_types::BlockHash" => Some("::bitcoin::hash_types::BlockHash::from_slice(&"),
-                       "lightning::ln::channelmanager::PaymentHash" if !is_ref => Some("::lightning::ln::channelmanager::PaymentHash("),
-                       "lightning::ln::channelmanager::PaymentHash" if is_ref => Some("&::lightning::ln::channelmanager::PaymentHash(unsafe { *"),
-                       "lightning::ln::channelmanager::PaymentPreimage" if !is_ref => Some("::lightning::ln::channelmanager::PaymentPreimage("),
-                       "lightning::ln::channelmanager::PaymentPreimage" if is_ref => Some("&::lightning::ln::channelmanager::PaymentPreimage(unsafe { *"),
-                       "lightning::ln::channelmanager::PaymentSecret" => Some("::lightning::ln::channelmanager::PaymentSecret("),
+                       "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" => Some("::lightning::ln::PaymentSecret("),
 
                        // List of traits we map (possibly during processing of other files):
                        "crate::util::logger::Logger" => Some(""),
@@ -971,11 +971,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid" if is_ref => Some(" }[..]).unwrap()"),
                        "bitcoin::hash_types::Txid" => Some(".data[..]).unwrap()"),
                        "bitcoin::hash_types::BlockHash" if !is_ref => Some(".data[..]).unwrap()"),
-                       "lightning::ln::channelmanager::PaymentHash" if !is_ref => Some(".data)"),
-                       "lightning::ln::channelmanager::PaymentHash" if is_ref => Some(" })"),
-                       "lightning::ln::channelmanager::PaymentPreimage" if !is_ref => Some(".data)"),
-                       "lightning::ln::channelmanager::PaymentPreimage" if is_ref => Some(" })"),
-                       "lightning::ln::channelmanager::PaymentSecret" => Some(".data)"),
+                       "lightning::ln::PaymentHash" if !is_ref => Some(".data)"),
+                       "lightning::ln::PaymentHash" if is_ref => Some(" })"),
+                       "lightning::ln::PaymentPreimage" if !is_ref => Some(".data)"),
+                       "lightning::ln::PaymentPreimage" if is_ref => Some(" })"),
+                       "lightning::ln::PaymentSecret" => Some(".data)"),
 
                        // List of traits we map (possibly during processing of other files):
                        "crate::util::logger::Logger" => Some(""),
@@ -1058,11 +1058,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"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: "),
-                       "lightning::ln::channelmanager::PaymentHash" if is_ref => Some("&"),
-                       "lightning::ln::channelmanager::PaymentHash" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
-                       "lightning::ln::channelmanager::PaymentPreimage" if is_ref => Some("&"),
-                       "lightning::ln::channelmanager::PaymentPreimage" => Some("crate::c_types::ThirtyTwoBytes { data: "),
-                       "lightning::ln::channelmanager::PaymentSecret" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
+                       "lightning::ln::PaymentHash" if is_ref => Some("&"),
+                       "lightning::ln::PaymentHash" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
+                       "lightning::ln::PaymentPreimage" if is_ref => Some("&"),
+                       "lightning::ln::PaymentPreimage" => Some("crate::c_types::ThirtyTwoBytes { data: "),
+                       "lightning::ln::PaymentSecret" if !is_ref => Some("crate::c_types::ThirtyTwoBytes { data: "),
 
                        // Override the default since Records contain an fmt with a lifetime:
                        "lightning::util::logger::Record" => Some("local_"),
@@ -1126,11 +1126,11 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                        "bitcoin::hash_types::Txid"|"bitcoin::hash_types::BlockHash"|"bitcoin_hashes::sha256::Hash"
                                if !is_ref => Some(".into_inner() }"),
                        "bitcoin::secp256k1::Message" if !is_ref => Some(".as_ref().clone() }"),
-                       "lightning::ln::channelmanager::PaymentHash" if is_ref => Some(".0"),
-                       "lightning::ln::channelmanager::PaymentHash" => Some(".0 }"),
-                       "lightning::ln::channelmanager::PaymentPreimage" if is_ref => Some(".0"),
-                       "lightning::ln::channelmanager::PaymentPreimage" => Some(".0 }"),
-                       "lightning::ln::channelmanager::PaymentSecret" if !is_ref => Some(".0 }"),
+                       "lightning::ln::PaymentHash" if is_ref => Some(".0"),
+                       "lightning::ln::PaymentHash" => Some(".0 }"),
+                       "lightning::ln::PaymentPreimage" if is_ref => Some(".0"),
+                       "lightning::ln::PaymentPreimage" => Some(".0 }"),
+                       "lightning::ln::PaymentSecret" if !is_ref => Some(".0 }"),
 
                        // Override the default since Records contain an fmt with a lifetime:
                        "lightning::util::logger::Record" => Some(".as_ptr()"),
@@ -1141,7 +1141,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
 
        fn empty_val_check_suffix_from_path(&self, full_path: &str) -> Option<&str> {
                match full_path {
-                       "lightning::ln::channelmanager::PaymentSecret" => Some(".data == [0; 32]"),
+                       "lightning::ln::PaymentSecret" => Some(".data == [0; 32]"),
                        "secp256k1::key::PublicKey"|"bitcoin::secp256k1::key::PublicKey" => Some(".is_null()"),
                        "bitcoin::secp256k1::Signature" => Some(".is_null()"),
                        _ => None