Skip to content
Snippets Groups Projects
Commit 705b304c authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] revert return NotImplemented -> raise NotImplementedError()

parent f032a791
No related branches found
No related tags found
No related merge requests found
Pipeline #5704 passed
......@@ -109,7 +109,7 @@ class UnknownEndpoint(Endpoint):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, UnknownEndpoint):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.api == other.api and self.properties == other.properties
def __hash__(self) -> int:
......@@ -206,7 +206,7 @@ class BMAEndpoint(Endpoint):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, BMAEndpoint):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.server == other.server and self.ipv4 == other.ipv4 \
and self.ipv6 == other.ipv6 and self.port == other.port
......@@ -354,7 +354,7 @@ class WS2PEndpoint(Endpoint):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, WS2PEndpoint):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.server == other.server and self.ws2pid == other.ws2pid \
and self.port == other.port and self.path == other.path
......@@ -415,7 +415,7 @@ class ESCoreEndpoint(Endpoint):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, ESCoreEndpoint):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.server == other.server and self.port == other.port
def __hash__(self) -> int:
......@@ -475,7 +475,7 @@ class ESUserEndpoint(Endpoint):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, ESUserEndpoint):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.server == other.server and self.port == other.port
def __hash__(self) -> int:
......@@ -535,7 +535,7 @@ class ESSubscribtionEndpoint(Endpoint):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, ESSubscribtionEndpoint):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.server == other.server and self.port == other.port
def __hash__(self) -> int:
......
......@@ -479,7 +479,7 @@ Nonce: {nonce}
def __eq__(self, other: object) -> bool:
if not isinstance(other, Block):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.blockUID == other.blockUID
def __lt__(self, other: object) -> bool:
......
......@@ -51,27 +51,27 @@ class BlockUID:
def __eq__(self, other: object) -> bool:
if not isinstance(other, BlockUID):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.number == other.number and self.sha_hash == other.sha_hash
def __lt__(self, other: object) -> bool:
if not isinstance(other, BlockUID):
raise NotImplementedError("__lt__ is not implemented")
return NotImplemented
return self.number < other.number
def __gt__(self, other: object) -> bool:
if not isinstance(other, BlockUID):
raise NotImplementedError("__gt__ is not implemented")
return NotImplemented
return self.number > other.number
def __le__(self, other: object) -> bool:
if not isinstance(other, BlockUID):
raise NotImplementedError("__le__ is not implemented")
return NotImplemented
return self.number <= other.number
def __ge__(self, other: object) -> bool:
if not isinstance(other, BlockUID):
raise NotImplementedError("__ge__ is not implemented")
return NotImplemented
return self.number >= other.number
def __hash__(self) -> int:
......
......@@ -78,7 +78,7 @@ class InputSource:
Check InputSource instances equality
"""
if not isinstance(other, InputSource):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.amount == other.amount and \
self.base == other.base and \
self.source == other.source and \
......@@ -153,7 +153,7 @@ class OutputSource:
Check OutputSource instances equality
"""
if not isinstance(other, OutputSource):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.amount == other.amount and \
self.base == other.base and \
self.condition == other.condition
......@@ -236,7 +236,7 @@ class SIGParameter:
Check SIGParameter instances equality
"""
if not isinstance(other, SIGParameter):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.index == other.index
def __hash__(self) -> int:
......@@ -291,7 +291,7 @@ class XHXParameter:
Check XHXParameter instances equality
"""
if not isinstance(other, XHXParameter):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.integer == other.integer
def __hash__(self) -> int:
......@@ -380,7 +380,7 @@ class Unlock:
Check Unlock instances equality
"""
if not isinstance(other, Unlock):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
params_equals = True
for spar, opar in zip(self.parameters, other.parameters):
......@@ -524,7 +524,7 @@ class Transaction(Document):
Check Transaction instances equality
"""
if not isinstance(other, Transaction):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.version == other.version and \
self.currency == other.currency and \
self.signatures == other.signatures and \
......
......@@ -53,7 +53,7 @@ class SIG:
Check SIG instances equality
"""
if not isinstance(other, SIG):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.value == other.value and \
self.pubkey == other.pubkey
......@@ -112,7 +112,7 @@ class CSV:
Check CSV instances equality
"""
if not isinstance(other, CSV):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.value == other.value and \
self.time == other.time
......@@ -170,7 +170,7 @@ class CLTV:
Check CLTV instances equality
"""
if not isinstance(other, CLTV):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.value == other.value and \
self.timestamp == other.timestamp
......@@ -228,7 +228,7 @@ class XHX:
Check XHX instances equality
"""
if not isinstance(other, XHX):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.value == other.value and \
self.sha_hash == other.sha_hash
......@@ -320,7 +320,7 @@ class Condition:
Check Condition instances equality
"""
if not isinstance(other, Condition):
raise NotImplementedError("__eq__ is not implemented")
return NotImplemented
return self.value == other.value and \
self.left == other.left and \
self.right == other.right and \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment