diff --git a/substrate/srml/system/src/lib.rs b/substrate/srml/system/src/lib.rs
index 62bdc5156a..cf4dedbca6 100644
--- a/substrate/srml/system/src/lib.rs
+++ b/substrate/srml/system/src/lib.rs
@@ -14,8 +14,59 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see .
-//! System manager: Handles lowest level stuff like depositing logs, basic set up and take down of
-//! temporary storage entries, access to old block hashes.
+//! # System module
+//!
+//! The system module provides low-level access to core types and cross-cutting utilities.
+//! It acts as the base layer for other SRML modules to interact with the Substrate framework components.
+//! To use it in your module, you should ensure your module's trait implies the system [`Trait`].
+//!
+//! ## Overview
+//!
+//! The system module defines the core data types used in a Substrate runtime.
+//! It also provides several utility functions (see [`Module`]) for other runtime modules.
+//!
+//! In addition, it manages the storage items for extrinsics data, indexes, event record and digest items,
+//! among other things that support the execution of the current block.
+//!
+//! It also handles low level tasks like depositing logs, basic set up and take down of
+//! temporary storage entries and access to previous block hashes.
+//!
+//! ## Interface
+//!
+//! ### Dispatchable functions
+//!
+//! The system module does not implement any dispatchable functions.
+//!
+//! ### Public functions
+//!
+//! All public functions are available as part of the [`Module`] type.
+//!
+//! ## Usage
+//!
+//! ### Prerequisites
+//!
+//! Import the system module and derive your module's configuration trait from the system trait.
+//!
+//! ### Example - Get random seed and extrinsic count for the current block
+//!
+//! ```
+//! use srml_support::{decl_module, dispatch::Result};
+//! use srml_system::{self as system, ensure_signed};
+//!
+//! pub trait Trait: system::Trait {}
+//!
+//! decl_module! {
+//! pub struct Module for enum Call where origin: T::Origin {
+//! pub fn system_module_example(origin) -> Result {
+//! let _sender = ensure_signed(origin)?;
+//! let _random_seed = >::random_seed();
+//! let _extrinsic_count = >::extrinsic_count();
+//! Ok(())
+//! }
+//! }
+//! }
+//! # fn main() { }
+//! ```
#![cfg_attr(not(feature = "std"), no_std)]
@@ -60,32 +111,64 @@ impl IsDeadAccount for () {
}
}
-/// Compute the extrinsics root of a list of extrinsics.
+/// Compute the trie root of a list of extrinsics.
pub fn extrinsics_root(extrinsics: &[E]) -> H::Output {
extrinsics_data_root::(extrinsics.iter().map(parity_codec::Encode::encode).collect())
}
-/// Compute the extrinsics root of a list of extrinsics.
+/// Compute the trie root of a list of extrinsics.
pub fn extrinsics_data_root(xts: Vec>) -> H::Output {
let xts = xts.iter().map(Vec::as_slice).collect::>();
H::enumerated_trie_root(&xts)
}
pub trait Trait: 'static + Eq + Clone {
+ /// The aggregated `Origin` type used by dispatchable calls.
type Origin: Into