fn initial_clonable_types() -> HashSet<String> {
let mut res = HashSet::new();
res.insert("crate::c_types::u5".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());
+ res.insert("crate::c_types::TwentyBytes".to_owned());
res.insert("crate::c_types::ThirtyTwoBytes".to_owned());
res.insert("crate::c_types::SecretKey".to_owned());
res.insert("crate::c_types::PublicKey".to_owned());
res.insert("crate::c_types::TxOut".to_owned());
res.insert("crate::c_types::Signature".to_owned());
res.insert("crate::c_types::RecoverableSignature".to_owned());
+ res.insert("crate::c_types::Bech32Error".to_owned());
res.insert("crate::c_types::Secp256k1Error".to_owned());
res.insert("crate::c_types::IOError".to_owned());
+ res.insert("crate::c_types::Error".to_owned());
+ res.insert("crate::c_types::Str".to_owned());
+
+ // Because some types are manually-mapped to CVec_u8Z we may end up checking if its clonable
+ // before we ever get to constructing the type fully via
+ // `write_c_mangled_container_path_intern` (which will add it here too), so we have to manually
+ // add it on startup.
+ res.insert("crate::c_types::derived::CVec_u8Z".to_owned());
res
}
"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::util::address::WitnessVersion" => Some("crate::c_types::WitnessVersion"),
"bitcoin::blockdata::block::BlockHeader" if is_ref => Some("*const [u8; 80]"),
"bitcoin::blockdata::block::Block" if is_ref => Some("crate::c_types::u8slice"),
"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(""),
+ "bitcoin::util::address::WitnessVersion" => Some(""),
"bitcoin::blockdata::block::BlockHeader" => Some("&::bitcoin::consensus::encode::deserialize(unsafe { &*"),
"bitcoin::blockdata::block::Block" if is_ref => Some("&::bitcoin::consensus::encode::deserialize("),
"bitcoin::blockdata::transaction::OutPoint" => Some(")"),
"bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(".into_rust()"),
"bitcoin::network::constants::Network" => Some(".into_bitcoin()"),
+ "bitcoin::util::address::WitnessVersion" => Some(".into()"),
"bitcoin::blockdata::block::BlockHeader" => Some(" }).unwrap()"),
"bitcoin::blockdata::block::Block" => Some(".to_slice()).unwrap()"),
"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("),
+ "bitcoin::util::address::WitnessVersion" => Some(""),
"bitcoin::blockdata::block::BlockHeader" if is_ref => Some("&local_"),
"bitcoin::blockdata::block::Block" if is_ref => Some("crate::c_types::u8slice::from_slice(&local_"),
"bitcoin::blockdata::transaction::OutPoint" => Some(")"),
"bitcoin::blockdata::transaction::TxOut" if !is_ref => Some(")"),
"bitcoin::network::constants::Network" => Some(")"),
+ "bitcoin::util::address::WitnessVersion" => Some(".into()"),
"bitcoin::blockdata::block::BlockHeader" if is_ref => Some(""),
"bitcoin::blockdata::block::Block" if is_ref => Some(")"),