mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
fixme/correct-type (#746)
* fixme/correct-type * added newsfragment and test
This commit is contained in:
@ -50,6 +50,11 @@ if TYPE_CHECKING:
|
||||
Pubsub,
|
||||
)
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from libp2p.protocol_muxer.multiselect import Multiselect
|
||||
|
||||
from libp2p.pubsub.pb import (
|
||||
rpc_pb2,
|
||||
)
|
||||
@ -1545,9 +1550,8 @@ class IHost(ABC):
|
||||
|
||||
"""
|
||||
|
||||
# FIXME: Replace with correct return type
|
||||
@abstractmethod
|
||||
def get_mux(self) -> Any:
|
||||
def get_mux(self) -> "Multiselect":
|
||||
"""
|
||||
Retrieve the muxer instance for the host.
|
||||
|
||||
@ -2158,6 +2162,7 @@ class IMultiselectMuxer(ABC):
|
||||
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_protocols(self) -> tuple[TProtocol | None, ...]:
|
||||
"""
|
||||
Retrieve the protocols for which handlers have been registered.
|
||||
@ -2168,7 +2173,6 @@ class IMultiselectMuxer(ABC):
|
||||
A tuple of registered protocol names.
|
||||
|
||||
"""
|
||||
return tuple(self.handlers.keys())
|
||||
|
||||
@abstractmethod
|
||||
async def negotiate(
|
||||
|
||||
Reference in New Issue
Block a user