fix(mesh): keep closed availability helper test-only

The mode-aware resolver replaced the legacy closed-only helper in production. Keep the compatibility wrapper available to its existing closed-mode tests without leaving an unused production export.

Co-authored-by: Jimmy <1fe240cd1a8cf775f6f3060f115e5a303181f3abf28ad4cb0c2515f4a02b36a8@meshllm.communities.buzz.xyz>
Signed-off-by: Jimmy <1fe240cd1a8cf775f6f3060f115e5a303181f3abf28ad4cb0c2515f4a02b36a8@meshllm.communities.buzz.xyz>
This commit is contained in:
Jimmy
2026-08-27 11:54:01 +10:00
parent 1eba2f001d
commit 3e78b290ec
2 changed files with 6 additions and 3 deletions

View File

@@ -232,11 +232,12 @@ fn endpoint_binding_is_valid(event: &nostr::Event, content: &serde_json::Value)
.is_ok()
}
#[cfg(test)]
pub fn availability_from_events(events: Vec<nostr::Event>) -> MeshAvailability {
availability_from_events_for_mode(events, MeshRelayMode::ClosedMembershipEnforced)
}
/// [`availability_from_events`], scoped to the relay's membership mode.
/// Resolve availability from relay events, scoped to the relay's membership mode.
///
/// On a membership-enforcing relay the NIP-43 snapshot gates routing: a serve
/// target is selectable only when its status note is signed by a current

View File

@@ -5,9 +5,11 @@ pub(crate) use coordinator::{publish_current_status_once, publish_stopped_status
pub use coordinator::{start_coordinator, MeshCoordinator, KIND_BUZZ_MESH_MEMBER_STATUS};
mod discovery;
#[cfg(test)]
pub use discovery::availability_from_events;
pub use discovery::{
availability_from_events, availability_from_events_for_mode, mesh_status_filter,
owner_ids_from_events, relay_membership_filter, relay_mesh_mode_from_nip11, MeshRelayMode,
availability_from_events_for_mode, mesh_status_filter, owner_ids_from_events,
relay_membership_filter, relay_mesh_mode_from_nip11, MeshRelayMode,
};
pub(crate) use discovery::{
current_member_pubkeys, has_membership_snapshot, MESH_STATUS_PAGE_SIZE,