Skip to content

Commit 54b33a7

Browse files
LogicalGuy77seetadev
authored andcommitted
fix: correct spelling of 'negotiate_timeout' in multiple files (#909)
* fix: correct spelling of 'negotiate_timeout' in multiple files * added news fragment * Fix negotiate_timeout parameter and newsfragment file name --------- Co-authored-by: Manu Sheel Gupta <[email protected]>
1 parent 35b7a09 commit 54b33a7

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

libp2p/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def new_host(
361361
network=swarm,
362362
enable_mDNS=enable_mDNS,
363363
bootstrap=bootstrap,
364-
negotitate_timeout=negotiate_timeout
364+
negotiate_timeout=negotiate_timeout
365365
)
366366

367367

libp2p/host/basic_host.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ def __init__(
9696
enable_mDNS: bool = False,
9797
bootstrap: list[str] | None = None,
9898
default_protocols: Optional["OrderedDict[TProtocol, StreamHandlerFn]"] = None,
99-
negotitate_timeout: int = DEFAULT_NEGOTIATE_TIMEOUT,
99+
negotiate_timeout: int = DEFAULT_NEGOTIATE_TIMEOUT,
100100
) -> None:
101101
self._network = network
102102
self._network.set_stream_handler(self._swarm_stream_handler)
103103
self.peerstore = self._network.peerstore
104-
self.negotiate_timeout = negotitate_timeout
104+
self.negotiate_timeout = negotiate_timeout
105105
# Protocol muxing
106106
default_protocols = default_protocols or get_default_protocols(self)
107107
self.multiselect = Multiselect(dict(default_protocols.items()))

libp2p/protocol_muxer/multiselect_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ async def select_one_of(
5454
self,
5555
protocols: Sequence[TProtocol],
5656
communicator: IMultiselectCommunicator,
57-
negotitate_timeout: int = DEFAULT_NEGOTIATE_TIMEOUT,
57+
negotiate_timeout: int = DEFAULT_NEGOTIATE_TIMEOUT,
5858
) -> TProtocol:
5959
"""
6060
For each protocol, send message to multiselect selecting protocol and
6161
fail if multiselect does not return same protocol. Returns first
6262
protocol that multiselect agrees on (i.e. that multiselect selects)
6363
64-
:param protocol: protocol to select
64+
:param protocols: protocols to select from
6565
:param communicator: communicator to use to communicate with counterparty
6666
:param negotiate_timeout: timeout for negotiation
6767
:return: selected protocol
6868
:raise MultiselectClientError: raised when protocol negotiation failed
6969
"""
7070
try:
71-
with trio.fail_after(negotitate_timeout):
71+
with trio.fail_after(negotiate_timeout):
7272
await self.handshake(communicator)
7373

7474
for protocol in protocols:

newsfragments/908.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a typo in the ``negotiate_timeout`` parameter name.

0 commit comments

Comments
 (0)