diff --git a/tests/config.rs b/tests/config.rs index 4120d00b3..82e8f1eec 100644 --- a/tests/config.rs +++ b/tests/config.rs @@ -6,17 +6,22 @@ fn run_electrs(temp_dir: &Path, extra_args: &[&str]) -> Output { let monitoring_listener = TcpListener::bind("127.0.0.1:0").unwrap(); let monitoring_addr = monitoring_listener.local_addr().unwrap().to_string(); - Command::new(env!("CARGO_BIN_EXE_electrs")) - .args([ - "--db-dir", - temp_dir.join("db").to_str().unwrap(), - "--daemon-dir", - temp_dir.to_str().unwrap(), - "--daemon-rpc-addr", - "127.0.0.1:1", - "--monitoring-addr", - monitoring_addr.as_str(), - ]) + let mut command = Command::new(env!("CARGO_BIN_EXE_electrs")); + command.args([ + "--db-dir", + temp_dir.join("db").to_str().unwrap(), + "--daemon-dir", + temp_dir.to_str().unwrap(), + "--daemon-rpc-addr", + "127.0.0.1:1", + "--monitoring-addr", + monitoring_addr.as_str(), + ]); + + #[cfg(feature = "liquid")] + command.args(["--network", "liquidregtest"]); + + command .args(extra_args) .output() .expect("failed to run electrs") @@ -60,9 +65,12 @@ fn startup_debug_log_identifies_cookie_file() { let temp_dir = tempfile::tempdir().unwrap(); let output = run_electrs(temp_dir.path(), &["-v"]); let stderr = String::from_utf8(output.stderr).unwrap(); + let daemon_dir = temp_dir.path().to_path_buf(); + #[cfg(feature = "liquid")] + let daemon_dir = daemon_dir.join("liquidregtest"); let expected = format!( "daemon authentication: CookieFile({:?})", - temp_dir.path().join(".cookie") + daemon_dir.join(".cookie") ); assert!(!output.status.success(), "electrs unexpectedly succeeded");