chore: eliminate self.protocol_id attribute \w in PeerRouting

This commit is contained in:
Luca Vivona
2025-06-22 00:25:48 -04:00
parent feb8db6655
commit 3a4338e1df
2 changed files with 1 additions and 3 deletions

View File

@ -60,7 +60,6 @@ class PeerRouting(IPeerRouting):
"""
self.host = host
self.routing_table = routing_table
self.protocol_id = PROTOCOL_ID
async def find_peer(self, peer_id: ID) -> PeerInfo | None:
"""
@ -245,7 +244,7 @@ class PeerRouting(IPeerRouting):
# Open a stream to the peer using the Kademlia protocol
logger.debug(f"Opening stream to {peer} for closest peers query")
try:
stream = await self.host.new_stream(peer, [self.protocol_id])
stream = await self.host.new_stream(peer, [PROTOCOL_ID])
logger.debug(f"Stream opened to {peer}")
except Exception as e:
logger.warning(f"Failed to open stream to {peer}: {e}")

View File

@ -89,7 +89,6 @@ class TestPeerRouting:
assert peer_routing.host == mock_host
assert peer_routing.routing_table == mock_routing_table
assert peer_routing.protocol_id == PROTOCOL_ID
@pytest.mark.trio
async def test_find_peer_local_host(self, peer_routing, mock_host):