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
d920eb00
Commit
d920eb00
authored
8 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug
#584
parent
61fb2c46
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/sakia/data/graphs/base_graph.py
+10
-5
10 additions, 5 deletions
src/sakia/data/graphs/base_graph.py
src/sakia/data/processors/identities.py
+1
-1
1 addition, 1 deletion
src/sakia/data/processors/identities.py
src/sakia/services/identities.py
+5
-2
5 additions, 2 deletions
src/sakia/services/identities.py
with
16 additions
and
8 deletions
src/sakia/data/graphs/base_graph.py
+
10
−
5
View file @
d920eb00
...
...
@@ -66,11 +66,14 @@ class BaseGraph(QObject):
"""
# new node
node_status
=
NodeStatus
.
NEUTRAL
try
:
if
node_identity
.
pubkey
==
account_identity
.
pubkey
:
node_status
+=
NodeStatus
.
HIGHLIGHTED
if
node_identity
.
member
is
False
:
node_status
+=
NodeStatus
.
OUT
return
node_status
except
AttributeError
:
pass
def
confirmation_text
(
self
,
block_number
):
"""
...
...
@@ -203,6 +206,7 @@ class BaseGraph(QObject):
certifier
=
self
.
identities_service
.
get_identity
(
certification
.
certifier
)
if
not
certifier
:
certifier
=
await
self
.
identities_service
.
find_from_pubkey
(
certification
.
certifier
)
self
.
identities_service
.
insert_or_update_identity
(
certifier
)
node_status
=
await
self
.
node_status
(
certifier
,
account_identity
)
self
.
add_certifier_node
(
certifier
,
identity
,
certification
,
node_status
)
except
NoPeerAvailable
as
e
:
...
...
@@ -222,6 +226,7 @@ class BaseGraph(QObject):
certified
=
self
.
identities_service
.
get_identity
(
certification
.
certified
)
if
not
certified
:
certified
=
await
self
.
identities_service
.
find_from_pubkey
(
certification
.
certified
)
self
.
identities_service
.
insert_or_update_identity
(
certified
)
node_status
=
await
self
.
node_status
(
certified
,
account_identity
)
self
.
add_certified_node
(
identity
,
certified
,
certification
,
node_status
)
...
...
This diff is collapsed.
Click to expand it.
src/sakia/data/processors/identities.py
+
1
−
1
View file @
d920eb00
...
...
@@ -153,7 +153,7 @@ class IdentitiesProcessor:
req_args
=
{
'
search
'
:
identity
.
pubkey
})
identity_data
=
next
((
data
for
data
in
requirements_data
[
"
identities
"
]
if
data
[
"
pubkey
"
]
==
identity
.
pubkey
))
identity
.
member
=
identity_data
[
'
membershipExpiresIn
'
]
>
0
and
not
identity_data
[
'
outdistanced
'
]
identity
.
member
=
identity_data
[
'
membershipExpiresIn
'
]
>
0
identity
.
outdistanced
=
identity_data
[
'
outdistanced
'
]
self
.
insert_or_update_identity
(
identity
)
except
errors
.
DuniterError
as
e
:
...
...
This diff is collapsed.
Click to expand it.
src/sakia/services/identities.py
+
5
−
2
View file @
d920eb00
...
...
@@ -377,12 +377,12 @@ class IdentitiesService(QObject):
identity
.
blockstamp
=
block_uid
(
identity_data
[
"
meta
"
][
"
timestamp
"
])
identity
.
timestamp
=
await
self
.
_blockchain_processor
.
timestamp
(
self
.
currency
,
identity
.
blockstamp
.
number
)
identity
.
outdistanced
=
identity_data
[
"
outdistanced
"
]
identity
.
member
=
identity_data
[
"
membershipExpiresIn
"
]
>
0
and
not
identity_data
[
"
outdistanced
"
]
identity
.
member
=
identity_data
[
"
membershipExpiresIn
"
]
>
0
median_time
=
self
.
_blockchain_processor
.
time
(
self
.
currency
)
expiration_time
=
self
.
_blockchain_processor
.
parameters
(
self
.
currency
).
ms_validity
identity
.
membership_timestamp
=
median_time
-
(
expiration_time
-
identity_data
[
"
membershipExpiresIn
"
])
# We save connections pubkeys
if
identit
y
.
pubkey
in
self
.
_connections_processor
.
pubkeys
(
):
if
self
.
_
identit
ies_processor
.
get_identity
(
self
.
currency
,
identity
.
pubkey
,
identity
.
uid
):
self
.
_identities_processor
.
insert_or_update_identity
(
identity
)
except
errors
.
DuniterError
as
e
:
if
e
.
ucode
==
errors
.
NO_MEMBER_MATCHING_PUB_OR_UID
:
...
...
@@ -431,6 +431,9 @@ class IdentitiesService(QObject):
"""
return
await
self
.
_identities_processor
.
lookup
(
self
.
currency
,
text
)
def
insert_or_update_identity
(
self
,
identity
):
return
self
.
_identities_processor
.
insert_or_update_identity
(
identity
)
def
get_identity
(
self
,
pubkey
,
uid
=
""
):
return
self
.
_identities_processor
.
get_identity
(
self
.
currency
,
pubkey
,
uid
)
...
...
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