diff --git a/crates/sprout-acp/src/relay.rs b/crates/sprout-acp/src/relay.rs index f7a7e26eee..01fe1b9592 100644 --- a/crates/sprout-acp/src/relay.rs +++ b/crates/sprout-acp/src/relay.rs @@ -656,24 +656,12 @@ impl RelayEventPublisher { impl HarnessRelay { // ── Public API ──────────────────────────────────────────────────────────── - /// Connect to relay and authenticate via NIP-42. + /// Connect to the relay, optionally in serverless mode (generic relay, AUTH + /// optional, plain-WS reads/writes). In server mode (`serverless = false`) + /// the NIP-42 AUTH handshake is performed; in serverless mode it is skipped. /// /// `auth_tag` is an optional NIP-OA owner attestation included in the AUTH /// event for relay membership delegation. - /// Server-mode convenience wrapper around [`HarnessRelay::connect_with_mode`]. - /// Kept as part of the public API; the binary uses `connect_with_mode`. - #[allow(dead_code)] - pub async fn connect( - relay_url: &str, - keys: &Keys, - agent_pubkey_hex: &str, - auth_tag: Option, - ) -> Result { - Self::connect_with_mode(relay_url, keys, agent_pubkey_hex, auth_tag, false).await - } - - /// Connect, optionally in serverless mode (generic relay, AUTH optional, - /// plain-WS reads/writes). See [`HarnessRelay::connect`]. pub async fn connect_with_mode( relay_url: &str, keys: &Keys, @@ -1133,9 +1121,9 @@ struct BgState { } impl BgState { - /// Server-mode constructor. Used by unit tests; the runtime path uses + /// Server-mode constructor. Test-only; the runtime path uses /// [`BgState::with_serverless`]. - #[allow(dead_code)] + #[cfg(test)] fn new() -> Self { Self::with_serverless(false) } diff --git a/desktop/src-tauri/src/encrypted.rs b/desktop/src-tauri/src/encrypted.rs index f80beee66f..bef7608954 100644 --- a/desktop/src-tauri/src/encrypted.rs +++ b/desktop/src-tauri/src/encrypted.rs @@ -26,10 +26,6 @@ use nostr::nips::nip59::UnwrappedGift; use nostr::{Event, EventBuilder, Keys, PublicKey, UnsignedEvent}; -/// Kind 1059 — NIP-59 gift wrap. -#[cfg_attr(not(test), allow(dead_code))] -pub const KIND_GIFT_WRAP: u16 = 1059; - /// Build the gift-wrapped events for `rumor`, one per recipient pubkey. /// /// `rumor` is the unsigned inner event (a normal kind-9 message with the `h` @@ -99,6 +95,9 @@ impl UnwrappedRumor { #[cfg(test)] mod tests { use super::*; + + /// Kind 1059 — NIP-59 gift wrap (test-only constant). + const KIND_GIFT_WRAP: u16 = 1059; use nostr::Kind; fn rumor(sender: &Keys, channel_id: &str, content: &str) -> UnsignedEvent {