From 4bda366bb8702744f631053edfa012e9f1adfb8a Mon Sep 17 00:00:00 2001 From: Dominik Muhs Date: Thu, 24 Oct 2019 19:25:09 +0200 Subject: [PATCH] Rename protocol muxer initiator flags --- libp2p/protocol_muxer/multiselect.py | 4 ++-- libp2p/protocol_muxer/multiselect_client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libp2p/protocol_muxer/multiselect.py b/libp2p/protocol_muxer/multiselect.py index 06e268a..81267e3 100644 --- a/libp2p/protocol_muxer/multiselect.py +++ b/libp2p/protocol_muxer/multiselect.py @@ -84,14 +84,14 @@ class Multiselect(IMultiselectMuxer): except MultiselectCommunicatorError as error: raise MultiselectError(error) - if not validate_handshake(handshake_contents): + if not is_valid_handshake(handshake_contents): raise MultiselectError( "multiselect protocol ID mismatch: " f"received handshake_contents={handshake_contents}" ) -def validate_handshake(handshake_contents: str) -> bool: +def is_valid_handshake(handshake_contents: str) -> bool: """ Determine if handshake is valid and should be confirmed :param handshake_contents: contents of handshake message diff --git a/libp2p/protocol_muxer/multiselect_client.py b/libp2p/protocol_muxer/multiselect_client.py index 07ea5e7..c940dfc 100644 --- a/libp2p/protocol_muxer/multiselect_client.py +++ b/libp2p/protocol_muxer/multiselect_client.py @@ -33,7 +33,7 @@ class MultiselectClient(IMultiselectClient): except MultiselectCommunicatorError as error: raise MultiselectClientError(str(error)) - if not validate_handshake(handshake_contents): + if not is_valid_handshake(handshake_contents): raise MultiselectClientError("multiselect protocol ID mismatch") async def select_one_of( @@ -86,7 +86,7 @@ class MultiselectClient(IMultiselectClient): raise MultiselectClientError("unrecognized response: " + response) -def validate_handshake(handshake_contents: str) -> bool: +def is_valid_handshake(handshake_contents: str) -> bool: """ Determine if handshake is valid and should be confirmed :param handshake_contents: contents of handshake message