Skip to content

Commit 01ece88

Browse files
committed
feat(transaction): __eq__ method
1 parent f193f1e commit 01ece88

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

transaction.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ def __init__(self, sender_address, recipient_address, value):
2222
self.value = value
2323
self.signature = None
2424

25+
def __eq__(self, other):
26+
if isinstance(other, self.__class__):
27+
return self.__dict__ == other.__dict__
28+
29+
return False
30+
2531
def to_dict(self):
2632
return OrderedDict({'sender_address': self.sender_address,
2733
'recipient_address': self.recipient_address,

0 commit comments

Comments
 (0)