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::Config`](./trait.Config.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Pallet`]
//!
//! ## Overview
//!
+3 -3
View File
@@ -19,8 +19,8 @@
//!
//! The Contract module provides functionality for the runtime to deploy and execute WebAssembly smart-contracts.
//!
//! - [`contract::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
@@ -336,7 +336,7 @@ pub mod pallet {
/// * `gas_limit`: The gas limit enforced when executing the constructor.
/// * `code`: The contract code to deploy in raw bytes.
/// * `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:
///
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Democracy Pallet
//!
//! - [`democracy::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
@@ -92,9 +92,9 @@
//!
//! ### Module Information
//!
//! - [`election_sp_phragmen::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Module`]
#![cfg_attr(not(feature = "std"), no_std)]
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Identity Module
//!
//! - [`identity::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
+3 -3
View File
@@ -30,9 +30,9 @@
//! as the [NetworkState](../../client/offchain/struct.NetworkState.html).
//! It is submitted as an Unsigned Transaction via off-chain workers.
//!
//! - [`im_online::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Module`]
//!
//! ## Interface
//!
+2 -2
View File
@@ -18,8 +18,8 @@
//! # Multisig Module
//! A module for doing multisig dispatch.
//!
//! - [`multisig::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Nicks Module
//!
//! - [`nicks::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## 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
//! reject the announcement and in doing so, veto the execution.
//!
//! - [`proxy::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//!
//! ## Overview
//!
//! ## Interface
//!
//! ### Dispatchable Functions
//!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
//! - [`Config`]
//! - [`Call`]
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
@@ -25,7 +25,7 @@
//!
//! ## 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
//!
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Recovery Pallet
//!
//! - [`recovery::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
+3 -3
View File
@@ -18,9 +18,9 @@
//! # Scheduler
//! A module for scheduling dispatches.
//!
//! - [`scheduler::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Module`]
//!
//! ## Overview
//!
+3 -3
View File
@@ -37,9 +37,9 @@
//! from the `Pool` and `Members`; the entity is immediately replaced
//! by the next highest scoring candidate in the pool, if available.
//!
//! - [`scored_pool::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Module`]
//!
//! ## Interface
//!
+3 -3
View File
@@ -20,9 +20,9 @@
//! The Session module allows validators to manage their session keys, provides a function for
//! changing the session length, and handles session rotation.
//!
//! - [`session::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Module`]
//!
//! ## Overview
//!
+2 -2
View File
@@ -17,8 +17,8 @@
//! # Society Module
//!
//! - [`society::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
+28 -30
View File
@@ -19,9 +19,9 @@
//!
//! The Staking module is used to manage funds at stake by network maintainers.
//!
//! - [`staking::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Module`]
//!
//! ## Overview
//!
@@ -65,16 +65,16 @@
//! is paired with an active **controller** account, which issues instructions on how they shall be
//! 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
//! [`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`
//! 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:
//! [`validate`](./enum.Call.html#variant.validate),
//! [`nominate`](./enum.Call.html#variant.nominate), and [`chill`](./enum.Call.html#variant.chill).
//! [`validate`](Call::validate),
//! [`nominate`](Call::nominate), and [`chill`](Call::chill).
//!
//! #### Validating
//!
@@ -86,7 +86,7 @@
//! by nominators and their votes.
//!
//! An account can become a validator candidate via the
//! [`validate`](./enum.Call.html#variant.validate) call.
//! [`validate`](Call::validate) call.
//!
//! #### Nomination
//!
@@ -98,7 +98,7 @@
//! the misbehaving/offline validators as much as possible, simply because the nominators will also
//! 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
//!
@@ -127,7 +127,7 @@
//! 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.
//!
//! 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
//!
@@ -175,7 +175,7 @@
//! ### Era payout
//!
//! 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
//! 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
//! ```
//! The remaining reward is send to the configurable end-point
//! [`T::RewardRemainder`](./trait.Config.html#associatedtype.RewardRemainder).
//! [`Config::RewardRemainder`].
//!
//! ### Reward Calculation
//!
@@ -198,29 +198,28 @@
//!
//! 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
//! [`reward_by_ids`](./enum.Call.html#variant.reward_by_ids) or
//! [`reward_by_indices`](./enum.Call.html#variant.reward_by_indices).
//! [`reward_by_ids`](Module::reward_by_ids).
//!
//! [`Module`](./struct.Module.html) implements
//! [`pallet_authorship::EventHandler`](../pallet_authorship/trait.EventHandler.html) to add reward
//! [`Module`] implements
//! [`pallet_authorship::EventHandler`] to add reward
//! points to block producer and block producer of referenced uncles.
//!
//! The validator and its nominator split their reward as following:
//!
//! 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
//! [`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
//! validator and all of the nominators that nominated the validator, proportional to the value
//! staked behind this validator (_i.e._ dividing the
//! [`own`](./struct.Exposure.html#structfield.own) or
//! [`others`](./struct.Exposure.html#structfield.others) by
//! [`total`](./struct.Exposure.html#structfield.total) in [`Exposure`](./struct.Exposure.html)).
//! [`own`](Exposure::own) or
//! [`others`](Exposure::others) by
//! [`total`](Exposure::total) in [`Exposure`]).
//!
//! All entities who receive a reward have the option to choose their reward destination through the
//! [`Payee`](./struct.Payee.html) storage item (see
//! [`set_payee`](enum.Call.html#variant.set_payee)), to be one of the following:
//! [`Payee`] storage item (see
//! [`set_payee`](Call::set_payee)), to be one of the following:
//!
//! - Controller account, (obviously) 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:
//!
//! 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
//! [`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
//! [`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.
//!
//! 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
//! call to `withdraw_unbonded` to remove some of the chunks.
//!
@@ -256,7 +255,7 @@
//!
//! ## 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.
//!
//! ## Related Modules
@@ -2471,7 +2470,6 @@ impl<T: Config> Module<T> {
/// relatively to their points.
///
/// 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(
validators_points: impl IntoIterator<Item = (T::AccountId, u32)>
) {
+2 -4
View File
@@ -17,8 +17,8 @@
//! # Sudo Module
//!
//! - [`sudo::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
@@ -81,8 +81,6 @@
//!
//! * [Democracy](../pallet_democracy/index.html)
//!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
//! [`Origin`]: https://docs.substrate.dev/docs/substrate-types
#![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.
//!
//! - [`timestamp::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Pallet`](./struct.Pallet.html)
//! - [`Config`]
//! - [`Call`]
//! - [`Pallet`]
//!
//! ## 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
//! and a structure for making spending proposals from this pot.
//!
//! - [`treasury::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
@@ -53,7 +53,7 @@
//!
//! ## 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)]
+2 -5
View File
@@ -18,8 +18,8 @@
//! # Utility Module
//! A stateless module with helpers for dispatch management which does no re-authentication.
//!
//! - [`utility::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
@@ -48,9 +48,6 @@
//!
//! #### For pseudonymal dispatch
//! * `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.
#![cfg_attr(not(feature = "std"), no_std)]
+2 -5
View File
@@ -17,8 +17,8 @@
//! # Vesting Module
//!
//! - [`vesting::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
@@ -41,9 +41,6 @@
//! - `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
//! "vested" so far.
//!
//! [`Call`]: ./enum.Call.html
//! [`Config`]: ./trait.Config.html
#![cfg_attr(not(feature = "std"), no_std)]