Code generation algorithm
Intro
Writing Pallet Configs
Diving deeper into IPalletRuntimeConfig
IPalletRuntimeConfiginterface IPalletRuntimeConfig<Traits extends string, GenesisFields extends string> {
// The construct runtime config for the pallet
constructRuntime: IPalletConstructRuntimeConfig;
// Dynamic object of { Pallet Trait : string | Trait config}
// if string, simply put the Trait name = string inside trait implementation for runtime
// if config, put the data from config inside parameter_types macro and then insert name into implementation
palletTraits: DynamicObject<IPalletTraitsConfig | string, Traits, AllKeysRequired>
// In here we configure our genesis config struct
genesisConfig?: IPalletGenesisConfig<GenesisFields>;
// Rust syntax for code that can't be automatically inserted by the generator
additionalChainSpecCode?: {
additionalCode?: string[];
additionalVariables?: string[];
};
additionalRuntimeLibCode?: string[];
}Substrate Project Generation
What happens exactly?
Last updated