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
16411afa
Commit
16411afa
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Removed BlockUID method (should use network blockUID)
parent
00bba5e6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sakia/core/community.py
+5
-20
5 additions, 20 deletions
src/sakia/core/community.py
with
5 additions
and
20 deletions
src/sakia/core/community.py
+
5
−
20
View file @
16411afa
...
...
@@ -241,7 +241,7 @@ class Community(QObject):
Get the community network instance.
:return: The community network instance.
:rtype: sakia.core.net.
network.
Network
:rtype: sakia.core.net.Network
"""
return
self
.
_network
...
...
@@ -261,13 +261,15 @@ class Community(QObject):
"""
return
await
self
.
bma_access
.
future_request
(
bma
.
blockchain
.
Parameters
)
async
def
certification_expired
(
self
,
certtime
):
async
def
certification_expired
(
self
,
cert
_
time
):
"""
Return True if the certificaton time is too old
:param int cert_time: the timestamp of the certification
"""
parameters
=
await
self
.
parameters
()
blockchain_time
=
await
self
.
time
()
return
blockchain_time
-
certtime
>
parameters
[
'
sigValidity
'
]
return
blockchain_time
-
cert
_
time
>
parameters
[
'
sigValidity
'
]
def
add_node
(
self
,
node
):
"""
...
...
@@ -301,23 +303,6 @@ class Community(QObject):
req_args
=
{
'
number
'
:
number
})
return
data
async
def
blockUID
(
self
):
"""
Get the block id.
:return: The current block ID as [NUMBER-HASH] format.
"""
try
:
block_number
=
self
.
network
.
current_blockUID
.
number
block
=
await
self
.
bma_access
.
future_request
(
bma
.
blockchain
.
Block
,
req_args
=
{
'
number
'
:
block_number
})
signed_raw
=
"
{0}{1}
\n
"
.
format
(
block
[
'
raw
'
],
block
[
'
signature
'
])
except
ValueError
as
e
:
if
'
404
'
in
str
(
e
):
return
BlockUID
.
empty
()
return
Block
.
from_signed_raw
(
signed_raw
).
blockUID
async
def
members_pubkeys
(
self
):
"""
Listing members pubkeys of a community
...
...
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