Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
248571b7
Commit
248571b7
authored
5 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] fix duniterpy OutputSource.condition attribute renamed
parent
7a59afba
No related branches found
No related tags found
1 merge request
!775
0.50.0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sakia/data/entities/transaction.py
+5
-5
5 additions, 5 deletions
src/sakia/data/entities/transaction.py
src/sakia/services/documents.py
+1
-1
1 addition, 1 deletion
src/sakia/services/documents.py
src/sakia/services/sources.py
+2
-2
2 additions, 2 deletions
src/sakia/services/sources.py
with
8 additions
and
8 deletions
src/sakia/data/entities/transaction.py
+
5
−
5
View file @
248571b7
...
...
@@ -21,15 +21,15 @@ def parse_transaction_doc(tx_doc, pubkey, block_number, mediantime, txid):
:return: the found transaction
"""
receivers
=
[
o
.
condition
s
.
left
.
pubkey
o
.
condition
.
left
.
pubkey
for
o
in
tx_doc
.
outputs
if
o
.
condition
s
.
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
.
condition
s
.
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
.
condition
s
.
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
.
condition
s
.
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
)
...
...
This diff is collapsed.
Click to expand it.
src/sakia/services/documents.py
+
1
−
1
View file @
248571b7
...
...
@@ -420,7 +420,7 @@ class DocumentsService:
:return:
"""
for
offset
,
output
in
enumerate
(
txdoc
.
outputs
):
if
output
.
condition
s
.
left
.
pubkey
==
pubkey
:
if
output
.
condition
.
left
.
pubkey
==
pubkey
:
source
=
Source
(
currency
=
currency
,
pubkey
=
pubkey
,
...
...
This diff is collapsed.
Click to expand it.
src/sakia/services/sources.py
+
2
−
2
View file @
248571b7
...
...
@@ -53,7 +53,7 @@ class SourcesServices(QObject):
"""
txdoc
=
TransactionDoc
.
from_signed_raw
(
transaction
.
raw
)
for
offset
,
output
in
enumerate
(
txdoc
.
outputs
):
if
output
.
condition
s
.
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
.
condition
s
.
left
.
pubkey
==
pubkey
:
if
output
.
condition
.
left
.
pubkey
==
pubkey
:
source
=
Source
(
currency
=
self
.
currency
,
pubkey
=
pubkey
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment