feat: implement get_remote_address via delegation pattern

This commit is contained in:
acul71
2025-03-13 14:08:13 +01:00
committed by Paul Robinson
parent 798229cd3a
commit fabf2cefc4
8 changed files with 72 additions and 1 deletions

View File

@ -1,3 +1,7 @@
from typing import (
Optional,
)
from libp2p.abc import (
IRawConnection,
)
@ -42,3 +46,7 @@ class RawConnection(IRawConnection):
async def close(self) -> None:
await self.stream.close()
def get_remote_address(self) -> Optional[tuple[str, int]]:
"""Delegate to the underlying stream's get_remote_address method."""
return self.stream.get_remote_address()