mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +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:
@ -1,4 +1,4 @@
|
||||
from typing import Dict, Sequence
|
||||
from typing import Mapping, Sequence
|
||||
|
||||
from libp2p.network.connection.raw_connection_interface import IRawConnection
|
||||
from libp2p.network.typing import GenericProtocolHandlerFn
|
||||
@ -17,7 +17,9 @@ class TransportUpgrader:
|
||||
security_multistream: SecurityMultistream
|
||||
muxer: Sequence[str]
|
||||
|
||||
def __init__(self, secOpt: Dict[TProtocol, ISecureTransport], muxerOpt: Sequence[str]) -> None:
|
||||
def __init__(
|
||||
self, secOpt: Mapping[TProtocol, ISecureTransport], muxerOpt: Sequence[str]
|
||||
) -> None:
|
||||
# Store security option
|
||||
self.security_multistream = SecurityMultistream()
|
||||
for key in secOpt:
|
||||
@ -45,7 +47,7 @@ class TransportUpgrader:
|
||||
|
||||
@staticmethod
|
||||
def upgrade_connection(
|
||||
conn: IRawConnection, generic_protocol_handler: GenericProtocolHandlerFn, peer_id: ID
|
||||
conn: ISecureConn, generic_protocol_handler: GenericProtocolHandlerFn, peer_id: ID
|
||||
) -> Mplex:
|
||||
"""
|
||||
Upgrade raw connection to muxed connection
|
||||
|
||||
Reference in New Issue
Block a user