Skip to content
Snippets Groups Projects
Commit 4b3aced8 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

construct_runtime!: Support parsing `struct Runtime` (#11932)

* construct_runtime!: Support parsing `struct Runtime`

* FMT
parent c4b607d4
Branches
No related merge requests found
......@@ -272,10 +272,11 @@ impl pallet_template::Config for Runtime {
// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
pub struct Runtime
where
Block = Block,
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system,
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
......
......@@ -34,7 +34,7 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
frame_support::construct_runtime!(
pub enum Test where
pub struct Test where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
......
......@@ -73,7 +73,14 @@ pub struct ExplicitRuntimeDeclaration {
impl Parse for RuntimeDeclaration {
fn parse(input: ParseStream) -> Result<Self> {
input.parse::<Token![pub]>()?;
input.parse::<Token![enum]>()?;
// Support either `enum` or `struct`.
if input.peek(Token![struct]) {
input.parse::<Token![struct]>()?;
} else {
input.parse::<Token![enum]>()?;
}
let name = input.parse::<syn::Ident>()?;
let where_section = input.parse()?;
let pallets =
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment