Remove default expansion from construct_runtime! (#4937)

This removes the following syntactic sugar from `construct_runtime!`:

- Expansion of `default` to the default set of module parts
- Expansion of `System: system` to the default set of module parts

The macro now requires the user to provide all the module parts of a pallet.
This commit is contained in:
Bastian Köcher
2020-02-15 14:40:29 +01:00
committed by GitHub
parent 4053201046
commit 625e963aa2
18 changed files with 158 additions and 221 deletions
+7 -12
View File
@@ -268,8 +268,8 @@ pub fn decl_storage(input: TokenStream) -> TokenStream {
/// NodeBlock = runtime::Block,
/// UncheckedExtrinsic = UncheckedExtrinsic
/// {
/// System: system,
/// Test: test::{default},
/// System: system::{Module, Call, Event<T>, Config<T>},
/// Test: test::{Module, Call},
/// Test2: test_with_long_module::{Module},
///
/// // Module with instances
@@ -279,17 +279,12 @@ pub fn decl_storage(input: TokenStream) -> TokenStream {
/// )
/// ```
///
/// The module `System: system` will expand to `System: system::{Module, Call, Storage, Event<T>, Config<T>}`.
/// The identifier `System` is the name of the module and the lower case identifier `system` is the
/// name of the Rust module/crate for this Substrate module.
/// The identifier `System` is the name of the pallet and the lower case identifier `system` is the
/// name of the Rust module/crate for this Substrate module. The identifiers between the braces are
/// the module parts provided by the pallet. It is important to list these parts here to export
/// them correctly in the metadata or to make the pallet usable in the runtime.
///
/// The module `Test: test::{default}` will expand to
/// `Test: test::{Module, Call, Storage, Event<T>, Config<T>}`.
///
/// 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:
/// We provide support for the following module parts in a pallet:
///
/// - `Module`
/// - `Call`