type protocol IDs to satisfy mypy

This commit is contained in:
Alex Stokes 2019-11-06 15:21:30 -08:00
parent e61a5a677f
commit 9a23609b48
No known key found for this signature in database
GPG Key ID: 51CE1721B245C086
2 changed files with 4 additions and 3 deletions

View File

@ -4,8 +4,9 @@ import logging
from libp2p.network.stream.exceptions import StreamEOF, StreamReset from libp2p.network.stream.exceptions import StreamEOF, StreamReset
from libp2p.network.stream.net_stream_interface import INetStream from libp2p.network.stream.net_stream_interface import INetStream
from libp2p.peer.id import ID as PeerID from libp2p.peer.id import ID as PeerID
from libp2p.typing import TProtocol
ID = "/ipfs/ping/1.0.0" ID = TProtocol("/ipfs/ping/1.0.0")
PING_LENGTH = 32 PING_LENGTH = 32
RESP_TIMEOUT = 60 RESP_TIMEOUT = 60

View File

@ -4,11 +4,11 @@ from multiaddr import Multiaddr
from libp2p.host.host_interface import IHost from libp2p.host.host_interface import IHost
from libp2p.network.stream.net_stream_interface import INetStream from libp2p.network.stream.net_stream_interface import INetStream
from libp2p.typing import StreamHandlerFn from libp2p.typing import StreamHandlerFn, TProtocol
from .pb.identify_pb2 import Identify from .pb.identify_pb2 import Identify
ID = "/ipfs/id/1.0.0" ID = TProtocol("/ipfs/id/1.0.0")
PROTOCOL_VERSION = "ipfs/0.1.0" PROTOCOL_VERSION = "ipfs/0.1.0"
# TODO dynamically generate the agent version # TODO dynamically generate the agent version
AGENT_VERSION = "py-libp2p/alpha" AGENT_VERSION = "py-libp2p/alpha"