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
c1556944
Commit
c1556944
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Enhanced UID finding ( bug
#232
)
parent
3fc14fe1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cutecoin/core/registry/identities.py
+0
-1
0 additions, 1 deletion
src/cutecoin/core/registry/identities.py
src/cutecoin/core/registry/identity.py
+18
-0
18 additions, 0 deletions
src/cutecoin/core/registry/identity.py
with
18 additions
and
1 deletion
src/cutecoin/core/registry/identities.py
+
0
−
1
View file @
c1556944
...
@@ -83,7 +83,6 @@ class IdentitiesRegistry:
...
@@ -83,7 +83,6 @@ class IdentitiesRegistry:
identity
.
blockchain_state
=
BlockchainState
.
BUFFERED
identity
.
blockchain_state
=
BlockchainState
.
BUFFERED
identity
.
local_state
=
LocalState
.
PARTIAL
identity
.
local_state
=
LocalState
.
PARTIAL
return
identity
return
identity
logging
.
debug
(
"
Lookup : found {0}
"
.
format
(
identity
))
except
ValueError
as
e
:
except
ValueError
as
e
:
lookup_tries
+=
1
lookup_tries
+=
1
except
asyncio
.
TimeoutError
:
except
asyncio
.
TimeoutError
:
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/core/registry/identity.py
+
18
−
0
View file @
c1556944
...
@@ -244,6 +244,7 @@ class Identity(QObject):
...
@@ -244,6 +244,7 @@ class Identity(QObject):
:param cutecoin.core.registry.identities.IdentitiesRegistry identities_registry: The identities registry
:param cutecoin.core.registry.identities.IdentitiesRegistry identities_registry: The identities registry
:param cutecoin.core.community.Community community: The community target to request the join date
:param cutecoin.core.community.Community community: The community target to request the join date
:return: The list of the certifiers of this community
:return: The list of the certifiers of this community
:rtype: list
"""
"""
certifiers
=
list
()
certifiers
=
list
()
try
:
try
:
...
@@ -269,6 +270,7 @@ class Identity(QObject):
...
@@ -269,6 +270,7 @@ class Identity(QObject):
data
=
yield
from
community
.
bma_access
.
future_request
(
bma
.
wot
.
Lookup
,
{
'
search
'
:
self
.
pubkey
})
data
=
yield
from
community
.
bma_access
.
future_request
(
bma
.
wot
.
Lookup
,
{
'
search
'
:
self
.
pubkey
})
for
result
in
data
[
'
results
'
]:
for
result
in
data
[
'
results
'
]:
if
result
[
"
pubkey
"
]
==
self
.
pubkey
:
if
result
[
"
pubkey
"
]
==
self
.
pubkey
:
self
.
_refresh_uid
(
result
[
'
uids
'
])
for
uid_data
in
result
[
'
uids
'
]:
for
uid_data
in
result
[
'
uids
'
]:
for
certifier_data
in
uid_data
[
'
others
'
]:
for
certifier_data
in
uid_data
[
'
others
'
]:
for
uid
in
certifier_data
[
'
uids
'
]:
for
uid
in
certifier_data
[
'
uids
'
]:
...
@@ -322,6 +324,7 @@ class Identity(QObject):
...
@@ -322,6 +324,7 @@ class Identity(QObject):
:param cutecoin.core.community.Community community: The community target to request the join date
:param cutecoin.core.community.Community community: The community target to request the join date
:return: The list of the certified persons of this community in BMA json format
:return: The list of the certified persons of this community in BMA json format
:rtype: list
"""
"""
certified_list
=
list
()
certified_list
=
list
()
try
:
try
:
...
@@ -345,6 +348,7 @@ class Identity(QObject):
...
@@ -345,6 +348,7 @@ class Identity(QObject):
data
=
yield
from
community
.
bma_access
.
future_request
(
bma
.
wot
.
Lookup
,
{
'
search
'
:
self
.
pubkey
})
data
=
yield
from
community
.
bma_access
.
future_request
(
bma
.
wot
.
Lookup
,
{
'
search
'
:
self
.
pubkey
})
for
result
in
data
[
'
results
'
]:
for
result
in
data
[
'
results
'
]:
if
result
[
"
pubkey
"
]
==
self
.
pubkey
:
if
result
[
"
pubkey
"
]
==
self
.
pubkey
:
self
.
_refresh_uid
(
result
[
'
uids
'
])
for
certified_data
in
result
[
'
signed
'
]:
for
certified_data
in
result
[
'
signed
'
]:
certified
=
{}
certified
=
{}
certified
[
'
identity
'
]
=
identities_registry
.
from_handled_data
(
certified_data
[
'
uid
'
],
certified
[
'
identity
'
]
=
identities_registry
.
from_handled_data
(
certified_data
[
'
uid
'
],
...
@@ -394,6 +398,20 @@ class Identity(QObject):
...
@@ -394,6 +398,20 @@ class Identity(QObject):
current_time
=
time
.
time
()
current_time
=
time
.
time
()
return
expiration_date
-
current_time
return
expiration_date
-
current_time
def
_refresh_uid
(
self
,
uids
):
"""
Refresh UID from uids list, got from a successful lookup request
:param list uids: UIDs got from a lookup request
"""
if
self
.
local_state
==
LocalState
.
NOT_FOUND
:
for
uid_data
in
uids
:
if
uid_data
[
"
meta
"
][
"
timestamp
"
]
>
timestamp
:
timestamp
=
uid_data
[
"
meta
"
][
"
timestamp
"
]
identity_uid
=
uid_data
[
"
uid
"
]
self
.
uid
=
identity_uid
self
.
blockchain_state
=
BlockchainState
.
BUFFERED
self
.
local_state
=
LocalState
.
PARTIAL
def
jsonify
(
self
):
def
jsonify
(
self
):
"""
"""
Get the community as dict in json format.
Get the community as dict in json format.
...
...
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