def verify(self): """Verify the transaction. Method will raise an exception if invalid, if it's valid nothing will happen. """ transaction = self.to_bytes() message = Message(transaction, self.signature, self.senderPublicKey) is_valid = message.verify() if not is_valid: raise ArkInvalidTransaction('Transaction could not be verified')
def verify_schnorr_secondsig(self, secondPublicKey): """Verify the transaction. Method will raise an exception if invalid, if it's valid it will returns True """ is_valid = schnorr.b410_schnorr_verify(self.to_bytes(False, True), secondPublicKey, self.signSignature) if not is_valid: raise ArkInvalidTransaction('Transaction could not be verified')
def second_verify(self, passphrase): """Verify the transaction using the 2nd passphrase Args: passphrase (str): 2nd passphrase associated with the account sending this transaction """ transaction = sha256(self.to_bytes()).digest() message = Message(transaction, self.signSignature, self.senderPublicKey) is_valid = message.verify() if not is_valid: raise ArkInvalidTransaction('Transaction could not be verified')
def verify_schnorr_multisig(self): """Verify the multisignatures transaction. Method will raise an exception if invalid, it will returns True """ is_valid = schnorr.b410_schnorr_verify( self.to_bytes(True, True, False), self.senderPublicKey, self.signature) if not is_valid: raise ArkInvalidTransaction('Transaction could not be verified') return is_valid