Skip to content
Snippets Groups Projects
Commit dab5ad91 authored by thiolliere's avatar thiolliere Committed by Bastian Köcher
Browse files

fix construct runtime module position bug (#1849)


* fix construct runtime module position

* Update srml/support/src/runtime.rs

Co-Authored-By: default avatarthiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: default avatarthiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: default avatarthiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: default avatarthiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/runtime.rs

Co-Authored-By: default avatarthiolliere <gui.thiolliere@gmail.com>
parent 43e45448
Branches
No related merge requests found
...@@ -61,7 +61,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { ...@@ -61,7 +61,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("substrate-node"), impl_name: create_runtime_str!("substrate-node"),
authoring_version: 10, authoring_version: 10,
spec_version: 30, spec_version: 30,
impl_version: 30, impl_version: 31,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
}; };
......
No preview for this file type
...@@ -339,7 +339,7 @@ macro_rules! construct_runtime { ...@@ -339,7 +339,7 @@ macro_rules! construct_runtime {
$runtime; $runtime;
; ;
$( $(
$name: $module::{ $( $modules $( <$modules_generic> )* )* } $name: $module::{ $( $modules )* }
)* )*
); );
$crate::__decl_outer_log!( $crate::__decl_outer_log!(
...@@ -718,70 +718,70 @@ macro_rules! __decl_outer_dispatch { ...@@ -718,70 +718,70 @@ macro_rules! __decl_outer_dispatch {
#[macro_export] #[macro_export]
#[doc(hidden)] #[doc(hidden)]
macro_rules! __decl_runtime_metadata { macro_rules! __decl_runtime_metadata {
// contain a module // leading is Module : parse
( (
$runtime:ident; $runtime:ident;
$( $parsed_modules:ident { $( $withs:ident )* } )*; $( $parsed_modules:ident { $( $withs:ident )* } )*;
$( { leading_module: $( $leading_module:ident )* } )?
$name:ident: $module:ident::{ $name:ident: $module:ident::{
Module $( $modules:ident $( <$modules_generic:ident> )* )* Module $( $modules:ident )*
} }
$( $rest_name:ident : $rest_module:ident::{ $( $rest_name:ident : $rest_module:ident::{
$( $rest_modules:ident $( <$rest_modules_generic:ident> )* )* $( $rest_modules:ident )*
})* })*
) => { ) => {
$crate::__decl_runtime_metadata!(
$crate::__decl_runtime_metadata!(@Module
$runtime; $runtime;
$( $parsed_modules { $( $withs )* } )*; $( $parsed_modules { $( $withs )* } )* $module { $( $( $leading_module )* )? $( $modules )* };
$name: $module::{ $( $modules $( <$modules_generic> )* )* }
$( $(
$rest_name: $rest_module::{ $rest_name: $rest_module::{
$( $rest_modules $( <$rest_modules_generic> )* )* $( $rest_modules )*
} }
)* )*
); );
}; };
// do not contain Module : skip // leading isn't Module : put it in leadings
( (
$runtime:ident; $runtime:ident;
$( $parsed_modules:ident { $( $withs:ident )* } )*; $( $parsed_modules:ident { $( $withs:ident )* } )*;
$( { leading_module: $( $leading_module:ident )* } )?
$name:ident: $module:ident::{ $name:ident: $module:ident::{
$( $modules:ident $( <$modules_generic:ident> )* )* $other_module:ident $( $modules:ident )*
} }
$( $rest_name:ident : $rest_module:ident::{ $( $rest_name:ident : $rest_module:ident::{
$( $rest_modules:ident $( <$rest_modules_generic:ident> )* )* $( $rest_modules:ident )*
})* })*
) => { ) => {
$crate::__decl_runtime_metadata!( $crate::__decl_runtime_metadata!(
$runtime; $runtime;
$( $parsed_modules { $( $withs )* } )*; $( $parsed_modules { $( $withs )* } )*;
{ leading_module: $( $( $leading_module )* )? $other_module }
$name: $module::{
$( $modules )*
}
$( $(
$rest_name: $rest_module::{ $rest_name: $rest_module::{
$( $rest_modules $( <$rest_modules_generic> )* )* $( $rest_modules )*
} }
)* )*
); );
}; };
// process module // does not contain Module : skip
(@Module (
$runtime:ident; $runtime:ident;
$( $parsed_modules:ident { $( $withs:ident )* } )*; $( $parsed_modules:ident { $( $withs:ident )* } )*;
$name:ident: $module:ident::{ $( { leading_module: $( $leading_module:ident )* } )?
$( $modules:ident $( <$modules_generic:ident> )* )* $name:ident: $module:ident::{}
} $( $rest_name:ident : $rest_module:ident::{
$($rest_name:ident : $rest_module:ident::{ $( $rest_modules:ident )*
$( $rest_modules:ident $( <$rest_modules_generic:ident> )* )*
})* })*
) => { ) => {
$crate::__decl_runtime_metadata!( $crate::__decl_runtime_metadata!(
$runtime; $runtime;
$( $parsed_modules { $( $withs )* } )* $( $parsed_modules { $( $withs )* } )*;
$module {
$($modules)*
};
$( $(
$rest_name: $rest_module::{ $rest_name: $rest_module::{
$( $rest_modules $( <$rest_modules_generic> )* )* $( $rest_modules )*
} }
)* )*
); );
......
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