mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
fixing linting errors with protocol_muxer and adding to Travis
This commit is contained in:
@ -72,21 +72,22 @@ class Multiselect(IMultiselectMuxer):
|
||||
handshake_contents = await communicator.read_stream_until_eof()
|
||||
|
||||
# Confirm that the protocols are the same
|
||||
if not self.validate_handshake(handshake_contents):
|
||||
if not validate_handshake(handshake_contents):
|
||||
raise MultiselectError("multiselect protocol ID mismatch")
|
||||
|
||||
# Handshake succeeded if this point is reached
|
||||
|
||||
def validate_handshake(self, handshake_contents):
|
||||
"""
|
||||
Determine if handshake is valid and should be confirmed
|
||||
:param handshake_contents: contents of handshake message
|
||||
:return: true if handshake is complete, false otherwise
|
||||
"""
|
||||
|
||||
# TODO: Modify this when format used by go repo for messages
|
||||
# is added
|
||||
return handshake_contents == MULTISELECT_PROTOCOL_ID
|
||||
def validate_handshake(handshake_contents):
|
||||
"""
|
||||
Determine if handshake is valid and should be confirmed
|
||||
:param handshake_contents: contents of handshake message
|
||||
:return: true if handshake is complete, false otherwise
|
||||
"""
|
||||
|
||||
# TODO: Modify this when format used by go repo for messages
|
||||
# is added
|
||||
return handshake_contents == MULTISELECT_PROTOCOL_ID
|
||||
|
||||
class MultiselectError(ValueError):
|
||||
"""Raised when an error occurs in multiselect process"""
|
||||
|
||||
Reference in New Issue
Block a user