Skip to content

Commit

Permalink
Rename const
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Mar 7, 2025
1 parent b6b46ca commit a27d7b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/regtest/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -232,7 +232,7 @@ async fn bitcoin_v2_submarine<BC: BitcoinClient>(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,
Expand Down Expand Up @@ -418,7 +418,7 @@ async fn bitcoin_v2_reverse<BC: BitcoinClient>(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(),
Expand Down Expand Up @@ -596,7 +596,7 @@ async fn bitcoin_v2_reverse_script_path<BC: BitcoinClient>(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(),
Expand Down
10 changes: 5 additions & 5 deletions tests/regtest/chain_swaps.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down Expand Up @@ -206,7 +206,7 @@ async fn bitcoin_liquid_v2_chain<BC: BitcoinClient, LC: LiquidClient>(
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(
Expand Down Expand Up @@ -267,7 +267,7 @@ async fn bitcoin_liquid_v2_chain<BC: BitcoinClient, LC: LiquidClient>(
// 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(),
Expand Down Expand Up @@ -524,7 +524,7 @@ async fn liquid_bitcoin_v2_chain<BC: BitcoinClient, LC: LiquidClient>(
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(
Expand Down Expand Up @@ -584,7 +584,7 @@ async fn liquid_bitcoin_v2_chain<BC: BitcoinClient, LC: LiquidClient>(
// 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(),
Expand Down
8 changes: 4 additions & 4 deletions tests/regtest/liquid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -237,7 +237,7 @@ async fn liquid_v2_submarine<LC: LiquidClient>(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,
Expand Down Expand Up @@ -441,7 +441,7 @@ async fn liquid_v2_reverse<LC: LiquidClient>(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(),
Expand Down Expand Up @@ -640,7 +640,7 @@ async fn liquid_v2_reverse_script_path<LC: LiquidClient>(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(),
Expand Down
2 changes: 1 addition & 1 deletion tests/regtest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ mod bitcoin;
mod chain_swaps;
mod liquid;

const TIMEOUT_MS: i32 = 5_000;
const WAIT_TIME_MS: i32 = 5_000;

0 comments on commit a27d7b5

Please sign in to comment.