make some dilation objects hashable

necessary to include them in a set like _pending_connectors
This commit is contained in:
Brian Warner 2019-01-12 14:16:35 -08:00
parent be2dc01a94
commit d1ff97f988
3 changed files with 3 additions and 3 deletions

View File

@ -393,7 +393,7 @@ class _Record(object):
self._framer.send_frame(frame)
@attrs
@attrs(hash=True)
class DilatedConnectionProtocol(Protocol, object):
"""I manage an L2 connection.

View File

@ -39,7 +39,7 @@ NOISEPROTO = b"Noise_NNpsk0_25519_ChaChaPoly_BLAKE2s"
def build_noise():
return NoiseConnection.from_name(NOISEPROTO)
@attrs
@attrs(hash=True)
@implementer(IDilationConnector)
class Connector(object):
_dilation_key = attrib(validator=instance_of(type(b"")))

View File

@ -87,7 +87,7 @@ def make_side():
# * if follower calls w.dilate() but not leader, follower waits forever
# in "want", leader waits forever in "wanted"
@attrs
@attrs(hash=True)
@implementer(IDilationManager)
class Manager(object):
_S = attrib(validator=provides(ISend))