Skip to content
Snippets Groups Projects
Commit e2d1d0c9 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Fix doc propagation for `Call` enum (#2690)

* Fix doc propagation for `Call` enum

* Fix warnings while generating `srml-staking` docs

* Make the line check happy
parent cf39cbc1
No related merge requests found
......@@ -187,15 +187,16 @@
//! A validator can be _reported_ to be offline at any point via the public function
//! [`on_offline_validator`](enum.Call.html#variant.on_offline_validator). Each validator declares how many times it
//! can be _reported_ before it actually gets slashed via its
//! [`unstake_threshold`](./struct.ValidatorPrefs.html#structfield.unstake_threshold).
//! [`ValidatorPrefs::unstake_threshold`](./struct.ValidatorPrefs.html#structfield.unstake_threshold).
//!
//! On top of this, the Staking module also introduces an
//! [`OfflineSlashGrace`](./struct.Module.html#method.offline_slash_grace), which applies
//! to all validators and prevents them from getting immediately slashed.
//!
//! Essentially, a validator gets slashed once they have been reported more than
//! [`OfflineSlashGrace`] + [`unstake_threshold`] times. Getting slashed due to offline report always leads
//! to being _unstaked_ (_i.e._ removed as a validator candidate) as the consequence.
//! [`OfflineSlashGrace`] + [`ValidatorPrefs::unstake_threshold`] times. Getting slashed due to
//! offline report always leads to being _unstaked_ (_i.e._ removed as a validator candidate) as
//! the consequence.
//!
//! The base slash value is computed _per slash-event_ by multiplying
//! [`OfflineSlash`](./struct.Module.html#method.offline_slash) and the `total` `Exposure`. This value is then
......
......@@ -773,6 +773,7 @@ macro_rules! decl_module {
$type,
}
variant $fn_name;
$( #[doc = $doc_attr] )*
$( $rest )*
}
};
......@@ -800,6 +801,7 @@ macro_rules! decl_module {
$type,
}
variant $fn_name;
$( #[doc = $doc_attr] )*
$( $rest )*
}
};
......@@ -859,7 +861,10 @@ macro_rules! decl_module {
(@imp
$(#[$attr:meta])*
pub struct $mod_type:ident<$trait_instance:ident: $trait_name:ident$(<I>, $instance:ident: $instantiable:path $(= $module_default_instance:path)?)?>
pub struct $mod_type:ident<
$trait_instance:ident: $trait_name:ident
$(<I>, $instance:ident: $instantiable:path $(= $module_default_instance:path)?)?
>
for enum $call_type:ident where origin: $origin_type:ty, system = $system:ident {
$(
$(#[doc = $doc_attr:tt])*
......@@ -881,7 +886,10 @@ macro_rules! decl_module {
// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted.
#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct $mod_type<$trait_instance: $trait_name $(<I>, $instance: $instantiable $( = $module_default_instance)?)?>($crate::rstd::marker::PhantomData<($trait_instance $(, $instance)?)>);
pub struct $mod_type<
$trait_instance: $trait_name
$(<I>, $instance: $instantiable $( = $module_default_instance)?)?
>($crate::rstd::marker::PhantomData<($trait_instance $(, $instance)?)>);
$crate::decl_module! {
@impl_on_initialize
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment