improve doc (#8437)

This commit is contained in:
Guillaume Thiolliere
2021-03-23 17:40:52 +01:00
committed by GitHub
parent 1602f8dd2d
commit d343683ca9
21 changed files with 75 additions and 94 deletions
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Aura Module //! # Aura Module
//! //!
//! - [`aura::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Module`](./struct.Module.html) //! - [`Pallet`]
//! //!
//! ## Overview //! ## Overview
//! //!
+3 -3
View File
@@ -19,8 +19,8 @@
//! //!
//! The Contract module provides functionality for the runtime to deploy and execute WebAssembly smart-contracts. //! The Contract module provides functionality for the runtime to deploy and execute WebAssembly smart-contracts.
//! //!
//! - [`contract::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -336,7 +336,7 @@ pub mod pallet {
/// * `gas_limit`: The gas limit enforced when executing the constructor. /// * `gas_limit`: The gas limit enforced when executing the constructor.
/// * `code`: The contract code to deploy in raw bytes. /// * `code`: The contract code to deploy in raw bytes.
/// * `data`: The input data to pass to the contract constructor. /// * `data`: The input data to pass to the contract constructor.
/// * `salt`: Used for the address derivation. See [`Self::contract_address`]. /// * `salt`: Used for the address derivation. See [`Pallet::contract_address`].
/// ///
/// Instantiation is executed as follows: /// Instantiation is executed as follows:
/// ///
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Democracy Pallet //! # Democracy Pallet
//! //!
//! - [`democracy::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -92,9 +92,9 @@
//! //!
//! ### Module Information //! ### Module Information
//! //!
//! - [`election_sp_phragmen::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Module`](./struct.Module.html) //! - [`Module`]
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Identity Module //! # Identity Module
//! //!
//! - [`identity::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
+3 -3
View File
@@ -30,9 +30,9 @@
//! as the [NetworkState](../../client/offchain/struct.NetworkState.html). //! as the [NetworkState](../../client/offchain/struct.NetworkState.html).
//! It is submitted as an Unsigned Transaction via off-chain workers. //! It is submitted as an Unsigned Transaction via off-chain workers.
//! //!
//! - [`im_online::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Module`](./struct.Module.html) //! - [`Module`]
//! //!
//! ## Interface //! ## Interface
//! //!
+2 -2
View File
@@ -18,8 +18,8 @@
//! # Multisig Module //! # Multisig Module
//! A module for doing multisig dispatch. //! A module for doing multisig dispatch.
//! //!
//! - [`multisig::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Nicks Module //! # Nicks Module
//! //!
//! - [`nicks::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
+2 -11
View File
@@ -23,17 +23,8 @@
//! wish to execute some duration prior to execution happens. In this case, the target account may //! wish to execute some duration prior to execution happens. In this case, the target account may
//! reject the announcement and in doing so, veto the execution. //! reject the announcement and in doing so, veto the execution.
//! //!
//! - [`proxy::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//!
//! ## Overview
//!
//! ## Interface
//!
//! ### Dispatchable Functions
//!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
// Ensure we're `no_std` when compiling for Wasm. // Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
@@ -25,7 +25,7 @@
//! //!
//! ## Public Functions //! ## Public Functions
//! //!
//! See the [`Module`](./struct.Module.html) struct for details of publicly available functions. //! See the [`Module`] struct for details of publicly available functions.
//! //!
//! ## Usage //! ## Usage
//! //!
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Recovery Pallet //! # Recovery Pallet
//! //!
//! - [`recovery::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
+3 -3
View File
@@ -18,9 +18,9 @@
//! # Scheduler //! # Scheduler
//! A module for scheduling dispatches. //! A module for scheduling dispatches.
//! //!
//! - [`scheduler::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Module`](./struct.Module.html) //! - [`Module`]
//! //!
//! ## Overview //! ## Overview
//! //!
+3 -3
View File
@@ -37,9 +37,9 @@
//! from the `Pool` and `Members`; the entity is immediately replaced //! from the `Pool` and `Members`; the entity is immediately replaced
//! by the next highest scoring candidate in the pool, if available. //! by the next highest scoring candidate in the pool, if available.
//! //!
//! - [`scored_pool::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Module`](./struct.Module.html) //! - [`Module`]
//! //!
//! ## Interface //! ## Interface
//! //!
+3 -3
View File
@@ -20,9 +20,9 @@
//! The Session module allows validators to manage their session keys, provides a function for //! The Session module allows validators to manage their session keys, provides a function for
//! changing the session length, and handles session rotation. //! changing the session length, and handles session rotation.
//! //!
//! - [`session::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Module`](./struct.Module.html) //! - [`Module`]
//! //!
//! ## Overview //! ## Overview
//! //!
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Society Module //! # Society Module
//! //!
//! - [`society::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
+28 -30
View File
@@ -19,9 +19,9 @@
//! //!
//! The Staking module is used to manage funds at stake by network maintainers. //! The Staking module is used to manage funds at stake by network maintainers.
//! //!
//! - [`staking::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Module`](./struct.Module.html) //! - [`Module`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -65,16 +65,16 @@
//! is paired with an active **controller** account, which issues instructions on how they shall be //! is paired with an active **controller** account, which issues instructions on how they shall be
//! used. //! used.
//! //!
//! An account pair can become bonded using the [`bond`](./enum.Call.html#variant.bond) call. //! An account pair can become bonded using the [`bond`](Call::bond) call.
//! //!
//! Stash accounts can change their associated controller using the //! Stash accounts can change their associated controller using the
//! [`set_controller`](./enum.Call.html#variant.set_controller) call. //! [`set_controller`](Call::set_controller) call.
//! //!
//! There are three possible roles that any staked account pair can be in: `Validator`, `Nominator` //! There are three possible roles that any staked account pair can be in: `Validator`, `Nominator`
//! and `Idle` (defined in [`StakerStatus`](./enum.StakerStatus.html)). There are three //! and `Idle` (defined in [`StakerStatus`]). There are three
//! corresponding instructions to change between roles, namely: //! corresponding instructions to change between roles, namely:
//! [`validate`](./enum.Call.html#variant.validate), //! [`validate`](Call::validate),
//! [`nominate`](./enum.Call.html#variant.nominate), and [`chill`](./enum.Call.html#variant.chill). //! [`nominate`](Call::nominate), and [`chill`](Call::chill).
//! //!
//! #### Validating //! #### Validating
//! //!
@@ -86,7 +86,7 @@
//! by nominators and their votes. //! by nominators and their votes.
//! //!
//! An account can become a validator candidate via the //! An account can become a validator candidate via the
//! [`validate`](./enum.Call.html#variant.validate) call. //! [`validate`](Call::validate) call.
//! //!
//! #### Nomination //! #### Nomination
//! //!
@@ -98,7 +98,7 @@
//! the misbehaving/offline validators as much as possible, simply because the nominators will also //! the misbehaving/offline validators as much as possible, simply because the nominators will also
//! lose funds if they vote poorly. //! lose funds if they vote poorly.
//! //!
//! An account can become a nominator via the [`nominate`](enum.Call.html#variant.nominate) call. //! An account can become a nominator via the [`nominate`](Call::nominate) call.
//! //!
//! #### Rewards and Slash //! #### Rewards and Slash
//! //!
@@ -127,7 +127,7 @@
//! This means that if they are a nominator, they will not be considered as voters anymore and if //! This means that if they are a nominator, they will not be considered as voters anymore and if
//! they are validators, they will no longer be a candidate for the next election. //! they are validators, they will no longer be a candidate for the next election.
//! //!
//! An account can step back via the [`chill`](enum.Call.html#variant.chill) call. //! An account can step back via the [`chill`](Call::chill) call.
//! //!
//! ### Session managing //! ### Session managing
//! //!
@@ -175,7 +175,7 @@
//! ### Era payout //! ### Era payout
//! //!
//! The era payout is computed using yearly inflation curve defined at //! The era payout is computed using yearly inflation curve defined at
//! [`T::RewardCurve`](./trait.Config.html#associatedtype.RewardCurve) as such: //! [`Config::EraPayout`] as such:
//! //!
//! ```nocompile //! ```nocompile
//! staker_payout = yearly_inflation(npos_token_staked / total_tokens) * total_tokens / era_per_year //! staker_payout = yearly_inflation(npos_token_staked / total_tokens) * total_tokens / era_per_year
@@ -186,7 +186,7 @@
//! remaining_payout = max_yearly_inflation * total_tokens / era_per_year - staker_payout //! remaining_payout = max_yearly_inflation * total_tokens / era_per_year - staker_payout
//! ``` //! ```
//! The remaining reward is send to the configurable end-point //! The remaining reward is send to the configurable end-point
//! [`T::RewardRemainder`](./trait.Config.html#associatedtype.RewardRemainder). //! [`Config::RewardRemainder`].
//! //!
//! ### Reward Calculation //! ### Reward Calculation
//! //!
@@ -198,29 +198,28 @@
//! //!
//! Total reward is split among validators and their nominators depending on the number of points //! Total reward is split among validators and their nominators depending on the number of points
//! they received during the era. Points are added to a validator using //! they received during the era. Points are added to a validator using
//! [`reward_by_ids`](./enum.Call.html#variant.reward_by_ids) or //! [`reward_by_ids`](Module::reward_by_ids).
//! [`reward_by_indices`](./enum.Call.html#variant.reward_by_indices).
//! //!
//! [`Module`](./struct.Module.html) implements //! [`Module`] implements
//! [`pallet_authorship::EventHandler`](../pallet_authorship/trait.EventHandler.html) to add reward //! [`pallet_authorship::EventHandler`] to add reward
//! points to block producer and block producer of referenced uncles. //! points to block producer and block producer of referenced uncles.
//! //!
//! The validator and its nominator split their reward as following: //! The validator and its nominator split their reward as following:
//! //!
//! The validator can declare an amount, named //! The validator can declare an amount, named
//! [`commission`](./struct.ValidatorPrefs.html#structfield.commission), that does not get shared //! [`commission`](ValidatorPrefs::commission), that does not get shared
//! with the nominators at each reward payout through its //! with the nominators at each reward payout through its
//! [`ValidatorPrefs`](./struct.ValidatorPrefs.html). This value gets deducted from the total reward //! [`ValidatorPrefs`]. This value gets deducted from the total reward
//! that is paid to the validator and its nominators. The remaining portion is split among the //! that is paid to the validator and its nominators. The remaining portion is split among the
//! validator and all of the nominators that nominated the validator, proportional to the value //! validator and all of the nominators that nominated the validator, proportional to the value
//! staked behind this validator (_i.e._ dividing the //! staked behind this validator (_i.e._ dividing the
//! [`own`](./struct.Exposure.html#structfield.own) or //! [`own`](Exposure::own) or
//! [`others`](./struct.Exposure.html#structfield.others) by //! [`others`](Exposure::others) by
//! [`total`](./struct.Exposure.html#structfield.total) in [`Exposure`](./struct.Exposure.html)). //! [`total`](Exposure::total) in [`Exposure`]).
//! //!
//! All entities who receive a reward have the option to choose their reward destination through the //! All entities who receive a reward have the option to choose their reward destination through the
//! [`Payee`](./struct.Payee.html) storage item (see //! [`Payee`] storage item (see
//! [`set_payee`](enum.Call.html#variant.set_payee)), to be one of the following: //! [`set_payee`](Call::set_payee)), to be one of the following:
//! //!
//! - Controller account, (obviously) not increasing the staked value. //! - Controller account, (obviously) not increasing the staked value.
//! - Stash account, not increasing the staked value. //! - Stash account, not increasing the staked value.
@@ -231,15 +230,15 @@
//! Any funds already placed into stash can be the target of the following operations: //! Any funds already placed into stash can be the target of the following operations:
//! //!
//! The controller account can free a portion (or all) of the funds using the //! The controller account can free a portion (or all) of the funds using the
//! [`unbond`](enum.Call.html#variant.unbond) call. Note that the funds are not immediately //! [`unbond`](Call::unbond) call. Note that the funds are not immediately
//! accessible. Instead, a duration denoted by //! accessible. Instead, a duration denoted by
//! [`BondingDuration`](./trait.Config.html#associatedtype.BondingDuration) (in number of eras) must //! [`Config::BondingDuration`] (in number of eras) must
//! pass until the funds can actually be removed. Once the `BondingDuration` is over, the //! pass until the funds can actually be removed. Once the `BondingDuration` is over, the
//! [`withdraw_unbonded`](./enum.Call.html#variant.withdraw_unbonded) call can be used to actually //! [`withdraw_unbonded`](Call::withdraw_unbonded) call can be used to actually
//! withdraw the funds. //! withdraw the funds.
//! //!
//! Note that there is a limitation to the number of fund-chunks that can be scheduled to be //! Note that there is a limitation to the number of fund-chunks that can be scheduled to be
//! unlocked in the future via [`unbond`](enum.Call.html#variant.unbond). In case this maximum //! unlocked in the future via [`unbond`](Call::unbond). In case this maximum
//! (`MAX_UNLOCKING_CHUNKS`) is reached, the bonded account _must_ first wait until a successful //! (`MAX_UNLOCKING_CHUNKS`) is reached, the bonded account _must_ first wait until a successful
//! call to `withdraw_unbonded` to remove some of the chunks. //! call to `withdraw_unbonded` to remove some of the chunks.
//! //!
@@ -256,7 +255,7 @@
//! //!
//! ## GenesisConfig //! ## GenesisConfig
//! //!
//! The Staking module depends on the [`GenesisConfig`](./struct.GenesisConfig.html). The //! The Staking module depends on the [`GenesisConfig`]. The
//! `GenesisConfig` is optional and allow to set some initial stakers. //! `GenesisConfig` is optional and allow to set some initial stakers.
//! //!
//! ## Related Modules //! ## Related Modules
@@ -2471,7 +2470,6 @@ impl<T: Config> Module<T> {
/// relatively to their points. /// relatively to their points.
/// ///
/// COMPLEXITY: Complexity is `number_of_validator_to_reward x current_elected_len`. /// COMPLEXITY: Complexity is `number_of_validator_to_reward x current_elected_len`.
/// If you need to reward lots of validator consider using `reward_by_indices`.
pub fn reward_by_ids( pub fn reward_by_ids(
validators_points: impl IntoIterator<Item = (T::AccountId, u32)> validators_points: impl IntoIterator<Item = (T::AccountId, u32)>
) { ) {
+2 -4
View File
@@ -17,8 +17,8 @@
//! # Sudo Module //! # Sudo Module
//! //!
//! - [`sudo::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -81,8 +81,6 @@
//! //!
//! * [Democracy](../pallet_democracy/index.html) //! * [Democracy](../pallet_democracy/index.html)
//! //!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
//! [`Origin`]: https://docs.substrate.dev/docs/substrate-types //! [`Origin`]: https://docs.substrate.dev/docs/substrate-types
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
+3 -3
View File
@@ -19,9 +19,9 @@
//! //!
//! The Timestamp pallet provides functionality to get and set the on-chain time. //! The Timestamp pallet provides functionality to get and set the on-chain time.
//! //!
//! - [`timestamp::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! - [`Pallet`](./struct.Pallet.html) //! - [`Pallet`]
//! //!
//! ## Overview //! ## Overview
//! //!
+3 -3
View File
@@ -20,8 +20,8 @@
//! The Treasury module provides a "pot" of funds that can be managed by stakeholders in the system //! The Treasury module provides a "pot" of funds that can be managed by stakeholders in the system
//! and a structure for making spending proposals from this pot. //! and a structure for making spending proposals from this pot.
//! //!
//! - [`treasury::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -53,7 +53,7 @@
//! //!
//! ## GenesisConfig //! ## GenesisConfig
//! //!
//! The Treasury module depends on the [`GenesisConfig`](./struct.GenesisConfig.html). //! The Treasury module depends on the [`GenesisConfig`].
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
+2 -5
View File
@@ -18,8 +18,8 @@
//! # Utility Module //! # Utility Module
//! A stateless module with helpers for dispatch management which does no re-authentication. //! A stateless module with helpers for dispatch management which does no re-authentication.
//! //!
//! - [`utility::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -48,9 +48,6 @@
//! //!
//! #### For pseudonymal dispatch //! #### For pseudonymal dispatch
//! * `as_derivative` - Dispatch a call from a derivative signed origin. //! * `as_derivative` - Dispatch a call from a derivative signed origin.
//!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
// Ensure we're `no_std` when compiling for Wasm. // Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
+2 -5
View File
@@ -17,8 +17,8 @@
//! # Vesting Module //! # Vesting Module
//! //!
//! - [`vesting::Config`](./trait.Config.html) //! - [`Config`]
//! - [`Call`](./enum.Call.html) //! - [`Call`]
//! //!
//! ## Overview //! ## Overview
//! //!
@@ -41,9 +41,6 @@
//! - `vest` - Update the lock, reducing it in line with the amount "vested" so far. //! - `vest` - Update the lock, reducing it in line with the amount "vested" so far.
//! - `vest_other` - Update the lock of another account, reducing it in line with the amount //! - `vest_other` - Update the lock of another account, reducing it in line with the amount
//! "vested" so far. //! "vested" so far.
//!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]