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
40cec7d0
Commit
40cec7d0
authored
2 years ago
by
Pascal Engélibert
Browse files
Options
Downloads
Patches
Plain Diff
doc: Add doc comments to some calls
parent
cd46563e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pallets/certification/src/lib.rs
+5
-0
5 additions, 0 deletions
pallets/certification/src/lib.rs
pallets/identity/src/lib.rs
+18
-0
18 additions, 0 deletions
pallets/identity/src/lib.rs
with
23 additions
and
0 deletions
pallets/certification/src/lib.rs
+
5
−
0
View file @
40cec7d0
...
@@ -335,6 +335,11 @@ pub mod pallet {
...
@@ -335,6 +335,11 @@ pub mod pallet {
Self
::
do_add_cert
(
block_number
,
create
,
issuer
,
receiver
)
Self
::
do_add_cert
(
block_number
,
create
,
issuer
,
receiver
)
}
}
/// Add a new certification or renew an existing one
///
/// - `receiver`: the account receiving the certification from the origin
///
/// The origin must be allow to certify.
#[pallet::weight(
1_000_000_000
)]
#[pallet::weight(
1_000_000_000
)]
pub
fn
add_cert
(
pub
fn
add_cert
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
...
...
This diff is collapsed.
Click to expand it.
pallets/identity/src/lib.rs
+
18
−
0
View file @
40cec7d0
...
@@ -229,6 +229,11 @@ pub mod pallet {
...
@@ -229,6 +229,11 @@ pub mod pallet {
// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
#[pallet::call]
#[pallet::call]
impl
<
T
:
Config
>
Pallet
<
T
>
{
impl
<
T
:
Config
>
Pallet
<
T
>
{
/// Create an identity for an existing account
///
/// - `owner_key`: the public key corresponding to the identity to be created
///
/// The origin must be allowed to create an identity.
#[pallet::weight(
1_000_000_000
)]
#[pallet::weight(
1_000_000_000
)]
pub
fn
create_identity
(
pub
fn
create_identity
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
...
@@ -291,6 +296,11 @@ pub mod pallet {
...
@@ -291,6 +296,11 @@ pub mod pallet {
T
::
OnIdtyChange
::
on_idty_change
(
idty_index
,
IdtyEvent
::
Created
{
creator
});
T
::
OnIdtyChange
::
on_idty_change
(
idty_index
,
IdtyEvent
::
Created
{
creator
});
Ok
(()
.into
())
Ok
(()
.into
())
}
}
/// Confirm the creation of an identity and give it a name
///
/// - `idty_name`: the name uniquely associated to this identity. Must match the validation rules defined by the runtime.
///
/// The identity must have been created using `create_identity` before it can be confirmed.
#[pallet::weight(
1_000_000_000
)]
#[pallet::weight(
1_000_000_000
)]
pub
fn
confirm_identity
(
pub
fn
confirm_identity
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
...
@@ -362,6 +372,14 @@ pub mod pallet {
...
@@ -362,6 +372,14 @@ pub mod pallet {
Ok
(()
.into
())
Ok
(()
.into
())
}
}
/// Revoke an identity using a signed revocation payload
///
/// - `payload`: the revocation payload
/// - `owner_key`: the public key corresponding to the identity to be revoked
/// - `genesis_hash`: the genesis block hash
/// - `payload_sig`: the signature of the encoded form of `payload`. Must be signed by `owner_key`.
///
/// Any origin can emit this extrinsic, not only `owner_key`.
#[pallet::weight(
1_000_000_000
)]
#[pallet::weight(
1_000_000_000
)]
pub
fn
revoke_identity
(
pub
fn
revoke_identity
(
origin
:
OriginFor
<
T
>
,
origin
:
OriginFor
<
T
>
,
...
...
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