mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
prevent adding None as fulfillment / condition to Transaction
This commit is contained in:
parent
470f2694d7
commit
39940d2a71
@ -499,17 +499,13 @@ class Transaction(object):
|
|||||||
return inputs
|
return inputs
|
||||||
|
|
||||||
def add_fulfillment(self, fulfillment):
|
def add_fulfillment(self, fulfillment):
|
||||||
if (fulfillment is not None and not
|
if not isinstance(fulfillment, Fulfillment):
|
||||||
isinstance(fulfillment, Fulfillment)):
|
raise TypeError('`fulfillment` must be a Fulfillment instance')
|
||||||
raise TypeError('`fulfillment` must be a Fulfillment instance or '
|
|
||||||
'None')
|
|
||||||
else:
|
|
||||||
self.fulfillments.append(fulfillment)
|
self.fulfillments.append(fulfillment)
|
||||||
|
|
||||||
def add_condition(self, condition):
|
def add_condition(self, condition):
|
||||||
if condition is not None and not isinstance(condition, Condition):
|
if not isinstance(condition, Condition):
|
||||||
raise TypeError('`condition` must be a Condition instance or None')
|
raise TypeError('`condition` must be a Condition instance or None')
|
||||||
else:
|
|
||||||
self.conditions.append(condition)
|
self.conditions.append(condition)
|
||||||
|
|
||||||
def sign(self, private_keys):
|
def sign(self, private_keys):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user