Make existing docs more consistent (#2307)

* opening and closing links

* sudo example compiles

* add Aura after it was merged to master

* remove extern crate line
This commit is contained in:
joe petrowski
2019-04-17 13:40:13 +02:00
committed by thiolliere
parent 0ae060d4d1
commit 129803efd2
8 changed files with 67 additions and 103 deletions
+6 -43
View File
@@ -16,6 +16,9 @@
//! # Sudo Module
//!
//! - [`sudo::Trait`](./trait.Trait.html)
//! - [`Call`](./enum.Call.html)
//!
//! ## Overview
//!
//! The Sudo module allows for a single account (called the "sudo key")
@@ -23,8 +26,6 @@
//! or designate a new account to replace them as the sudo key.
//! Only one account can be the sudo key at a time.
//!
//! You can start using the Sudo module by implementing the [`sudo::Trait`](./trait.Trait.html).
//!
//! ## Interface
//!
//! ### Dispatchable Functions
@@ -34,27 +35,8 @@
//! * `sudo` - Make a `Root` call to a dispatchable function.
//! * `set_key` - Assign a new account to be the sudo key.
//!
//! See the [`Call`](./enum.Call.html) enum and its associated variants for details of each function.
//!
//! ## Usage
//!
//! ### Prerequisites
//!
//! To use the Sudo module in your runtime, you must implement the following trait in your runtime:
//!
//! ```ignore
//! impl sudo::Trait for Runtime {
//! type Event = Event;
//! type Proposal = Call;
//! }
//! ```
//!
//! You can then import the Sudo module in your `construct_runtime!` macro with:
//!
//! ```ignore
//! Sudo: sudo,
//! ```
//!
//! ### Executing Privileged Functions
//!
//! The Sudo module itself is not intended to be used within other modules.
@@ -68,8 +50,8 @@
//!
//! This is an example of a module that exposes a privileged function:
//!
//! ```ignore
//! use support::{decl_module, dispatch::Result};
//! ```
//! use srml_support::{decl_module, dispatch::Result};
//! use system::ensure_root;
//!
//! pub trait Trait: system::Trait {}
@@ -85,18 +67,7 @@
//! }
//! }
//! }
//! ```
//!
//! ### Example from SRML
//!
//! The Consensus module exposes a `set_code` privileged function
//! that allows you to set the on-chain Wasm runtime code:
//!
//! ```ignore
//! /// Set the new code.
//! pub fn set_code(new: Vec<u8>) {
//! storage::unhashed::put_raw(well_known_keys::CODE, &new);
//! }
//! # fn main() {}
//! ```
//!
//! ## Genesis Config
@@ -104,14 +75,6 @@
//! The Sudo module depends on the [`GenesisConfig`](./struct.GenesisConfig.html).
//! You need to set an initial superuser account as the sudo `key`.
//!
//! ```ignore
//! GenesisConfig {
//! sudo: Some(SudoConfig {
//! key: AccountId,
//! })
//! }
//! ```
//!
//! ## Related Modules
//!
//! * [Consensus](../srml_consensus/index.html)