def __init__(self, txInput: bytes, data: bytes, signature: bytes = bytes(64), proof: int = 0) -> None: self.txInput: bytes = txInput self.data: bytes = data self.hash: bytes = blake2b(b"\3" + txInput + data, digest_size=32).digest() self.signature: bytes = signature self.proof: int = proof self.argon: bytes = SpamFilter.run(self.hash, self.proof)
def __init__(self, inputs: List[Tuple[bytes, int]], outputs: List[Tuple[bytes, int]], signature: bytes = bytes(64), proof: int = 0) -> None: self.inputs: List[Tuple[bytes, int]] = inputs self.outputs: List[Tuple[bytes, int]] = outputs self.hash = blake2b(b"\2" + self.serializeInputs() + self.serializeOutputs(), digest_size=32).digest() self.signature: bytes = signature self.proof: int = proof self.argon: bytes = SpamFilter.run(self.hash, self.proof)