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
10baa721
Commit
10baa721
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Check if block doc is correct
parent
752b21b8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
res/ui/transactions_tab.ui
+1
-1
1 addition, 1 deletion
res/ui/transactions_tab.ui
src/cutecoin/core/txhistory.py
+15
-10
15 additions, 10 deletions
src/cutecoin/core/txhistory.py
src/cutecoin/gui/transactions_tab.py
+9
-0
9 additions, 0 deletions
src/cutecoin/gui/transactions_tab.py
with
25 additions
and
11 deletions
res/ui/transactions_tab.ui
+
1
−
1
View file @
10baa721
...
...
@@ -15,7 +15,7 @@
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"group
B
ox_
2
"
>
<widget
class=
"QGroupBox"
name=
"group
b
ox_
balance
"
>
<property
name=
"title"
>
<string>
Balance
</string>
</property>
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/core/txhistory.py
+
15
−
10
View file @
10baa721
...
...
@@ -163,16 +163,21 @@ class TxHistory():
@asyncio.coroutine
def
_parse_block
(
self
,
community
,
block_number
,
received_list
,
current_block
,
txmax
):
block
=
yield
from
community
.
bma_access
.
future_request
(
qtbma
.
blockchain
.
Block
,
req_args
=
{
'
number
'
:
block_number
})
signed_raw
=
"
{0}{1}
\n
"
.
format
(
block
[
'
raw
'
],
block
[
'
signature
'
])
transfers
=
[]
try
:
block_doc
=
Block
.
from_signed_raw
(
signed_raw
)
except
:
logging
.
debug
(
"
Error in {0}
"
.
format
(
block_number
))
raise
block
=
None
tries
=
0
while
block
is
None
and
tries
<
3
:
block
=
yield
from
community
.
bma_access
.
future_request
(
qtbma
.
blockchain
.
Block
,
req_args
=
{
'
number
'
:
block_number
})
signed_raw
=
"
{0}{1}
\n
"
.
format
(
block
[
'
raw
'
],
block
[
'
signature
'
])
transfers
=
[]
try
:
block_doc
=
Block
.
from_signed_raw
(
signed_raw
)
except
:
logging
.
debug
(
"
Error in {0}
"
.
format
(
block_number
))
block
=
None
tries
+=
1
for
(
txid
,
tx
)
in
enumerate
(
block_doc
.
transactions
):
transfer
=
yield
from
self
.
_parse_transaction
(
community
,
tx
,
block_number
,
block_doc
.
mediantime
,
received_list
,
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/gui/transactions_tab.py
+
9
−
0
View file @
10baa721
...
...
@@ -14,6 +14,7 @@ from ..core.registry import Identity
from
..tools.decorators
import
asyncify
,
once_at_a_time
,
cancel_once_task
from
.transfer
import
TransferMoneyDialog
from
.
import
toast
from
.busy
import
Busy
import
logging
import
asyncio
...
...
@@ -39,6 +40,8 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
self
.
account
=
None
self
.
community
=
None
self
.
password_asker
=
None
self
.
busy_balance
=
Busy
(
self
.
groupbox_balance
)
self
.
busy_balance
.
hide
()
ts_from
=
self
.
date_from
.
dateTime
().
toTime_t
()
ts_to
=
self
.
date_to
.
dateTime
().
toTime_t
()
...
...
@@ -127,6 +130,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
@asyncify
@asyncio.coroutine
def
refresh_balance
(
self
):
self
.
busy_balance
.
show
()
amount
=
yield
from
self
.
app
.
current_account
.
amount
(
self
.
community
)
localized_amount
=
yield
from
self
.
app
.
current_account
.
current_ref
(
amount
,
self
.
community
,
self
.
app
).
localized
(
units
=
True
,
...
...
@@ -139,6 +143,7 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
localized_amount
)
)
self
.
busy_balance
.
hide
()
@once_at_a_time
@asyncify
...
...
@@ -294,6 +299,10 @@ QMessageBox.Ok | QMessageBox.Cancel)
self
.
refresh_balance
()
def
resizeEvent
(
self
,
event
):
self
.
busy_balance
.
resize
(
event
.
size
())
super
().
resizeEvent
(
event
)
def
changeEvent
(
self
,
event
):
"""
Intercepte LanguageChange event to translate UI
...
...
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