Skip to content

Commit

Permalink
Add missing esplora conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Feb 26, 2025
1 parent 9eb093b commit 0c48174
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion tests/bitcoin.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
#[cfg(feature = "electrum")]
use boltz_client::network::electrum::ElectrumConfig;
#[cfg(feature = "esplora")]
use boltz_client::network::esplora::EsploraConfig;
use std::{str::FromStr, time::Duration};

Expand Down Expand Up @@ -43,8 +44,8 @@ async fn bitcoin_v2_submarine_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]

async fn bitcoin_v2_submarine_esplora() {
let bitcoin_network_config = EsploraConfig::default_bitcoin();
bitcoin_v2_submarine(bitcoin_network_config).await
Expand Down Expand Up @@ -292,6 +293,7 @@ async fn bitcoin_v2_reverse_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]
async fn bitcoin_v2_reverse_esplora() {
let bitcoin_network_config = EsploraConfig::default_bitcoin();
Expand Down Expand Up @@ -464,6 +466,7 @@ async fn bitcoin_v2_reverse_script_path_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]
async fn bitcoin_v2_reverse_script_path_esplora() {
let bitcoin_network_config = EsploraConfig::default_bitcoin();
Expand Down
6 changes: 4 additions & 2 deletions tests/chain_swaps.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::time::Duration;

use bitcoin::{key::rand::thread_rng, PublicKey};
use boltz_client::boltz::{
BoltzApiClientV2, ChainSwapDetails, Cooperative, CreateChainRequest, Side, Subscription,
Expand All @@ -9,6 +7,7 @@ use boltz_client::fees::Fee;
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
#[cfg(feature = "electrum")]
use boltz_client::network::electrum::ElectrumConfig;
#[cfg(feature = "esplora")]
use boltz_client::network::esplora::EsploraConfig;
use boltz_client::network::{
BitcoinClient, BitcoinNetworkConfig, LiquidClient, LiquidNetworkConfig,
Expand All @@ -21,6 +20,7 @@ use boltz_client::{
use elements::Address as EAddress;
use futures_util::{SinkExt, StreamExt};
use std::str::FromStr;
use std::time::Duration;
use tokio_tungstenite_wasm::Message;

#[cfg(all(target_family = "wasm", target_os = "unknown"))]
Expand All @@ -36,6 +36,7 @@ async fn bitcoin_liquid_v2_chain_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore]
async fn bitcoin_liquid_v2_chain_esplora() {
let bitcoin_network_config = EsploraConfig::default_bitcoin();
Expand Down Expand Up @@ -351,6 +352,7 @@ async fn liquid_bitcoin_v2_chain_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore]
async fn liquid_bitcoin_v2_chain_esplora() {
let bitcoin_network_config = EsploraConfig::default_bitcoin();
Expand Down
11 changes: 8 additions & 3 deletions tests/liquid.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
#[cfg(feature = "electrum")]
use boltz_client::network::electrum::ElectrumConfig;
#[cfg(feature = "esplora")]
use boltz_client::network::esplora::EsploraConfig;
use std::{str::FromStr, time::Duration};

Expand All @@ -22,9 +26,6 @@ use bitcoin::{
PublicKey,
};
use boltz_client::fees::Fee;
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
#[cfg(feature = "electrum")]
use boltz_client::network::electrum::ElectrumConfig;
use boltz_client::network::{LiquidClient, LiquidNetworkConfig};
use elements::encode::serialize;
use futures_util::{SinkExt, StreamExt};
Expand All @@ -44,6 +45,7 @@ async fn liquid_v2_submarine_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]
async fn liquid_v2_submarine_esplora() {
let liquid_network_config = EsploraConfig::default_liquid();
Expand Down Expand Up @@ -300,6 +302,7 @@ async fn liquid_v2_reverse_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]
async fn liquid_v2_reverse_esplora() {
let liquid_network_config = EsploraConfig::default_liquid();
Expand Down Expand Up @@ -492,6 +495,7 @@ async fn liquid_v2_reverse_script_path_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]
async fn liquid_v2_reverse_script_path_esplora() {
let liquid_network_config = EsploraConfig::default_liquid();
Expand Down Expand Up @@ -672,6 +676,7 @@ async fn test_recover_liquidv2_refund_electrum() {
}

#[macros::async_test_all]
#[cfg(feature = "esplora")]
#[ignore = "Requires testnet invoice and refund address"]
async fn test_recover_liquidv2_refund_esplora() {
let liquid_network_config = EsploraConfig::default_liquid();
Expand Down

0 comments on commit 0c48174

Please sign in to comment.