diff --git a/tests/regtest/bitcoin.rs b/tests/regtest/bitcoin.rs index 2f5603e..503ad2f 100644 --- a/tests/regtest/bitcoin.rs +++ b/tests/regtest/bitcoin.rs @@ -18,7 +18,7 @@ use boltz_client::{ Bolt11Invoice, BtcSwapScript, BtcSwapTx, Secp256k1, }; -use crate::regtest::TIMEOUT_MS; +use crate::regtest::WAIT_TIME_MS; use crate::utils; use bitcoin::{ hashes::{sha256, Hash}, @@ -232,7 +232,7 @@ async fn bitcoin_v2_submarine(bitcoin_client: &BC, underpay: if update.status == "transaction.lockupFailed" || update.status == "invoice.failedToPay" { - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; let swap_tx = BtcSwapTx::new_refund( swap_script.clone(), &refund_address, @@ -418,7 +418,7 @@ async fn bitcoin_v2_reverse(bitcoin_client: BC) { if update.status == "transaction.mempool" { log::info!("Boltz broadcasted funding tx"); - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; let claim_tx = BtcSwapTx::new_claim( swap_script.clone(), @@ -596,7 +596,7 @@ async fn bitcoin_v2_reverse_script_path(bitcoin_client: BC) { if update.status == "transaction.mempool" { log::info!("Boltz broadcasted funding tx"); - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; let claim_tx = BtcSwapTx::new_claim( swap_script.clone(), diff --git a/tests/regtest/chain_swaps.rs b/tests/regtest/chain_swaps.rs index 7ee40d3..70ce7f0 100644 --- a/tests/regtest/chain_swaps.rs +++ b/tests/regtest/chain_swaps.rs @@ -1,4 +1,4 @@ -use crate::regtest::TIMEOUT_MS; +use crate::regtest::WAIT_TIME_MS; use crate::utils; use bitcoin::{key::rand::thread_rng, PublicKey}; use boltz_client::boltz::{ @@ -206,7 +206,7 @@ async fn bitcoin_liquid_v2_chain( if update.status == "transaction.server.confirmed" { log::info!("Server lockup tx is confirmed!"); - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; log::info!("Claiming!"); let claim_tx = LBtcSwapTx::new_claim( @@ -267,7 +267,7 @@ async fn bitcoin_liquid_v2_chain( // This means the funding transaction was rejected by Boltz for whatever reason, and we need to get // fund back via refund. if update.status == "transaction.lockupFailed" { - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; log::info!("REFUNDING!"); refund_bitcoin_liquid_v2_chain( lockup_script.clone(), @@ -524,7 +524,7 @@ async fn liquid_bitcoin_v2_chain( if update.status == "transaction.server.confirmed" { log::info!("Server lockup tx is confirmed!"); - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; log::info!("Claiming!"); let claim_tx = BtcSwapTx::new_claim( @@ -584,7 +584,7 @@ async fn liquid_bitcoin_v2_chain( // This means the funding transaction was rejected by Boltz for whatever reason, and we need to get // fund back via refund. if update.status == "transaction.lockupFailed" { - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; log::info!("REFUNDING!"); let refund_tx = LBtcSwapTx::new_refund( lockup_script.clone(), diff --git a/tests/regtest/liquid.rs b/tests/regtest/liquid.rs index 1355358..bf2689d 100644 --- a/tests/regtest/liquid.rs +++ b/tests/regtest/liquid.rs @@ -17,7 +17,7 @@ use boltz_client::{ }; use std::str::FromStr; -use crate::regtest::TIMEOUT_MS; +use crate::regtest::WAIT_TIME_MS; use crate::utils; use bitcoin::{ hashes::{sha256, Hash}, @@ -237,7 +237,7 @@ async fn liquid_v2_submarine(liquid_client: &LC, underpay: boo if update.status == "transaction.lockupFailed" || update.status == "invoice.failedToPay" { - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; let swap_tx = LBtcSwapTx::new_refund( swap_script.clone(), &refund_address, @@ -441,7 +441,7 @@ async fn liquid_v2_reverse(liquid_client: &LC, lowball: bool) if update.status == "transaction.mempool" { log::info!("Boltz broadcasted funding tx"); - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; let claim_tx = LBtcSwapTx::new_claim( swap_script.clone(), @@ -640,7 +640,7 @@ async fn liquid_v2_reverse_script_path(liquid_client: &LC, low if update.status == "transaction.mempool" { log::info!("Boltz broadcasted funding tx"); - async_sleep(TIMEOUT_MS).await; + async_sleep(WAIT_TIME_MS).await; let claim_tx = LBtcSwapTx::new_claim( swap_script.clone(), diff --git a/tests/regtest/mod.rs b/tests/regtest/mod.rs index 016ae32..20bd169 100644 --- a/tests/regtest/mod.rs +++ b/tests/regtest/mod.rs @@ -3,4 +3,4 @@ mod bitcoin; mod chain_swaps; mod liquid; -const TIMEOUT_MS: i32 = 5_000; +const WAIT_TIME_MS: i32 = 5_000;