added is equals to transactions class

This commit is contained in:
Spekulaas 2024-01-04 16:29:41 +01:00
parent e4642d7a30
commit 119d328c98

View File

@ -15,6 +15,10 @@ class Tx:
self.sigs = []
self.reqd = []
def __eq__(self, __value: object) -> bool:
if isinstance(__value, Tx):
return self.inputs == __value.inputs and self.outputs == __value.outputs and self.sigs == __value.sigs and self.reqd == __value.reqd and self.type == __value.type
def add_input(self, from_addr, amount):
self.inputs.append((from_addr, amount))