mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Catch CC Error for Fulfillment
This commit is contained in:
parent
2ae5d49783
commit
ab3473b0a0
@ -3,26 +3,15 @@ from functools import reduce
|
||||
from operator import and_
|
||||
from uuid import uuid4
|
||||
|
||||
from cryptoconditions import (
|
||||
Fulfillment as CCFulfillment,
|
||||
ThresholdSha256Fulfillment,
|
||||
Ed25519Fulfillment,
|
||||
PreimageSha256Fulfillment,
|
||||
)
|
||||
from cryptoconditions import (Fulfillment as CCFulfillment,
|
||||
ThresholdSha256Fulfillment, Ed25519Fulfillment,
|
||||
PreimageSha256Fulfillment)
|
||||
from cryptoconditions.exceptions import ParsingError
|
||||
|
||||
from bigchaindb_common.crypto import (
|
||||
SigningKey,
|
||||
hash_data,
|
||||
)
|
||||
from bigchaindb_common.exceptions import (
|
||||
KeypairMismatchException,
|
||||
InvalidHash,
|
||||
)
|
||||
from bigchaindb_common.util import (
|
||||
serialize,
|
||||
gen_timestamp,
|
||||
)
|
||||
from bigchaindb_common.crypto import SigningKey, hash_data
|
||||
from bigchaindb_common.exceptions import (KeypairMismatchException,
|
||||
InvalidHash, InvalidSignature)
|
||||
from bigchaindb_common.util import serialize, gen_timestamp
|
||||
|
||||
|
||||
class Fulfillment(object):
|
||||
@ -77,6 +66,9 @@ class Fulfillment(object):
|
||||
"""
|
||||
try:
|
||||
fulfillment = CCFulfillment.from_uri(ffill['fulfillment'])
|
||||
except ValueError:
|
||||
# TODO FOR CC: Throw an `InvalidSignature` error in this case.
|
||||
raise InvalidSignature("Fulfillment URI could'nt been parsed")
|
||||
except TypeError:
|
||||
# NOTE: See comment about this special case in
|
||||
# `Fulfillment.to_dict`
|
||||
|
Loading…
x
Reference in New Issue
Block a user