Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add documentation
  • Loading branch information
bkchr committed Sep 17, 2018
commit e0c5bb3ee96b1aeeb8100b343e8dfe19231a30d5
30 changes: 30 additions & 0 deletions srml/support/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

/// Construct a runtime, with the given name and the given modules.
///
/// # Example:
///
/// ```nocompile
/// construct_runtime!(
/// pub enum Runtime with Log(interalIdent: DigestItem<SessionKey>) {
/// System: system,
/// Test: test::{default, Log(Test)},
/// Test2: test_with_long_module::{Module},
/// }
/// )
/// ```
///
/// The module `System: system` will expand to `System: system::{Module, Call, Storage, Event<T>, Config}`.
/// The identifier `System` is the name of the module and the lower case identifier `system` is the
/// name of the rust module for this module.
/// The module `Test: test::{default, Log(Test)}` will expand to
/// `Test: test::{Module, Call, Storage, Event<T>, Config, Log(Test)}`.
/// The module `Test2: test_with_long_module::{Module}` will expand to
/// `Test2: test_with_long_module::{Module}`.
///
/// We provide support for the following types in a module:
/// - `Module`
/// - `Call`
/// - `Storage`
/// - `Event` or `Event<T>` (if the event is generic)
/// - `Origin` or `Origin<T>` (if the origin is generic)
/// - `Config`
/// - `Log( $(IDENT),* )`
#[macro_export]
macro_rules! construct_runtime {
(
Expand Down