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
GitLab 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
5caa069d
Commit
5caa069d
authored
8 years ago
by
inso
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' of github.com:duniter/sakia into dev
parents
5bcd970f
6f749be8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/core/txhistory.py
+4
-3
4 additions, 3 deletions
src/sakia/core/txhistory.py
src/sakia/gui/informations_tab.py
+3
-2
3 additions, 2 deletions
src/sakia/gui/informations_tab.py
with
7 additions
and
5 deletions
src/sakia/core/txhistory.py
+
4
−
3
View file @
5caa069d
import
asyncio
import
asyncio
import
logging
import
logging
import
hashlib
import
hashlib
import
math
from
duniterpy.documents.transaction
import
SimpleTransaction
from
duniterpy.documents.transaction
import
SimpleTransaction
from
duniterpy.documents.block
import
Block
from
duniterpy.documents.block
import
Block
from
duniterpy.api
import
bma
,
errors
from
duniterpy.api
import
bma
,
errors
...
@@ -9,7 +10,7 @@ from .net.network import MAX_CONFIRMATIONS
...
@@ -9,7 +10,7 @@ from .net.network import MAX_CONFIRMATIONS
from
..tools.exceptions
import
LookupFailureError
,
NoPeerAvailable
from
..tools.exceptions
import
LookupFailureError
,
NoPeerAvailable
class
TxHistory
()
:
class
TxHistory
:
def
__init__
(
self
,
app
,
wallet
):
def
__init__
(
self
,
app
,
wallet
):
self
.
_latest_block
=
0
self
.
_latest_block
=
0
self
.
wallet
=
wallet
self
.
wallet
=
wallet
...
@@ -169,7 +170,7 @@ class TxHistory():
...
@@ -169,7 +170,7 @@ class TxHistory():
if
o
.
conditions
.
left
.
pubkey
!=
self
.
wallet
.
pubkey
]
if
o
.
conditions
.
left
.
pubkey
!=
self
.
wallet
.
pubkey
]
amount
=
0
amount
=
0
for
o
in
outputs
:
for
o
in
outputs
:
amount
+=
o
.
amount
amount
+=
o
.
amount
*
math
.
pow
(
10
,
o
.
base
)
metadata
[
'
amount
'
]
=
amount
metadata
[
'
amount
'
]
=
amount
transfer
=
Transfer
.
create_from_blockchain
(
tx_hash
,
transfer
=
Transfer
.
create_from_blockchain
(
tx_hash
,
blockUID
,
blockUID
,
...
@@ -182,7 +183,7 @@ class TxHistory():
...
@@ -182,7 +183,7 @@ class TxHistory():
if
o
.
conditions
.
left
.
pubkey
==
self
.
wallet
.
pubkey
]
if
o
.
conditions
.
left
.
pubkey
==
self
.
wallet
.
pubkey
]
amount
=
0
amount
=
0
for
o
in
outputs
:
for
o
in
outputs
:
amount
+=
o
.
amount
amount
+=
o
.
amount
*
math
.
pow
(
10
,
o
.
base
)
metadata
[
'
amount
'
]
=
amount
metadata
[
'
amount
'
]
=
amount
transfer
=
Transfer
.
create_from_blockchain
(
tx_hash
,
transfer
=
Transfer
.
create_from_blockchain
(
tx_hash
,
...
...
This diff is collapsed.
Click to expand it.
src/sakia/gui/informations_tab.py
+
3
−
2
View file @
5caa069d
...
@@ -5,6 +5,7 @@ Created on 31 janv. 2015
...
@@ -5,6 +5,7 @@ Created on 31 janv. 2015
"""
"""
import
logging
import
logging
import
math
from
PyQt5.QtCore
import
QLocale
,
QDateTime
,
QEvent
from
PyQt5.QtCore
import
QLocale
,
QDateTime
,
QEvent
from
PyQt5.QtWidgets
import
QWidget
from
PyQt5.QtWidgets
import
QWidget
from
..gen_resources.informations_tab_uic
import
Ui_InformationsTabWidget
from
..gen_resources.informations_tab_uic
import
Ui_InformationsTabWidget
...
@@ -77,7 +78,7 @@ class InformationsTabWidget(QWidget, Ui_InformationsTabWidget):
...
@@ -77,7 +78,7 @@ class InformationsTabWidget(QWidget, Ui_InformationsTabWidget):
if
block_ud
:
if
block_ud
:
# display float values
# display float values
localized_ud
=
await
self
.
account
.
current_ref
.
instance
(
block_ud
[
'
dividend
'
],
localized_ud
=
await
self
.
account
.
current_ref
.
instance
(
block_ud
[
'
dividend
'
]
*
math
.
pow
(
10
,
block_ud
[
'
unitbase
'
])
,
self
.
community
,
self
.
community
,
self
.
app
)
\
self
.
app
)
\
.
diff_localized
(
True
,
self
.
app
.
preferences
[
'
international_system_of_units
'
])
.
diff_localized
(
True
,
self
.
app
.
preferences
[
'
international_system_of_units
'
])
...
@@ -117,7 +118,7 @@ class InformationsTabWidget(QWidget, Ui_InformationsTabWidget):
...
@@ -117,7 +118,7 @@ class InformationsTabWidget(QWidget, Ui_InformationsTabWidget):
if
block_ud
[
'
membersCount
'
]
==
0
or
block_ud_minus_1
[
'
monetaryMass
'
]
==
0
:
if
block_ud
[
'
membersCount
'
]
==
0
or
block_ud_minus_1
[
'
monetaryMass
'
]
==
0
:
actual_growth
=
float
(
0
)
actual_growth
=
float
(
0
)
else
:
else
:
actual_growth
=
block_ud
[
'
dividend
'
]
/
(
block_ud_minus_1
[
'
monetaryMass
'
]
/
block_ud
[
'
membersCount
'
])
actual_growth
=
(
block_ud
[
'
dividend
'
]
*
math
.
pow
(
10
,
block_ud
[
'
unitbase
'
]))
/
(
block_ud_minus_1
[
'
monetaryMass
'
]
/
block_ud
[
'
membersCount
'
])
localized_ud_median_time_minus_1
=
QLocale
.
toString
(
localized_ud_median_time_minus_1
=
QLocale
.
toString
(
QLocale
(),
QLocale
(),
...
...
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