From dc374bf3d1cd17c8bdf22fcb10b8b8319ddf0158 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sun, 22 Dec 2024 11:07:58 +0530 Subject: [PATCH] add cargo hack to ci and resolve tor feature gate issue --- .github/workflows/lint.yaml | 6 ++ src/bin/directoryd.rs | 12 ++-- src/bin/makerd.rs | 11 +++- src/maker/config.rs | 11 +++- src/maker/server.rs | 122 ++++++++++++++++++++---------------- src/market/directory.rs | 33 +++++++--- src/taker/api.rs | 75 +++++++++++++--------- src/taker/config.rs | 11 +++- src/taker/offers.rs | 3 + src/taker/routines.rs | 2 + src/utill.rs | 3 + tests/abort2_case2.rs | 1 + tests/abort2_case3.rs | 1 + tests/abort3_case1.rs | 1 + tests/abort3_case2.rs | 1 + tests/abort3_case3.rs | 1 + 16 files changed, 190 insertions(+), 104 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 33950ed3..dd04db10 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -34,3 +34,9 @@ jobs: - name: Clippy run: cargo clippy --all-targets --all-features -- -D warnings + + - name: cargo install cargo-hack + uses: taiki-e/install-action@cargo-hack + + - name: cargo hack + run: cargo hack --feature-powerset check \ No newline at end of file diff --git a/src/bin/directoryd.rs b/src/bin/directoryd.rs index 3c8b6224..2ae74364 100644 --- a/src/bin/directoryd.rs +++ b/src/bin/directoryd.rs @@ -1,9 +1,11 @@ use clap::Parser; use coinswap::{ market::directory::{start_directory_server, DirectoryServer, DirectoryServerError}, - tor::setup_mitosis, utill::{setup_directory_logger, ConnectionType}, }; + +#[cfg(feature = "tor")] +use coinswap::tor::setup_mitosis; use std::{path::PathBuf, str::FromStr, sync::Arc}; #[derive(Parser)] @@ -25,10 +27,12 @@ fn main() -> Result<(), DirectoryServerError> { let conn_type = ConnectionType::from_str(&args.network)?; - if conn_type == ConnectionType::TOR { - setup_mitosis(); + #[cfg(feature = "tor")] + { + if conn_type == ConnectionType::TOR { + setup_mitosis(); + } } - let directory = Arc::new(DirectoryServer::new(args.data_directory, Some(conn_type))?); start_directory_server(directory)?; diff --git a/src/bin/makerd.rs b/src/bin/makerd.rs index 17dc715f..0d067e08 100644 --- a/src/bin/makerd.rs +++ b/src/bin/makerd.rs @@ -2,12 +2,14 @@ use bitcoind::bitcoincore_rpc::Auth; use clap::Parser; use coinswap::{ maker::{start_maker_server, Maker, MakerBehavior, MakerError}, - tor::setup_mitosis, utill::{parse_proxy_auth, setup_maker_logger, ConnectionType}, wallet::RPCConfig, }; use std::{path::PathBuf, str::FromStr, sync::Arc}; +#[cfg(feature = "tor")] +use coinswap::tor::setup_mitosis; + /// The Maker Server. /// /// This app starts the Maker server. @@ -67,8 +69,11 @@ fn main() -> Result<(), MakerError> { wallet_name: "random".to_string(), // we can put anything here as it will get updated in the init. }; - if conn_type == ConnectionType::TOR { - setup_mitosis(); + #[cfg(feature = "tor")] + { + if conn_type == ConnectionType::TOR { + setup_mitosis(); + } } let maker = Arc::new(Maker::init( diff --git a/src/maker/config.rs b/src/maker/config.rs index ff527a0d..7e8ed124 100644 --- a/src/maker/config.rs +++ b/src/maker/config.rs @@ -46,7 +46,16 @@ impl Default for MakerConfig { directory_server_address: "127.0.0.1:8080".to_string(), fidelity_value: 5_000_000, // 5 million sats fidelity_timelock: 26_000, // Approx 6 months of blocks - connection_type: ConnectionType::TOR, + connection_type: { + #[cfg(feature = "tor")] + { + ConnectionType::TOR + } + #[cfg(not(feature = "tor"))] + { + ConnectionType::CLEARNET + } + }, } } } diff --git a/src/maker/server.rs b/src/maker/server.rs index aa7ed873..977aba07 100644 --- a/src/maker/server.rs +++ b/src/maker/server.rs @@ -5,10 +5,8 @@ //! The server listens at two port 6102 for P2P, and 6103 for RPC Client request. use std::{ - fs, - io::{ErrorKind, Read, Write}, + io::{ErrorKind, Write}, net::{Ipv4Addr, SocketAddr, TcpListener, TcpStream}, - path::{Path, PathBuf}, sync::{ atomic::{AtomicBool, Ordering::Relaxed}, Arc, @@ -17,9 +15,19 @@ use std::{ time::Duration, }; +#[cfg(feature = "tor")] +use std::io::Read; + +#[cfg(feature = "tor")] +use std::{ + fs, + path::{Path, PathBuf}, +}; + use bitcoin::{absolute::LockTime, Amount}; use bitcoind::bitcoincore_rpc::RpcApi; +#[cfg(feature = "tor")] use socks::Socks5Stream; pub use super::Maker; @@ -32,10 +40,13 @@ use crate::{ rpc::start_rpc_server, }, protocol::messages::TakerToMakerMessage, - utill::{monitor_log_for_completion, read_message, send_message, ConnectionType}, + utill::{read_message, send_message, ConnectionType}, wallet::WalletError, }; +#[cfg(feature = "tor")] +use crate::utill::monitor_log_for_completion; + use crate::maker::error::MakerError; // Default values for Maker configurations @@ -50,15 +61,19 @@ pub const MIN_CONTRACT_REACTION_TIME: u16 = 48; /// E.g., for 1 billion sats (0.01 BTC), a value of 10_000 would result in a 0.1% fee. pub const AMOUNT_RELATIVE_FEE_PPB: Amount = Amount::from_sat(10_000_000); +#[cfg(feature = "tor")] +type OptionalJoinHandle = Option>; + +#[cfg(not(feature = "tor"))] +type OptionalJoinHandle = Option<()>; + /// Fetches the Maker and DNS address, and sends maker address to the DNS server. /// Depending upon ConnectionType and test/prod environment, different maker address and DNS addresses are returned. /// Return the Maker address and an optional tor thread handle. /// /// Tor thread is spawned only if ConnectionType=TOR and --feature=tor is enabled. /// Errors if ConncetionType=TOR but, the tor feature is not enabled. -fn network_bootstrap( - maker: Arc, -) -> Result<(String, Option>), MakerError> { +fn network_bootstrap(maker: Arc) -> Result<(String, OptionalJoinHandle), MakerError> { let maker_port = maker.config.port; let mut tor_handle = None; let (maker_address, dns_address) = match maker.config.connection_type { @@ -72,63 +87,58 @@ fn network_bootstrap( (maker_address, dns_address) } + #[cfg(feature = "tor")] ConnectionType::TOR => { - if !cfg!(feature = "tor") { - return Err(MakerError::General( - "Tor setup failure. Please compile with Tor feature enabled.", - )); - } else { - let maker_socks_port = maker.config.socks_port; + let maker_socks_port = maker.config.socks_port; - let tor_log_dir = format!("/tmp/tor-rust-maker{}/log", maker_port); + let tor_log_dir = format!("/tmp/tor-rust-maker{}/log", maker_port); - if Path::new(&tor_log_dir).exists() { - match fs::remove_file(&tor_log_dir) { - Ok(_) => log::info!( - "[{}] Previous Maker log file deleted successfully", - maker_port - ), - Err(_) => log::error!("[{}] Error deleting Maker log file", maker_port), - } + if Path::new(&tor_log_dir).exists() { + match fs::remove_file(&tor_log_dir) { + Ok(_) => log::info!( + "[{}] Previous Maker log file deleted successfully", + maker_port + ), + Err(_) => log::error!("[{}] Error deleting Maker log file", maker_port), } + } - tor_handle = Some(crate::tor::spawn_tor( - maker_socks_port, - maker_port, - format!("/tmp/tor-rust-maker{}", maker_port), - )); - thread::sleep(Duration::from_secs(10)); + tor_handle = Some(crate::tor::spawn_tor( + maker_socks_port, + maker_port, + format!("/tmp/tor-rust-maker{}", maker_port), + )); + thread::sleep(Duration::from_secs(10)); - if let Err(e) = monitor_log_for_completion(&PathBuf::from(tor_log_dir), "100%") { - log::error!("[{}] Error monitoring log file: {}", maker_port, e); - } + if let Err(e) = monitor_log_for_completion(&PathBuf::from(tor_log_dir), "100%") { + log::error!("[{}] Error monitoring log file: {}", maker_port, e); + } - log::info!("[{}] Maker tor is instantiated", maker_port); + log::info!("[{}] Maker tor is instantiated", maker_port); - let maker_hs_path_str = - format!("/tmp/tor-rust-maker{}/hs-dir/hostname", maker.config.port); - let mut maker_file = fs::File::open(maker_hs_path_str)?; - let mut maker_onion_addr: String = String::new(); - maker_file.read_to_string(&mut maker_onion_addr)?; + let maker_hs_path_str = + format!("/tmp/tor-rust-maker{}/hs-dir/hostname", maker.config.port); + let mut maker_file = fs::File::open(maker_hs_path_str)?; + let mut maker_onion_addr: String = String::new(); + maker_file.read_to_string(&mut maker_onion_addr)?; - maker_onion_addr.pop(); // Remove `\n` at the end. + maker_onion_addr.pop(); // Remove `\n` at the end. - let maker_address = format!("{}:{}", maker_onion_addr, maker.config.port); + let maker_address = format!("{}:{}", maker_onion_addr, maker.config.port); - let directory_onion_address = if cfg!(feature = "integration-test") { - let directory_hs_path_str = "/tmp/tor-rust-directory/hs-dir/hostname"; - let mut directory_file = fs::File::open(directory_hs_path_str)?; - let mut directory_onion_addr: String = String::new(); + let directory_onion_address = if cfg!(feature = "integration-test") { + let directory_hs_path_str = "/tmp/tor-rust-directory/hs-dir/hostname"; + let mut directory_file = fs::File::open(directory_hs_path_str)?; + let mut directory_onion_addr: String = String::new(); - directory_file.read_to_string(&mut directory_onion_addr)?; - directory_onion_addr.pop(); // Remove `\n` at the end. - format!("{}:{}", directory_onion_addr, 8080) - } else { - maker.config.directory_server_address.clone() - }; + directory_file.read_to_string(&mut directory_onion_addr)?; + directory_onion_addr.pop(); // Remove `\n` at the end. + format!("{}:{}", directory_onion_addr, 8080) + } else { + maker.config.directory_server_address.clone() + }; - (maker_address, directory_onion_address) - } + (maker_address, directory_onion_address) } }; @@ -155,6 +165,7 @@ fn network_bootstrap( continue; } }, + #[cfg(feature = "tor")] ConnectionType::TOR => { match Socks5Stream::connect( format!("127.0.0.1:{}", maker.config.socks_port), @@ -549,11 +560,12 @@ pub fn start_maker_server(maker: Arc) -> Result<(), MakerError> { } log::info!("[{}] Maker is shutting down.", port); - - if maker.config.connection_type == ConnectionType::TOR && cfg!(feature = "tor") { - crate::tor::kill_tor_handles(tor_thread.expect("Tor thread expected")); + #[cfg(feature = "tor")] + { + if maker.config.connection_type == ConnectionType::TOR && cfg!(feature = "tor") { + crate::tor::kill_tor_handles(tor_thread.expect("Tor thread expected")); + } } - log::info!("Shutdown wallet sync initiated."); maker.get_wallet().write()?.sync()?; log::info!("Shutdown wallet syncing completed."); diff --git a/src/market/directory.rs b/src/market/directory.rs index 2e0d3636..5a9bf749 100644 --- a/src/market/directory.rs +++ b/src/market/directory.rs @@ -5,12 +5,12 @@ use crate::{ market::rpc::start_rpc_server_thread, - utill::{ - get_dns_dir, get_tor_addrs, monitor_log_for_completion, parse_field, parse_toml, - ConnectionType, - }, + utill::{get_dns_dir, parse_field, parse_toml, ConnectionType}, }; +#[cfg(feature = "tor")] +use crate::utill::{get_tor_addrs, monitor_log_for_completion}; + use std::{ collections::HashSet, fs::{self, File}, @@ -77,7 +77,16 @@ impl Default for DirectoryServer { rpc_port: 4321, port: 8080, socks_port: 19060, - connection_type: ConnectionType::TOR, + connection_type: { + #[cfg(feature = "tor")] + { + ConnectionType::TOR + } + #[cfg(not(feature = "tor"))] + { + ConnectionType::CLEARNET + } + }, data_dir: get_dns_dir(), shutdown: AtomicBool::new(false), addresses: Arc::new(RwLock::new(HashSet::new())), @@ -219,12 +228,15 @@ pub fn write_addresses_to_file( Ok(()) } pub fn start_directory_server(directory: Arc) -> Result<(), DirectoryServerError> { + #[cfg(feature = "tor")] let mut tor_handle = None; match directory.connection_type { ConnectionType::CLEARNET => {} + #[cfg(feature = "tor")] ConnectionType::TOR => { - if cfg!(feature = "tor") { + #[cfg(feature = "tor")] + { let tor_log_dir = "/tmp/tor-rust-directory/log"; if Path::new(tor_log_dir).exists() { match fs::remove_file(tor_log_dir) { @@ -304,9 +316,12 @@ pub fn start_directory_server(directory: Arc) -> Result<(), Dir log::error!("Error closing Address Writer Thread : {:?}", e); } - if let Some(handle) = tor_handle { - crate::tor::kill_tor_handles(handle); - log::info!("Directory server and Tor instance terminated successfully"); + #[cfg(feature = "tor")] + { + if let Some(handle) = tor_handle { + crate::tor::kill_tor_handles(handle); + log::info!("Directory server and Tor instance terminated successfully"); + } } write_addresses_to_file(&directory, &address_file)?; diff --git a/src/taker/api.rs b/src/taker/api.rs index d756074b..5641d508 100644 --- a/src/taker/api.rs +++ b/src/taker/api.rs @@ -10,15 +10,21 @@ use std::{ collections::{HashMap, HashSet}, - fs, - io::Read, net::TcpStream, - path::{Path, PathBuf}, + path::PathBuf, thread::{self, sleep}, time::{Duration, Instant}, }; +#[cfg(feature = "tor")] +use std::io::Read; + +#[cfg(feature = "tor")] +use std::{fs, path::Path}; + use bitcoind::bitcoincore_rpc::RpcApi; + +#[cfg(feature = "tor")] use socks::Socks5Stream; use bitcoin::{ @@ -237,42 +243,44 @@ impl Taker { let taker_port = self.config.port; + #[cfg(feature = "tor")] let mut handle = None; match self.config.connection_type { ConnectionType::CLEARNET => {} + #[cfg(feature = "tor")] ConnectionType::TOR => { - if cfg!(feature = "tor") { - let taker_socks_port = self.config.socks_port; + let taker_socks_port = self.config.socks_port; - if Path::new(tor_log_dir.as_str()).exists() { - match fs::remove_file(Path::new(tor_log_dir.clone().as_str())) { - Ok(_) => log::info!("Previous taker log file deleted successfully"), - Err(_) => log::error!("Error deleting taker log file "), - } + if Path::new(tor_log_dir.as_str()).exists() { + match fs::remove_file(Path::new(tor_log_dir.clone().as_str())) { + Ok(_) => log::info!("Previous taker log file deleted successfully"), + Err(_) => log::error!("Error deleting taker log file "), } + } - handle = Some(crate::tor::spawn_tor( - taker_socks_port, - taker_port, - "/tmp/tor-rust-taker".to_string(), - )); - - thread::sleep(Duration::from_secs(10)); + handle = Some(crate::tor::spawn_tor( + taker_socks_port, + taker_port, + "/tmp/tor-rust-taker".to_string(), + )); - if let Err(e) = monitor_log_for_completion(&PathBuf::from(tor_log_dir), "100%") - { - log::error!("Error monitoring taker log file: {}", e); - } + thread::sleep(Duration::from_secs(10)); - log::info!("Taker tor is instantiated"); + if let Err(e) = monitor_log_for_completion(&PathBuf::from(tor_log_dir), "100%") { + log::error!("Error monitoring taker log file: {}", e); } + + log::info!("Taker tor is instantiated"); } } self.send_coinswap(swap_params)?; - if self.config.connection_type == ConnectionType::TOR && cfg!(feature = "tor") { - crate::tor::kill_tor_handles(handle.expect("tor handle expected")); + #[cfg(feature = "tor")] + { + if self.config.connection_type == ConnectionType::TOR && cfg!(feature = "tor") { + crate::tor::kill_tor_handles(handle.expect("tor handle expected")); + } } Ok(()) } @@ -860,6 +868,7 @@ impl Taker { let address = this_maker.address.to_string(); let mut socket = match self.config.connection_type { ConnectionType::CLEARNET => TcpStream::connect(address)?, + #[cfg(feature = "tor")] ConnectionType::TOR => Socks5Stream::connect( format!("127.0.0.1:{}", self.config.socks_port).as_str(), address.as_str(), @@ -1343,6 +1352,7 @@ impl Taker { let mut socket = match self.config.connection_type { ConnectionType::CLEARNET => TcpStream::connect(maker_addr_str.clone())?, + #[cfg(feature = "tor")] ConnectionType::TOR => Socks5Stream::connect( format!("127.0.0.1:{}", self.config.socks_port).as_str(), &*maker_addr_str, @@ -1424,6 +1434,7 @@ impl Taker { let maker_addr_str = maker_address.to_string(); let mut socket = match self.config.connection_type { ConnectionType::CLEARNET => TcpStream::connect(maker_addr_str.clone())?, + #[cfg(feature = "tor")] ConnectionType::TOR => Socks5Stream::connect( format!("127.0.0.1:{}", self.config.socks_port).as_str(), &*maker_addr_str, @@ -1531,6 +1542,7 @@ impl Taker { let maker_addr_str = maker_address.address.to_string(); let mut socket = match self.config.connection_type { ConnectionType::CLEARNET => TcpStream::connect(maker_addr_str.clone())?, + #[cfg(feature = "tor")] ConnectionType::TOR => Socks5Stream::connect( format!("127.0.0.1:{}", self.config.socks_port).as_str(), &*maker_addr_str, @@ -1916,6 +1928,7 @@ impl Taker { } address } + #[cfg(feature = "tor")] ConnectionType::TOR => { let mut address = self.config.directory_server_address.clone(); if cfg!(feature = "integration-test") { @@ -1931,13 +1944,13 @@ impl Taker { address } }; - - let socks_port = if self.config.connection_type == ConnectionType::TOR { - Some(self.config.socks_port) - } else { - None - }; - + let mut socks_port: Option = None; + #[cfg(feature = "tor")] + { + if self.config.connection_type == ConnectionType::TOR { + socks_port = Some(self.config.socks_port); + } + } let addresses_from_dns = fetch_addresses_from_dns( socks_port, directory_address, diff --git a/src/taker/config.rs b/src/taker/config.rs index 00daf584..4d25438b 100644 --- a/src/taker/config.rs +++ b/src/taker/config.rs @@ -27,7 +27,16 @@ impl Default for TakerConfig { port: 8000, socks_port: 19050, directory_server_address: "directoryhiddenserviceaddress.onion:8080".to_string(), - connection_type: ConnectionType::TOR, + connection_type: { + #[cfg(feature = "tor")] + { + ConnectionType::TOR + } + #[cfg(not(feature = "tor"))] + { + ConnectionType::CLEARNET + } + }, rpc_port: 8081, } } diff --git a/src/taker/offers.rs b/src/taker/offers.rs index 68474fdc..ca4091b3 100644 --- a/src/taker/offers.rs +++ b/src/taker/offers.rs @@ -15,6 +15,8 @@ use std::{ }; use serde::{Deserialize, Serialize}; + +#[cfg(feature = "tor")] use socks::Socks5Stream; use crate::{ @@ -184,6 +186,7 @@ pub fn fetch_addresses_from_dns( loop { let mut stream = match connection_type { ConnectionType::CLEARNET => TcpStream::connect(directory_server_address.as_str())?, + #[cfg(feature = "tor")] ConnectionType::TOR => { let socket_addrs = format!("127.0.0.1:{}", socks_port.expect("Tor port expected")); Socks5Stream::connect(socket_addrs, directory_server_address.as_str())?.into_inner() diff --git a/src/taker/routines.rs b/src/taker/routines.rs index ceba3b7d..25ee1609 100644 --- a/src/taker/routines.rs +++ b/src/taker/routines.rs @@ -7,6 +7,7 @@ //! for communication between taker and maker. use serde::{Deserialize, Serialize}; +#[cfg(feature = "tor")] use socks::Socks5Stream; use std::{io::ErrorKind, net::TcpStream, thread::sleep, time::Duration}; @@ -451,6 +452,7 @@ fn download_maker_offer_attempt_once( let address = addr.to_string(); let mut socket = match config.connection_type { ConnectionType::CLEARNET => TcpStream::connect(address)?, + #[cfg(feature = "tor")] ConnectionType::TOR => Socks5Stream::connect( format!("127.0.0.1:{}", config.socks_port).as_str(), address.as_ref(), diff --git a/src/utill.rs b/src/utill.rs index b1b9099a..5ba6f7c6 100644 --- a/src/utill.rs +++ b/src/utill.rs @@ -56,6 +56,7 @@ pub const HEART_BEAT_INTERVAL: Duration = Duration::from_secs(3); #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum ConnectionType { + #[cfg(feature = "tor")] TOR, CLEARNET, } @@ -65,6 +66,7 @@ impl FromStr for ConnectionType { fn from_str(s: &str) -> Result { match s.to_lowercase().as_str() { + #[cfg(feature = "tor")] "tor" => Ok(ConnectionType::TOR), "clearnet" => Ok(ConnectionType::CLEARNET), _ => Err(NetError::InvalidAppNetwork), @@ -75,6 +77,7 @@ impl FromStr for ConnectionType { impl fmt::Display for ConnectionType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { + #[cfg(feature = "tor")] ConnectionType::TOR => write!(f, "tor"), ConnectionType::CLEARNET => write!(f, "clearnet"), } diff --git a/tests/abort2_case2.rs b/tests/abort2_case2.rs index 772387a6..e0c946e7 100644 --- a/tests/abort2_case2.rs +++ b/tests/abort2_case2.rs @@ -218,6 +218,7 @@ fn test_abort_case_2_recover_if_no_makers_found() { .to_string() ); } + #[cfg(feature = "tor")] ConnectionType::TOR => { let onion_addr_path = PathBuf::from(format!("/tmp/tor-rust-maker{}/hs-dir/hostname", 6102)); diff --git a/tests/abort2_case3.rs b/tests/abort2_case3.rs index 16e88531..679ead7f 100644 --- a/tests/abort2_case3.rs +++ b/tests/abort2_case3.rs @@ -155,6 +155,7 @@ fn maker_drops_after_sending_senders_sigs() { .to_string() ); } + #[cfg(feature = "tor")] ConnectionType::TOR => { let onion_addr_path = PathBuf::from(format!("/tmp/tor-rust-maker{}/hs-dir/hostname", 6102)); diff --git a/tests/abort3_case1.rs b/tests/abort3_case1.rs index f2338fed..85081ccc 100644 --- a/tests/abort3_case1.rs +++ b/tests/abort3_case1.rs @@ -155,6 +155,7 @@ fn abort3_case1_close_at_contract_sigs_for_recvr_and_sender() { .to_string() ); } + #[cfg(feature = "tor")] ConnectionType::TOR => { let onion_addr_path = PathBuf::from(format!("/tmp/tor-rust-maker{}/hs-dir/hostname", 6102)); diff --git a/tests/abort3_case2.rs b/tests/abort3_case2.rs index ab424a3b..6ffb67b7 100644 --- a/tests/abort3_case2.rs +++ b/tests/abort3_case2.rs @@ -152,6 +152,7 @@ fn abort3_case2_close_at_contract_sigs_for_recvr() { .to_string() ); } + #[cfg(feature = "tor")] ConnectionType::TOR => { let onion_addr_path = PathBuf::from(format!("/tmp/tor-rust-maker{}/hs-dir/hostname", 6102)); diff --git a/tests/abort3_case3.rs b/tests/abort3_case3.rs index bc9f826a..0b0b2d4d 100644 --- a/tests/abort3_case3.rs +++ b/tests/abort3_case3.rs @@ -150,6 +150,7 @@ fn abort3_case3_close_at_hash_preimage_handover() { .to_string() ); } + #[cfg(feature = "tor")] ConnectionType::TOR => { let onion_addr_path = PathBuf::from(format!("/tmp/tor-rust-maker{}/hs-dir/hostname", 6102));