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
!12
feat(identity): explicit revocation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
feat(identity): explicit revocation
idty_revoke
into
master
Overview
24
Commits
1
Pipelines
0
Changes
2
Merged
Pascal Engélibert
requested to merge
idty_revoke
into
master
3 years ago
Overview
19
Commits
1
Pipelines
0
Changes
2
Expand
Closes
#14 (closed)
Edited
2 years ago
by
Éloïs
0
0
Merge request reports
Compare
master
version 8
1eb76a83
2 years ago
version 7
5c38381b
2 years ago
version 6
718937c4
2 years ago
version 5
a795c0e7
3 years ago
version 4
ca4f4fac
3 years ago
version 3
ca4f4fac
3 years ago
version 2
e79b2c3b
3 years ago
version 1
e79b2c3b
3 years ago
master (base)
and
version 1
latest version
ad756407
1 commit,
2 years ago
version 8
1eb76a83
1 commit,
2 years ago
version 7
5c38381b
1 commit,
2 years ago
version 6
718937c4
1 commit,
2 years ago
version 5
a795c0e7
1 commit,
3 years ago
version 4
ca4f4fac
1 commit,
3 years ago
version 3
ca4f4fac
1 commit,
3 years ago
version 2
e79b2c3b
1 commit,
3 years ago
version 1
e79b2c3b
1 commit,
3 years ago
2 files
+
103
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
pallets/identity/src/lib.rs
+
48
−
0
Options
@@ -566,6 +566,54 @@ pub mod pallet {
@@ -566,6 +566,54 @@ pub mod pallet {
}
}
}
}
#[pallet::weight(
0
)]
#[pallet::weight(
0
)]
pub
fn
del_all_rights
(
origin
:
OriginFor
<
T
>
,
idty_index
:
T
::
IdtyIndex
,
)
->
DispatchResultWithPostInfo
{
T
::
DelRightOrigin
::
ensure_origin
(
origin
)
?
;
if
let
Ok
(
mut
idty_value
)
=
<
Identities
<
T
>>
::
try_get
(
idty_index
)
{
if
idty_value
.status
!=
IdtyStatus
::
Validated
{
return
Err
(
Error
::
<
T
>
::
IdtyNotValidated
.into
());
}
for
(
right
,
subkey_opt
)
in
idty_value
.rights
.drain
(
..
)
{
let
name
=
idty_value
.name
.clone
();
let
old_key_opt
=
if
let
Some
(
ref
subkey
)
=
subkey_opt
{
Some
(
subkey
.clone
())
}
else
if
right
.allow_owner_key
()
{
Some
(
idty_value
.owner_key
.clone
())
}
else
{
None
};
Self
::
deposit_event
(
Event
::
<
T
>
::
IdtyLostRight
(
name
,
right
));
if
old_key_opt
.is_some
()
{
T
::
OnRightKeyChange
::
on_right_key_change
(
idty_index
,
right
,
old_key_opt
,
None
,
);
}
}
let
block_number
=
frame_system
::
pallet
::
Pallet
::
<
T
>
::
block_number
();
let
removable_on
=
block_number
+
T
::
MaxNoRightPeriod
::
get
();
idty_value
.removable_on
=
removable_on
;
<
IdentitiesRemovableOn
<
T
>>
::
append
(
removable_on
,
(
idty_index
,
IdtyStatus
::
Validated
),
);
<
Identities
<
T
>>
::
insert
(
idty_index
,
idty_value
);
Ok
(()
.into
())
}
else
{
Err
(
Error
::
<
T
>
::
IdtyNotFound
.into
())
}
}
#[pallet::weight(
0
)]
pub
fn
set_right_subkey
(
pub
fn
set_right_subkey
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
idty_index
:
T
::
IdtyIndex
,
idty_index
:
T
::
IdtyIndex
,
Loading