Skip to content
Snippets Groups Projects
Commit fd3746cf authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by Éloïs
Browse files

doc(api): document disabled calls

parent b9b64531
No related branches found
No related tags found
1 merge request!70doc(api): document disabled calls
...@@ -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>
...@@ -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
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment