rename typing.py to custom_types.py for clarity

This commit is contained in:
pacrob
2025-02-02 07:04:36 -07:00
committed by Paul Robinson
parent d0234bb183
commit e7a9ee78a8
35 changed files with 95 additions and 94 deletions

View File

@ -16,6 +16,10 @@ from libp2p.crypto.keys import (
PrivateKey,
PublicKey,
)
from libp2p.custom_types import (
StreamHandlerFn,
TProtocol,
)
from libp2p.host.defaults import (
get_default_protocols,
)
@ -53,10 +57,6 @@ from libp2p.protocol_muxer.multiselect_communicator import (
from libp2p.tools.async_service import (
background_trio_service,
)
from libp2p.typing import (
StreamHandlerFn,
TProtocol,
)
from .host_interface import (
IHost,

View File

@ -18,7 +18,7 @@ from libp2p.identity.identify.protocol import (
from libp2p.identity.identify.protocol import ID as IdentifyID
if TYPE_CHECKING:
from libp2p.typing import (
from libp2p.custom_types import (
StreamHandlerFn,
TProtocol,
)

View File

@ -16,6 +16,10 @@ from libp2p.crypto.keys import (
PrivateKey,
PublicKey,
)
from libp2p.custom_types import (
StreamHandlerFn,
TProtocol,
)
from libp2p.network.network_interface import (
INetworkService,
)
@ -28,10 +32,6 @@ from libp2p.peer.id import (
from libp2p.peer.peerinfo import (
PeerInfo,
)
from libp2p.typing import (
StreamHandlerFn,
TProtocol,
)
class IHost(ABC):

View File

@ -4,6 +4,9 @@ import time
import trio
from libp2p.custom_types import (
TProtocol,
)
from libp2p.host.host_interface import (
IHost,
)
@ -16,9 +19,6 @@ from libp2p.network.stream.net_stream_interface import (
INetStream,
)
from libp2p.peer.id import ID as PeerID
from libp2p.typing import (
TProtocol,
)
ID = TProtocol("/ipfs/ping/1.0.0")
PING_LENGTH = 32