mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Fix the rest of the typing hints (#232)
* ignore kad * fix swarm, and minor * fix init and swarm * ignore pb * enable mypy * fix basic host * fix tcp * fix mplex * add typing for pb * skip format pyi * [mypy] no need to ignore pb now * add typing to chat
This commit is contained in:
@ -22,7 +22,8 @@ class KadmeliaPeerRouter(IPeerRouting):
|
||||
"""
|
||||
# switching peer_id to xor_id used by kademlia as node_id
|
||||
xor_id = peer_id.xor_id
|
||||
value = await self.server.get(xor_id)
|
||||
# ignore type for kad
|
||||
value = await self.server.get(xor_id) # type: ignore
|
||||
return decode_peerinfo(value)
|
||||
|
||||
|
||||
@ -36,5 +37,6 @@ def decode_peerinfo(encoded: Union[bytes, str]) -> KadPeerInfo:
|
||||
ip = lines[1]
|
||||
port = lines[2]
|
||||
peer_id = lines[3]
|
||||
peer_info = create_kad_peerinfo(peer_id, ip, port)
|
||||
# ignore typing for kad
|
||||
peer_info = create_kad_peerinfo(peer_id, ip, port) # type: ignore
|
||||
return peer_info
|
||||
|
||||
Reference in New Issue
Block a user