mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-11 23:51:07 +00:00
run lint and fix errors, except mypy
This commit is contained in:
@ -1,18 +1,29 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from abc import (
|
||||
ABC,
|
||||
abstractmethod,
|
||||
)
|
||||
|
||||
from multiaddr import Multiaddr
|
||||
from multiaddr import (
|
||||
Multiaddr,
|
||||
)
|
||||
|
||||
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
||||
from libp2p.network.connection.raw_connection_interface import (
|
||||
IRawConnection,
|
||||
)
|
||||
|
||||
from .listener_interface import IListener
|
||||
from .typing import THandler
|
||||
from .listener_interface import (
|
||||
IListener,
|
||||
)
|
||||
from .typing import (
|
||||
THandler,
|
||||
)
|
||||
|
||||
|
||||
class ITransport(ABC):
|
||||
@abstractmethod
|
||||
async def dial(self, maddr: Multiaddr) -> IRawConnection:
|
||||
"""
|
||||
dial a transport to peer listening on multiaddr.
|
||||
Dial a transport to peer listening on multiaddr.
|
||||
|
||||
:param multiaddr: multiaddr of peer
|
||||
:param self_id: peer_id of the dialer (to send to receiver)
|
||||
@ -22,7 +33,7 @@ class ITransport(ABC):
|
||||
@abstractmethod
|
||||
def create_listener(self, handler_function: THandler) -> IListener:
|
||||
"""
|
||||
create listener on transport.
|
||||
Create listener on transport.
|
||||
|
||||
:param handler_function: a function called when a new conntion is received
|
||||
that takes a connection as argument which implements interface-connection
|
||||
|
||||
Reference in New Issue
Block a user