mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 12:38:04 +00:00
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:
committed by
thiolliere
parent
0ae060d4d1
commit
129803efd2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user