From 2667dd4c73ff54f66b07174e6af509fd6fa1a477 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 16 Oct 2021 22:16:27 +0000 Subject: [PATCH] Handle bitcoin::Transaction aliases instead of the full path --- c-bindings-gen/src/types.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index f87e2a0..7f53019 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -902,7 +902,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { "bitcoin::blockdata::script::Script" if is_ref => Some("crate::c_types::u8slice"), "bitcoin::blockdata::script::Script" if !is_ref => Some("crate::c_types::derived::CVec_u8Z"), "bitcoin::blockdata::transaction::OutPoint" => Some("crate::lightning::chain::transaction::OutPoint"), - "bitcoin::blockdata::transaction::Transaction" => Some("crate::c_types::Transaction"), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" => Some("crate::c_types::Transaction"), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some("crate::c_types::TxOut"), "bitcoin::network::constants::Network" => Some("crate::bitcoin::network::Network"), "bitcoin::blockdata::block::BlockHeader" if is_ref => Some("*const [u8; 80]"), @@ -985,8 +985,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if !is_ref => Some(""), "bitcoin::blockdata::script::Script" if is_ref => Some("&::bitcoin::blockdata::script::Script::from(Vec::from("), "bitcoin::blockdata::script::Script" if !is_ref => Some("::bitcoin::blockdata::script::Script::from("), - "bitcoin::blockdata::transaction::Transaction" if is_ref => Some("&"), - "bitcoin::blockdata::transaction::Transaction" => Some(""), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" if is_ref => Some("&"), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" => Some(""), "bitcoin::blockdata::transaction::OutPoint" => Some("crate::c_types::C_to_bitcoin_outpoint("), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(""), "bitcoin::network::constants::Network" => Some(""), @@ -1062,7 +1062,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if is_ref => Some("}[..]).unwrap()"), "bitcoin::blockdata::script::Script" if is_ref => Some(".to_slice()))"), "bitcoin::blockdata::script::Script" if !is_ref => Some(".into_rust())"), - "bitcoin::blockdata::transaction::Transaction" => Some(".into_bitcoin()"), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" => Some(".into_bitcoin()"), "bitcoin::blockdata::transaction::OutPoint" => Some(")"), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(".into_rust()"), "bitcoin::network::constants::Network" => Some(".into_bitcoin()"), @@ -1153,8 +1153,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if !is_ref => Some("crate::c_types::Secp256k1Error::from_rust("), "bitcoin::blockdata::script::Script" if is_ref => Some("crate::c_types::u8slice::from_slice(&"), "bitcoin::blockdata::script::Script" if !is_ref => Some(""), - "bitcoin::blockdata::transaction::Transaction" if is_ref => Some("crate::c_types::Transaction::from_bitcoin("), - "bitcoin::blockdata::transaction::Transaction" => Some("crate::c_types::Transaction::from_bitcoin(&"), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" if is_ref => Some("crate::c_types::Transaction::from_bitcoin("), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" => Some("crate::c_types::Transaction::from_bitcoin(&"), "bitcoin::blockdata::transaction::OutPoint" => Some("crate::c_types::bitcoin_to_C_outpoint("), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some("crate::c_types::TxOut::from_rust("), "bitcoin::network::constants::Network" => Some("crate::bitcoin::network::Network::from_bitcoin("), @@ -1227,7 +1227,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> { if !is_ref => Some(")"), "bitcoin::blockdata::script::Script" if is_ref => Some("[..])"), "bitcoin::blockdata::script::Script" if !is_ref => Some(".into_bytes().into()"), - "bitcoin::blockdata::transaction::Transaction" => Some(")"), + "bitcoin::blockdata::transaction::Transaction"|"bitcoin::Transaction" => Some(")"), "bitcoin::blockdata::transaction::OutPoint" => Some(")"), "bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(")"), "bitcoin::network::constants::Network" => Some(")"), -- 2.39.5