Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Benjamin Gallois
Duniter v2S
Commits
8a88c758
Unverified
Commit
8a88c758
authored
1 year ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
fix oracle
parent
002fcce4
No related branches found
No related tags found
No related merge requests found
Pipeline
#35667
waiting for manual action
Stage: quality
Stage: build
Stage: tests
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
distance-oracle/src/api.rs
+15
-11
15 additions, 11 deletions
distance-oracle/src/api.rs
end2end-tests/cucumber-features/identity_creation.feature
+3
-3
3 additions, 3 deletions
end2end-tests/cucumber-features/identity_creation.feature
with
18 additions
and
14 deletions
distance-oracle/src/api.rs
+
15
−
11
View file @
8a88c758
...
...
@@ -114,11 +114,11 @@ pub struct MemberIter(
impl
MemberIter
{
pub
async
fn
next
(
&
mut
self
)
->
Result
<
Option
<
IdtyIndex
>
,
subxt
::
error
::
Error
>
{
self
.0
.next
(
)
.await
.unwrap
(
)
.map
(|(
storage_key
,
_membership_data
)|
Some
(
idty_id_from_storage_key
(
&
storage_key
)))
if
let
Some
(
i
)
=
self
.0
.next
()
.await
{
i
.map
(|(
storage_key
,
_membership_data
)|
Some
(
idty_id_from_storage_key
(
&
storage_key
))
)
}
else
{
Ok
(
None
)
}
}
}
...
...
@@ -139,14 +139,18 @@ impl CertIter {
pub
async
fn
next
(
&
mut
self
,
)
->
Result
<
Option
<
(
IdtyIndex
,
Vec
<
(
IdtyIndex
,
u32
)
>
)
>
,
subxt
::
error
::
Error
>
{
self
.0
.next
(
)
.await
.unwrap
(
)
.map
(|(
storage_key
,
issuers
)|
Some
((
idty_id_from_storage_key
(
&
storage_key
),
issuers
)))
if
let
Some
(
i
)
=
self
.0
.next
()
.await
{
i
.map
(|(
storage_key
,
issuers
)|
Some
((
idty_id_from_storage_key
(
&
storage_key
),
issuers
))
)
}
else
{
Ok
(
None
)
}
}
}
fn
idty_id_from_storage_key
(
storage_key
:
&
[
u8
])
->
IdtyIndex
{
u32
::
from_le_bytes
(
storage_key
[
40
..
44
]
.try_into
()
.unwrap
())
u32
::
from_le_bytes
(
storage_key
.as_ref
()[
40
..
44
]
.try_into
()
.expect
(
"Cannot convert StorageKey to IdtyIndex"
),
)
}
This diff is collapsed.
Click to expand it.
end2end-tests/cucumber-features/identity_creation.feature
+
3
−
3
View file @
8a88c758
...
...
@@ -27,6 +27,6 @@ Feature: Identity creation
Then
dave should have distance result in 2 sessions
When
30 blocks later
Then
dave should have distance result in 1 session
#
When alice runs distance oracle
#
When 30 blocks later
#
Then dave identity should be member
TODO fix distance oracle
When
alice runs distance oracle
When
30 blocks later
Then
dave identity should be member
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