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
d6f026b3
Commit
d6f026b3
authored
1 year ago
by
bgallois
Committed by
Hugo Trentesaux
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix clippy errors
parent
ba43b069
No related branches found
No related tags found
1 merge request
!200
Harmonize and document events errors and calls
Pipeline
#34688
skipped
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pallets/distance/src/lib.rs
+4
-4
4 additions, 4 deletions
pallets/distance/src/lib.rs
runtime/common/src/providers.rs
+1
-1
1 addition, 1 deletion
runtime/common/src/providers.rs
with
5 additions
and
5 deletions
pallets/distance/src/lib.rs
+
4
−
4
View file @
d6f026b3
...
@@ -481,7 +481,7 @@ pub mod pallet {
...
@@ -481,7 +481,7 @@ pub mod pallet {
MedianResult
::
Two
(
m1
,
m2
)
=>
m1
+
(
m2
-
m1
)
/
2
,
// Avoid overflow (since max is 1)
MedianResult
::
Two
(
m1
,
m2
)
=>
m1
+
(
m2
-
m1
)
/
2
,
// Avoid overflow (since max is 1)
};
};
IdentityDistanceStatus
::
<
T
>
::
mutate
(
idty
,
|
entry
|
{
IdentityDistanceStatus
::
<
T
>
::
mutate
(
idty
,
|
entry
|
{
entry
.as_mut
()
.map
(|
(
account_id
,
status
)
|
{
if
let
Some
(
(
account_id
,
status
)
)
=
entry
.as_mut
()
{
if
median
>=
T
::
MinAccessibleReferees
::
get
()
{
if
median
>=
T
::
MinAccessibleReferees
::
get
()
{
T
::
Currency
::
unreserve
(
T
::
Currency
::
unreserve
(
account_id
,
account_id
,
...
@@ -489,13 +489,13 @@ pub mod pallet {
...
@@ -489,13 +489,13 @@ pub mod pallet {
);
);
*
status
=
DistanceStatus
::
Valid
;
*
status
=
DistanceStatus
::
Valid
;
}
else
{
}
else
{
<
T
as
Config
>
::
Currency
::
slash_reserved
(
T
::
Currency
::
slash_reserved
(
&
account_id
,
account_id
,
<
T
as
Config
>
::
EvaluationPrice
::
get
(),
<
T
as
Config
>
::
EvaluationPrice
::
get
(),
);
);
*
status
=
DistanceStatus
::
Invalid
;
*
status
=
DistanceStatus
::
Invalid
;
}
}
}
);
}
});
});
}
else
if
let
Some
((
account_id
,
_status
))
=
IdentityDistanceStatus
::
<
T
>
::
take
(
idty
)
}
else
if
let
Some
((
account_id
,
_status
))
=
IdentityDistanceStatus
::
<
T
>
::
take
(
idty
)
{
{
...
...
This diff is collapsed.
Click to expand it.
runtime/common/src/providers.rs
+
1
−
1
View file @
d6f026b3
...
@@ -119,7 +119,7 @@ where
...
@@ -119,7 +119,7 @@ where
idty_id
:
&<
T
as
pallet_identity
::
Config
>
::
IdtyIndex
,
idty_id
:
&<
T
as
pallet_identity
::
Config
>
::
IdtyIndex
,
)
->
Result
<
(),
DispatchError
>
{
)
->
Result
<
(),
DispatchError
>
{
match
pallet_distance
::
Pallet
::
<
T
>
::
identity_distance_status
(
idty_id
)
{
match
pallet_distance
::
Pallet
::
<
T
>
::
identity_distance_status
(
idty_id
)
{
Some
((
_
,
pallet_distance
::
DistanceStatus
::
Valid
))
=>
Ok
(())
.into
()
,
Some
((
_
,
pallet_distance
::
DistanceStatus
::
Valid
))
=>
Ok
(()),
Some
((
_
,
pallet_distance
::
DistanceStatus
::
Invalid
))
=>
Err
(
pallet_duniter_wot
::
Error
::
<
T
,
frame_support
::
instances
::
Instance1
>
::
DistanceIsInvalid
.into
()),
Some
((
_
,
pallet_distance
::
DistanceStatus
::
Invalid
))
=>
Err
(
pallet_duniter_wot
::
Error
::
<
T
,
frame_support
::
instances
::
Instance1
>
::
DistanceIsInvalid
.into
()),
_
=>
Err
(
pallet_duniter_wot
::
Error
::
<
T
,
frame_support
::
instances
::
Instance1
>
::
DistanceNotEvaluated
.into
()),
_
=>
Err
(
pallet_duniter_wot
::
Error
::
<
T
,
frame_support
::
instances
::
Instance1
>
::
DistanceNotEvaluated
.into
()),
}
}
...
...
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