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
2152348f
Commit
2152348f
authored
2 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
fix(wot): membership expiration should trigger idty removal for main wot
parent
615f3f57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!61
fix(wot): Identity should be removed after the consumers of the identity & membership revocation should not trigger identity removal
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pallets/duniter-wot/src/lib.rs
+19
-2
19 additions, 2 deletions
pallets/duniter-wot/src/lib.rs
with
19 additions
and
2 deletions
pallets/duniter-wot/src/lib.rs
+
19
−
2
View file @
2152348f
...
...
@@ -220,8 +220,25 @@ where
WotDiffs
::
<
T
,
I
>
::
append
(
WotDiff
::
AddNode
(
*
idty_index
));
}
}
sp_membership
::
Event
::
<
IdtyIndex
,
MetaData
>
::
MembershipExpired
(
idty_index
)
|
sp_membership
::
Event
::
<
IdtyIndex
,
MetaData
>
::
MembershipRevoked
(
idty_index
)
=>
{
// Membership expiration cases:
// Triggered by the membership pallet: we should remove the identity only for the main
// wot
sp_membership
::
Event
::
<
IdtyIndex
,
MetaData
>
::
MembershipExpired
(
idty_index
)
=>
{
if
!
T
::
IsSubWot
::
get
()
{
Self
::
dispath_idty_call
(
pallet_identity
::
Call
::
remove_identity
{
idty_index
:
*
idty_index
,
idty_name
:
None
,
});
WotDiffs
::
<
T
,
I
>
::
append
(
WotDiff
::
DisableNode
(
*
idty_index
));
}
}
// Membership revocation cases:
// - Triggered by identity removal: the identity underlying will by removed by the
// caller.
// - Triggered by the membership pallet: it's ondly possible for the sub-wot, so we
// should not remove the underlying identity
// So, in any case, we must do nothing
sp_membership
::
Event
::
<
IdtyIndex
,
MetaData
>
::
MembershipRevoked
(
idty_index
)
=>
{
if
!
T
::
IsSubWot
::
get
()
{
WotDiffs
::
<
T
,
I
>
::
append
(
WotDiff
::
DisableNode
(
*
idty_index
));
}
...
...
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