mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
PR comments
This commit is contained in:
parent
f5f4c17839
commit
db06970b1a
@ -256,15 +256,21 @@ def create_tx(current_owners, new_owners, inputs, operation, payload=None):
|
||||
# handle outputs
|
||||
conditions = []
|
||||
for fulfillment in fulfillments:
|
||||
condition = None
|
||||
|
||||
# threshold condition
|
||||
if len(new_owners) > 1:
|
||||
condition = cc.ThresholdSha256Fulfillment(threshold=len(new_owners))
|
||||
for new_owner in new_owners:
|
||||
condition.add_subfulfillment(cc.Ed25519Fulfillment(public_key=new_owner))
|
||||
|
||||
# simple signature condition
|
||||
elif len(new_owners) == 1:
|
||||
condition = cc.Ed25519Fulfillment(public_key=new_owners[0])
|
||||
|
||||
# The None case appears on assigning a hashlock
|
||||
# to be added later (hashlock conditions)
|
||||
else:
|
||||
condition = None
|
||||
|
||||
if condition:
|
||||
conditions.append({
|
||||
'new_owners': new_owners,
|
||||
|
@ -765,7 +765,6 @@ first_tx_condition = cc.PreimageSha256Fulfillment(preimage=secret)
|
||||
# The conditions list is empty, so we need to append a new condition
|
||||
hashlock_tx['transaction']['conditions'].append({
|
||||
'condition': {
|
||||
'details': json.loads(first_tx_condition.serialize_json()),
|
||||
'uri': first_tx_condition.condition.serialize_uri()
|
||||
},
|
||||
'cid': 0,
|
||||
@ -795,12 +794,6 @@ hashlock_tx_signed
|
||||
{
|
||||
"cid":0,
|
||||
"condition":{
|
||||
"details":{
|
||||
"bitmask":3,
|
||||
"preimage":"much secret! wow!",
|
||||
"type":"fulfillment",
|
||||
"type_id":0
|
||||
},
|
||||
"uri":"cc:0:3:nsW2IiYgk9EUtsg4uBe3pBnOgRoAEX2IIsPgjqZz47U:17"
|
||||
},
|
||||
"new_owners":None
|
||||
|
@ -247,7 +247,6 @@ first_tx_condition = cc.PreimageSha256Fulfillment(preimage=secret)
|
||||
# The conditions list is empty, so we need to append a new condition
|
||||
hashlock_tx['transaction']['conditions'].append({
|
||||
'condition': {
|
||||
'details': json.loads(first_tx_condition.serialize_json()),
|
||||
'uri': first_tx_condition.condition.serialize_uri()
|
||||
},
|
||||
'cid': 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user