From eb3a6aa7798a9994b4a69a85abc65a32163b945f Mon Sep 17 00:00:00 2001 From: Vihiga Tyonum Date: Tue, 21 Apr 2026 11:08:44 +0100 Subject: [PATCH] ref(persister): mv persister into wallet subdir - move persister into wallet subdirectory - update imports in payjoin module --- src/payjoin/mod.rs | 25 +++++++++++++++++++++---- src/{ => wallet}/persister.rs | 0 2 files changed, 21 insertions(+), 4 deletions(-) rename src/{ => wallet}/persister.rs (100%) diff --git a/src/payjoin/mod.rs b/src/payjoin/mod.rs index 19beb7d..30a6774 100644 --- a/src/payjoin/mod.rs +++ b/src/payjoin/mod.rs @@ -1,6 +1,14 @@ -use crate::error::BDKCliError as Error; -use crate::handlers::{broadcast_transaction, sync_wallet}; -use crate::utils::BlockchainClient; +#![cfg(any( + feature = "electrum", + feature = "esplora", + feature = "rpc", + feature = "cbf" +))] + +use crate::{ + backend::BlockchainClient, + handlers::online::{broadcast_transaction, sync_wallet}, +}; use bdk_wallet::{ SignOptions, Wallet, bitcoin::{FeeRate, Psbt, Txid, consensus::encode::serialize_hex}, @@ -22,7 +30,10 @@ use payjoin::{ImplementationError, UriExt}; use serde_json::{json, to_string_pretty}; use std::sync::{Arc, Mutex}; -use crate::payjoin::ohttp::{RelayManager, fetch_ohttp_keys}; +use crate::{ + error::BDKCliError as Error, + payjoin::ohttp::{RelayManager, fetch_ohttp_keys}, +}; pub mod ohttp; @@ -109,6 +120,12 @@ impl<'a> PayjoinManager<'a> { Ok(to_string_pretty(&json!({}))?) } + #[cfg(any( + feature = "electrum", + feature = "esplora", + feature = "rpc", + feature = "cbf" + ))] pub async fn send_payjoin( &mut self, uri: String, diff --git a/src/persister.rs b/src/wallet/persister.rs similarity index 100% rename from src/persister.rs rename to src/wallet/persister.rs -- 2.49.0