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
Commits
19a6714b
Commit
19a6714b
authored
10 months ago
by
Benjamin Gallois
Committed by
Hugo Trentesaux
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#221
(
!259
)
* optimization * fix
#221
parent
6bc8c9c9
No related branches found
No related tags found
1 merge request
!259
Fix #221
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/distance/src/lib.rs
+7
-7
7 additions, 7 deletions
client/distance/src/lib.rs
with
7 additions
and
7 deletions
client/distance/src/lib.rs
+
7
−
7
View file @
19a6714b
...
...
@@ -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
));
}
...
...
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