diff --git a/crates/cdk/src/wallet/subscription/mod.rs b/crates/cdk/src/wallet/subscription/mod.rs index ad9eea6a..55d4e627 100644 --- a/crates/cdk/src/wallet/subscription/mod.rs +++ b/crates/cdk/src/wallet/subscription/mod.rs @@ -197,6 +197,7 @@ impl SubscriptionClient { } } + #[allow(unused_variables)] fn start_worker( prefer_ws_method: bool, http_client: Arc, @@ -205,7 +206,11 @@ impl SubscriptionClient { new_subscription_recv: mpsc::Receiver, on_drop_recv: mpsc::Receiver, ) -> JoinHandle<()> { - #[cfg(any(feature = "http_subscription", target_arch = "wasm32"))] + #[cfg(any( + feature = "http_subscription", + not(feature = "mint"), + target_arch = "wasm32" + ))] return Self::http_worker( http_client, url, diff --git a/crates/cdk/src/wallet/subscription/ws.rs b/crates/cdk/src/wallet/subscription/ws.rs index db4a3fb7..d388f396 100644 --- a/crates/cdk/src/wallet/subscription/ws.rs +++ b/crates/cdk/src/wallet/subscription/ws.rs @@ -1,20 +1,21 @@ -use super::{http::http_main, WsSubscriptionBody}; -use crate::{ - mint_url::MintUrl, - nuts::nut17::{ - ws::{WsMessageOrResponse, WsMethodRequest, WsRequest, WsUnsubscribeRequest}, - Params, - }, - pub_sub::SubId, - wallet::client::HttpClientMethods, -}; +use std::collections::{HashMap, HashSet}; +use std::sync::atomic::AtomicUsize; +use std::sync::Arc; + use futures::{SinkExt, StreamExt}; -use std::{ - collections::{HashMap, HashSet}, - sync::{atomic::AtomicUsize, Arc}, -}; use tokio::sync::{mpsc, RwLock}; -use tokio_tungstenite::{connect_async, tungstenite::Message}; +use tokio_tungstenite::connect_async; +use tokio_tungstenite::tungstenite::Message; + +use super::http::http_main; +use super::WsSubscriptionBody; +use crate::mint_url::MintUrl; +use crate::nuts::nut17::ws::{ + WsMessageOrResponse, WsMethodRequest, WsRequest, WsUnsubscribeRequest, +}; +use crate::nuts::nut17::Params; +use crate::pub_sub::SubId; +use crate::wallet::client::HttpClientMethods; const MAX_ATTEMPT_FALLBACK_HTTP: usize = 10;