Merge pull request #292 from mhchia/fix/dial-sig-changed
Fix `transport.dial` in swarm
This commit is contained in:
commit
811cd7813a
|
@ -1,6 +1,6 @@
|
|||
import asyncio
|
||||
from typing import Callable, Dict, List, Sequence
|
||||
import logging
|
||||
from typing import Callable, Dict, List, Sequence
|
||||
|
||||
from multiaddr import Multiaddr
|
||||
|
||||
|
@ -119,7 +119,7 @@ class Swarm(INetwork):
|
|||
multiaddr = self.router.find_peer(peer_id)
|
||||
# Dial peer (connection to peer does not yet exist)
|
||||
# Transport dials peer (gets back a raw conn)
|
||||
raw_conn = await self.transport.dial(multiaddr, self.self_id)
|
||||
raw_conn = await self.transport.dial(multiaddr)
|
||||
|
||||
logger.debug("dialed peer %s over base transport", peer_id)
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ from multiaddr import Multiaddr
|
|||
|
||||
from libp2p.network.connection.raw_connection import RawConnection
|
||||
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
||||
from libp2p.peer.id import ID
|
||||
from libp2p.transport.listener_interface import IListener
|
||||
from libp2p.transport.transport_interface import ITransport
|
||||
from libp2p.transport.typing import THandler
|
||||
|
|
|
@ -3,7 +3,6 @@ from abc import ABC, abstractmethod
|
|||
from multiaddr import Multiaddr
|
||||
|
||||
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
||||
from libp2p.peer.id import ID
|
||||
|
||||
from .listener_interface import IListener
|
||||
from .typing import THandler
|
||||
|
@ -11,7 +10,7 @@ from .typing import THandler
|
|||
|
||||
class ITransport(ABC):
|
||||
@abstractmethod
|
||||
async def dial(self, maddr: Multiaddr, self_id: ID) -> IRawConnection:
|
||||
async def dial(self, maddr: Multiaddr) -> IRawConnection:
|
||||
"""
|
||||
dial a transport to peer listening on multiaddr
|
||||
:param multiaddr: multiaddr of peer
|
||||
|
|
Loading…
Reference in New Issue
Block a user