Apply PR feedback: fix type hints

This commit is contained in:
NIC619
2019-07-30 15:31:02 +08:00
parent 2d4e23cfe2
commit e53727d301
15 changed files with 65 additions and 52 deletions

View File

@ -1,7 +1,6 @@
from abc import ABC, abstractmethod
from typing import (
Any,
Coroutine,
Iterable,
)
@ -31,7 +30,7 @@ class IContentRouting(ABC):
class IPeerRouting(ABC):
@abstractmethod
def find_peer(self, peer_id: ID) -> Coroutine[Any, Any, PeerInfo]:
async def find_peer(self, peer_id: ID) -> PeerInfo:
"""
Find specific Peer
FindPeer searches for a peer with given peer_id, returns a peer.PeerInfo

View File

@ -9,6 +9,7 @@ from libp2p.kademlia.kad_peerinfo import (
)
from libp2p.kademlia.network import KademliaServer
from libp2p.peer.id import ID
from libp2p.peer.peerinfo import PeerInfo
from libp2p.routing.interfaces import IPeerRouting