From c1ffc0ab0740136ea3c947c21eb11ef248433f89 Mon Sep 17 00:00:00 2001 From: mhchia Date: Wed, 11 Sep 2019 17:13:21 +0800 Subject: [PATCH] Fix `transport.dial` in swarm --- libp2p/network/swarm.py | 2 +- libp2p/transport/transport_interface.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libp2p/network/swarm.py b/libp2p/network/swarm.py index 5ce7f54..e5b5469 100644 --- a/libp2p/network/swarm.py +++ b/libp2p/network/swarm.py @@ -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) diff --git a/libp2p/transport/transport_interface.py b/libp2p/transport/transport_interface.py index 2f5a1ac..ca8b5c3 100644 --- a/libp2p/transport/transport_interface.py +++ b/libp2p/transport/transport_interface.py @@ -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