PR comments

This commit is contained in:
diminator 2016-05-03 11:18:57 +02:00
parent f5f4c17839
commit db06970b1a
No known key found for this signature in database
GPG Key ID: C3D8590E6D0D439A
3 changed files with 8 additions and 10 deletions

View File

@ -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,

View File

@ -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

View File

@ -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,