Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ filter-control = []

[dev-dependencies]
corepc-node = { version = "0.6.1", default-features = false, features = [
"28_0",
"28_0", "download"
] }
hex = { version = "0.4.0" }
tracing = "0.1"
Expand Down
56 changes: 7 additions & 49 deletions tests/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,7 @@ async fn print_logs(mut log_rx: Receiver<String>, mut warn_rx: UnboundedReceiver

#[tokio::test]
async fn live_reorg() {
let rpc_result = start_bitcoind(false);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();
// Mine some blocks
Expand Down Expand Up @@ -189,13 +183,7 @@ async fn live_reorg() {

#[tokio::test]
async fn live_reorg_additional_sync() {
let rpc_result = start_bitcoind(false);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();
// Mine some blocks
Expand Down Expand Up @@ -249,13 +237,7 @@ async fn live_reorg_additional_sync() {

#[tokio::test]
async fn various_client_methods() {
let rpc_result = start_bitcoind(false);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();
// Mine a lot of blocks
Expand Down Expand Up @@ -289,13 +271,7 @@ async fn various_client_methods() {

#[tokio::test]
async fn stop_reorg_resync() {
let rpc_result = start_bitcoind(true);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();
// Mine some blocks.
Expand Down Expand Up @@ -376,13 +352,7 @@ async fn stop_reorg_resync() {

#[tokio::test]
async fn stop_reorg_two_resync() {
let rpc_result = start_bitcoind(true);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();
// Mine some blocks.
Expand Down Expand Up @@ -463,13 +433,7 @@ async fn stop_reorg_two_resync() {

#[tokio::test]
async fn stop_reorg_start_on_orphan() {
let rpc_result = start_bitcoind(true);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();
let miner = rpc.new_address().unwrap();
Expand Down Expand Up @@ -585,13 +549,7 @@ async fn stop_reorg_start_on_orphan() {
#[tokio::test]
#[allow(clippy::collapsible_match)]
async fn halting_download_works() {
let rpc_result = start_bitcoind(true);
// If we can't fetch the genesis block then bitcoind is not running. Just exit.
if rpc_result.is_err() {
println!("Bitcoin Core is not running. Skipping this test...");
return;
}
let (bitcoind, socket_addr) = rpc_result.unwrap();
let (bitcoind, socket_addr) = start_bitcoind(true).unwrap();
let rpc = &bitcoind.client;
let tempdir = tempfile::TempDir::new().unwrap().into_path();

Expand Down