This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
construct_runtime!
should generate ModuleToString
#5148
Closed
Description
It is likely we will not be able to get this done in time for merging: #5010
However, long term, we should have the construct_runtime!
macro generate a ModuleToString
type in each module's configuration trait.
This will be set to whatever string the user uses when configuring their runtime. i.e. :
construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
Timestamp: timestamp::{Module, Call, Storage, Inherent},
Aura: aura::{Module, Config<T>, Inherent(Timestamp)},
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: transaction_payment::{Module, Storage},
Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
// Used for the module template in `./template.rs`
TemplateModule: template::{Module, Call, Storage, Event<T>},
}
);
Would generate a ModuleToString
of "TemplateModule"
.
This value should then automatically get used by the decl_storage
macro.
Additionally, we could use this value for populating unique MODULE_ID
s. For example:
const MODULE_ID: LockIdentifier = *b"py/elect";