added test for connected peers

This commit is contained in:
mystical-prog
2024-11-05 10:46:55 +05:30
committed by Paul Robinson
parent 847dfa6577
commit 17575f4a38
2 changed files with 122 additions and 1 deletions

View File

@ -146,7 +146,10 @@ class BasicHost(IHost):
return addrs
def get_connected_peers(self) -> List[ID]:
return list(self.get_network().connections.keys())
"""
:return: all the ids of peers this host is currently connected to
"""
return list(self._network.connections.keys())
@asynccontextmanager
async def run(