Skip to content
Snippets Groups Projects
Commit 248571b7 authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] fix duniterpy OutputSource.condition attribute renamed

parent 7a59afba
No related branches found
No related tags found
1 merge request!7750.50.0
......@@ -21,15 +21,15 @@ def parse_transaction_doc(tx_doc, pubkey, block_number, mediantime, txid):
:return: the found transaction
"""
receivers = [
o.conditions.left.pubkey
o.condition.left.pubkey
for o in tx_doc.outputs
if o.conditions.left.pubkey != tx_doc.issuers[0]
if o.condition.left.pubkey != tx_doc.issuers[0]
]
in_issuers = len([i for i in tx_doc.issuers if i == pubkey]) > 0
in_outputs = (
len([o for o in tx_doc.outputs if o.conditions.left.pubkey == pubkey]) > 0
len([o for o in tx_doc.outputs if o.condition.left.pubkey == pubkey]) > 0
)
if len(receivers) == 0 and in_issuers:
......@@ -43,14 +43,14 @@ def parse_transaction_doc(tx_doc, pubkey, block_number, mediantime, txid):
elif in_issuers or in_outputs:
# If the wallet pubkey is in the issuers we sent this transaction
if in_issuers:
outputs = [o for o in tx_doc.outputs if o.conditions.left.pubkey != pubkey]
outputs = [o for o in tx_doc.outputs if o.condition.left.pubkey != pubkey]
amount = 0
for o in outputs:
amount += o.amount * math.pow(10, o.base)
# If we are not in the issuers,
# maybe we are in the recipients of this transaction
else:
outputs = [o for o in tx_doc.outputs if o.conditions.left.pubkey == pubkey]
outputs = [o for o in tx_doc.outputs if o.condition.left.pubkey == pubkey]
amount = 0
for o in outputs:
amount += o.amount * math.pow(10, o.base)
......
......@@ -420,7 +420,7 @@ class DocumentsService:
:return:
"""
for offset, output in enumerate(txdoc.outputs):
if output.conditions.left.pubkey == pubkey:
if output.condition.left.pubkey == pubkey:
source = Source(
currency=currency,
pubkey=pubkey,
......
......@@ -53,7 +53,7 @@ class SourcesServices(QObject):
"""
txdoc = TransactionDoc.from_signed_raw(transaction.raw)
for offset, output in enumerate(txdoc.outputs):
if output.conditions.left.pubkey == pubkey:
if output.condition.left.pubkey == pubkey:
source = Source(
currency=self.currency,
pubkey=pubkey,
......@@ -218,7 +218,7 @@ class SourcesServices(QObject):
"""
txdoc = TransactionDoc.from_signed_raw(tx.raw)
for offset, output in enumerate(txdoc.outputs):
if output.conditions.left.pubkey == pubkey:
if output.condition.left.pubkey == pubkey:
source = Source(
currency=self.currency,
pubkey=pubkey,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment