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
fd3746cf
Commit
fd3746cf
authored
2 years ago
by
Hugo Trentesaux
Committed by
Éloïs
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
doc(api): document disabled calls
parent
b9b64531
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!70
doc(api): document disabled calls
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/api/runtime-calls.md
+167
-0
167 additions, 0 deletions
docs/api/runtime-calls.md
xtask/src/gen_calls_doc.rs
+31
-0
31 additions, 0 deletions
xtask/src/gen_calls_doc.rs
with
198 additions
and
0 deletions
docs/api/runtime-calls.md
+
167
−
0
View file @
fd3746cf
...
@@ -8,6 +8,7 @@ the transactor. This is the only call category that can be submitted with an ext
...
@@ -8,6 +8,7 @@ the transactor. This is the only call category that can be submitted with an ext
through on-chain governance mechanisms.
through on-chain governance mechanisms.
1.
Inherent calls: This kind of call is invoked by the author of the block itself
1.
Inherent calls: This kind of call is invoked by the author of the block itself
(usually automatically by the node).
(usually automatically by the node).
1.
Disabled calls: These calls are disabled for different reasons (to be documented).
## User calls
## User calls
...
@@ -2151,3 +2152,169 @@ call: Box<<T as Config>::Call>
...
@@ -2151,3 +2152,169 @@ call: Box<<T as Config>::Call>
</p>
</p>
</details>
</details>
## Disabled calls
There are
**7**
disabled calls organized in
**4**
pallets.
### 0: System
<details><summary>
1: remark(remark)
</summary>
<p>
### Index
`1`
### Documentation
Make some on-chain remark.
### Types of parameters
```
rust
remark
:
Vec
<
u8
>
```
</p>
</details>
<details><summary>
8: remark_with_event(remark)
</summary>
<p>
### Index
`8`
### Documentation
Make some on-chain remark and emit event.
### Types of parameters
```
rust
remark
:
Vec
<
u8
>
```
</p>
</details>
### 14: Session
<details><summary>
0: set_keys(keys, proof)
</summary>
<p>
### Index
`0`
### Documentation
Sets the session key(s) of the function caller to
`keys`
.
Allows an account to set its session key prior to becoming a validator.
This doesn't take effect until the next session.
The dispatch origin of this function must be signed.
### Types of parameters
```
rust
keys
:
T
::
Keys
,
proof
:
Vec
<
u8
>
```
</p>
</details>
<details><summary>
1: purge_keys()
</summary>
<p>
### Index
`1`
### Documentation
Removes any session key(s) of the function caller.
This doesn't take effect until the next session.
The dispatch origin of this function must be Signed and the account must be either be
convertible to a validator ID using the chain's typical addressing system (this usually
means being a controller account) or directly convertible into a validator ID (which
usually means being a stash account).
</p>
</details>
### 42: Membership
<details><summary>
2: claim_membership(maybe_idty_id)
</summary>
<p>
### Index
`2`
### Documentation
### Types of parameters
```
rust
maybe_idty_id
:
Option
<
T
::
IdtyId
>
```
</p>
</details>
<details><summary>
4: revoke_membership(maybe_idty_id)
</summary>
<p>
### Index
`4`
### Documentation
### Types of parameters
```
rust
maybe_idty_id
:
Option
<
T
::
IdtyId
>
```
</p>
</details>
### 52: SmithsMembership
<details><summary>
2: claim_membership(maybe_idty_id)
</summary>
<p>
### Index
`2`
### Documentation
### Types of parameters
```
rust
maybe_idty_id
:
Option
<
T
::
IdtyId
>
```
</p>
</details>
This diff is collapsed.
Click to expand it.
xtask/src/gen_calls_doc.rs
+
31
−
0
View file @
fd3746cf
...
@@ -76,6 +76,9 @@ impl CallCategory {
...
@@ -76,6 +76,9 @@ impl CallCategory {
fn
is_user
(
pallet_name
:
&
str
,
call_name
:
&
str
)
->
bool
{
fn
is_user
(
pallet_name
:
&
str
,
call_name
:
&
str
)
->
bool
{
matches!
(
Self
::
is
(
pallet_name
,
call_name
),
Self
::
User
)
matches!
(
Self
::
is
(
pallet_name
,
call_name
),
Self
::
User
)
}
}
fn
is_disabled
(
pallet_name
:
&
str
,
call_name
:
&
str
)
->
bool
{
matches!
(
Self
::
is
(
pallet_name
,
call_name
),
Self
::
Disabled
)
}
}
}
#[derive(Clone)]
#[derive(Clone)]
...
@@ -224,6 +227,23 @@ fn print_runtime_calls(pallets: RuntimeCalls) -> String {
...
@@ -224,6 +227,23 @@ fn print_runtime_calls(pallets: RuntimeCalls) -> String {
}
}
})
})
.collect
();
.collect
();
let
mut
disabled_calls_counter
=
0
;
let
disabled_calls_pallets
:
RuntimeCalls
=
pallets
.iter
()
.cloned
()
.filter_map
(|
mut
pallet
|
{
let
pallet_name
=
pallet
.name
.clone
();
pallet
.calls
.retain
(|
call
|
CallCategory
::
is_disabled
(
&
pallet_name
,
&
call
.name
));
if
pallet
.calls
.is_empty
()
{
None
}
else
{
disabled_calls_counter
+=
pallet
.calls
.len
();
Some
(
pallet
)
}
})
.collect
();
let
mut
output
=
String
::
new
();
let
mut
output
=
String
::
new
();
...
@@ -242,6 +262,10 @@ through on-chain governance mechanisms.
...
@@ -242,6 +262,10 @@ through on-chain governance mechanisms.
output
.push_str
(
output
.push_str
(
r#"1. Inherent calls: This kind of call is invoked by the author of the block itself
r#"1. Inherent calls: This kind of call is invoked by the author of the block itself
(usually automatically by the node).
(usually automatically by the node).
"#
,
);
output
.push_str
(
r#"1. Disabled calls: These calls are disabled for different reasons (to be documented).
"#
,
"#
,
);
);
...
@@ -259,6 +283,13 @@ through on-chain governance mechanisms.
...
@@ -259,6 +283,13 @@ through on-chain governance mechanisms.
root_calls_pallets
,
root_calls_pallets
,
));
));
output
.push_str
(
"
\n\n
## Disabled calls
\n\n
"
);
output
.push_str
(
&
print_calls_category
(
disabled_calls_counter
,
"disabled"
,
disabled_calls_pallets
,
));
output
output
}
}
...
...
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