diff --git a/libp2p/protocol_muxer/multiselect.py b/libp2p/protocol_muxer/multiselect.py index 06e268af..81267e3f 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 07ea5e7f..c940dfc8 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