Add tests for discovery methods in circuit_relay_v2 (#750)

* Add test for direct_connection_relay_discovery

* Add test for mux_method_relay_discovery

* Fix newsfragments
This commit is contained in:
Sukhman Singh
2025-07-12 02:23:27 +05:30
committed by GitHub
parent 505d3b2a8f
commit dd14aad47c
5 changed files with 200 additions and 15 deletions

View File

@ -234,7 +234,8 @@ class RelayDiscovery(Service):
if not callable(proto_getter):
return None
if peer_id not in peerstore.peer_ids():
return None
try:
# Try to get protocols
proto_result = proto_getter(peer_id)
@ -283,8 +284,6 @@ class RelayDiscovery(Service):
return None
mux = self.host.get_mux()
if not hasattr(mux, "protocols"):
return None
peer_protocols = set()
# Get protocols from mux with proper type safety