mirror of https://github.com/nucypher/nucypher.git
If self or other doesn't have a stamp, we regard these objects as unequal.
parent
d20a4cc8ad
commit
d6027c810a
|
@ -200,7 +200,11 @@ class Character(Learner):
|
|||
self.known_nodes.record_fleet_state()
|
||||
|
||||
def __eq__(self, other) -> bool:
|
||||
return bytes(self.stamp) == bytes(other.stamp)
|
||||
try:
|
||||
other_stamp = other.stamp
|
||||
except (AttributeError, NoSigningPower):
|
||||
return False
|
||||
return bytes(self.stamp) == bytes(other_stamp)
|
||||
|
||||
def __hash__(self):
|
||||
return int.from_bytes(bytes(self.stamp), byteorder="big")
|
||||
|
|
Loading…
Reference in New Issue