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
Container Registry
Model registry
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
nodes
rust
Duniter v2S
Merge requests
!259
Fix
#221
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix
#221
221-refactor-distance-oracle
into
master
Overview
4
Commits
2
Pipelines
5
Changes
1
Merged
Benjamin Gallois
requested to merge
221-refactor-distance-oracle
into
master
1 year ago
Overview
4
Commits
2
Pipelines
5
Changes
1
Expand
Closes
#221 (closed)
Edited
11 months ago
by
Benjamin Gallois
0
0
Merge request reports
Compare
master
version 5
0b58798f
11 months ago
version 4
315649ae
11 months ago
version 3
bc8a05e5
11 months ago
version 2
71af68e3
11 months ago
version 1
246d3a25
1 year ago
master (base)
and
latest version
latest version
55f6a2b9
2 commits,
11 months ago
version 5
0b58798f
2 commits,
11 months ago
version 4
315649ae
1 commit,
11 months ago
version 3
bc8a05e5
1 commit,
11 months ago
version 2
71af68e3
1 commit,
11 months ago
version 1
246d3a25
8 commits,
1 year ago
1 file
+
7
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
client/distance/src/lib.rs
+
7
−
7
Options
@@ -42,12 +42,6 @@ where
Backend
:
sc_client_api
::
Backend
<
B
>
,
IdtyIndex
:
Decode
+
Encode
+
PartialEq
+
TypeInfo
,
{
let
&
[
owner_key
]
=
owner_keys
else
{
log
::
error!
(
"🧙 [distance oracle] Expected exactly one Babe owner key, found {}: oracle cannot work"
,
owner_keys
.len
());
return
Ok
(
sp_distance
::
InherentDataProvider
::
<
IdtyIndex
>
::
new
(
None
));
};
let
owner_key
=
sp_runtime
::
AccountId32
::
new
(
owner_key
.0
);
let
pool_index
=
client
.storage
(
parent
,
@@ -82,7 +76,13 @@ where
});
// Have we already published a result for this period?
if
published_results
.evaluators
.contains
(
&
owner_key
)
{
// The block author is guaranteed to be in the owner_keys.
let
owner_keys
=
owner_keys
.iter
()
.map
(|
&
key
|
sp_runtime
::
AccountId32
::
new
(
key
.0
))
.any
(|
key
|
published_results
.evaluators
.contains
(
&
key
));
if
owner_keys
{
log
::
debug!
(
"🧙 [distance oracle] Already published a result for this period"
);
return
Ok
(
sp_distance
::
InherentDataProvider
::
<
IdtyIndex
>
::
new
(
None
));
}
Loading