Allow usage of path in construct_runtime! (#8801)

* Allow usage of path in construct_runtime!

* Fix whitespace

* Fix whitespace

* Make expand_runtime_metadata accept slice instead of Iterator

* Include Call and Event in construct_runtime for testing

* Migrate impl_outer_event to proc macro

* Fix integrity_test_works

* Update UI test expectations

* Factor in module path while generating enum variant or fn names

* Use ParseStream::lookahead for more helpful error messages

* Remove generating outer_event_metadata

* Ensure pallets with different paths but same last path segment can coexist

* Remove unnecessary generated function

* Migrate decl_outer_config to proc macro

* Add default_filter test for expand_outer_origin

* Allow crate, self and super keywords to appear in pallet path

* Add UI test for specifying empty pallet paths in construct_runtime
This commit is contained in:
Keith Yeung
2021-06-01 02:23:41 -07:00
committed by GitHub
parent f85492dcbf
commit 3b1c2f55b2
11 changed files with 1179 additions and 201 deletions
@@ -0,0 +1,13 @@
use frame_support::construct_runtime;
construct_runtime! {
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
system: ,
}
}
fn main() {}
@@ -0,0 +1,5 @@
error: expected one of: `crate`, `self`, `super`, identifier
--> $DIR/empty_pallet_path.rs:9:11
|
9 | system: ,
| ^
@@ -1,4 +1,4 @@
error: expected curly braces
error: expected one of: identifier, curly braces, `<`
--> $DIR/invalid_module_details.rs:9:19
|
9 | system: System::(),