-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Abstract away the executive #14742
base: master
Are you sure you want to change the base?
Abstract away the executive #14742
Changes from 1 commit
84c4e25
3fc33ad
b1e5d3e
74ea0d8
6c76f2c
10eac86
2275555
d802240
99adead
b3b0afe
2fbed47
747084d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,8 @@ pub fn expand_executive( | |
) -> Result<TokenStream> { | ||
let executive = generate_crate_access_2018("frame-executive")?; | ||
|
||
let on_runtime_upgrade = match executive_section.custom_on_runtime_upgrade { | ||
Some(custom) => quote!(#custom), | ||
let migrations = match executive_section.migration_section { | ||
Some(migrations) => quote!(#migrations), | ||
None => quote!(()), | ||
}; | ||
|
||
|
@@ -67,7 +67,7 @@ pub fn expand_executive( | |
#system::ChainContext<#runtime>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is kinda cheating, if you want to be pedantic. There's now no good way to configure this. But I am not sure if this is all that useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I will add the support to provide a custom Executive as well, using the syntax you suggested above. |
||
#runtime, | ||
AllPalletsWithSystem, | ||
#on_runtime_upgrade | ||
(#migrations) | ||
>; | ||
|
||
impl #runtime { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ impl frame_system::Config for Runtime { | |
struct Dummy; | ||
|
||
construct_runtime! { | ||
pub struct Runtime<Dummy> | ||
type Migrations = (Dummy); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it work if you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it parses correctly and throws the correct error. |
||
pub struct Runtime | ||
{ | ||
System: frame_system | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will play nicely with the new
frame
crate, it should re-export theframe-executive
.