mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 06:25:45 +00:00
added zenroom fulfillment verification
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
3f28ddd990
commit
ca4a9cf949
@ -508,9 +508,21 @@ class Transaction(object):
|
|||||||
ccffill = input_.fulfillment
|
ccffill = input_.fulfillment
|
||||||
try:
|
try:
|
||||||
parsed_ffill = Fulfillment.from_uri(ccffill.serialize_uri())
|
parsed_ffill = Fulfillment.from_uri(ccffill.serialize_uri())
|
||||||
except (TypeError, ValueError,
|
except TypeError as e:
|
||||||
ParsingError, ASN1DecodeError, ASN1EncodeError):
|
print( f"Exception TypeError : {e}")
|
||||||
return False
|
return False;
|
||||||
|
except ValueError as e:
|
||||||
|
print( f"Exception ValueError : {e}")
|
||||||
|
return False;
|
||||||
|
except ParsingError as e:
|
||||||
|
print( f"Exception ParsingError : {e}")
|
||||||
|
return False;
|
||||||
|
except ASN1DecodeError as e:
|
||||||
|
print( f"Exception ASN1DecodeError : {e}")
|
||||||
|
return False;
|
||||||
|
except ASN1EncodeError as e:
|
||||||
|
print( f"Exception ASN1EncodeError : {e}")
|
||||||
|
return False;
|
||||||
|
|
||||||
if operation == self.CREATE:
|
if operation == self.CREATE:
|
||||||
# NOTE: In the case of a `CREATE` transaction, the
|
# NOTE: In the case of a `CREATE` transaction, the
|
||||||
@ -519,6 +531,10 @@ class Transaction(object):
|
|||||||
else:
|
else:
|
||||||
output_valid = output_condition_uri == ccffill.condition_uri
|
output_valid = output_condition_uri == ccffill.condition_uri
|
||||||
|
|
||||||
|
ffill_valid = False
|
||||||
|
if isinstance( parsed_ffill, ZenroomSha256 ):
|
||||||
|
ffill_valid = parsed_ffill.validate(message=message)
|
||||||
|
else:
|
||||||
message = sha3_256(message.encode())
|
message = sha3_256(message.encode())
|
||||||
if input_.fulfills:
|
if input_.fulfills:
|
||||||
message.update('{}{}'.format(
|
message.update('{}{}'.format(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user