@@ -799,20 +799,43 @@ where
799799 }
800800}
801801
802- frame_support:: construct_runtime!(
803- pub struct Runtime {
804- // Exclude part `Storage` in order not to check its metadata in tests.
805- System : frame_system exclude_parts { Pallet , Storage } ,
806- Example : pallet,
807- Example2 : pallet2 exclude_parts { Call } ,
808- #[ cfg( feature = "frame-feature-testing" ) ]
809- Example3 : pallet3,
810- Example4 : pallet4 use_parts { Call } ,
802+ #[ frame_support:: runtime]
803+ mod runtime {
804+ #[ runtime:: runtime]
805+ #[ runtime:: derive(
806+ RuntimeCall ,
807+ RuntimeEvent ,
808+ RuntimeError ,
809+ RuntimeOrigin ,
810+ RuntimeFreezeReason ,
811+ RuntimeHoldReason ,
812+ RuntimeSlashReason ,
813+ RuntimeLockId ,
814+ RuntimeTask
815+ ) ]
816+ pub struct Runtime ;
811817
812- #[ cfg( feature = "frame-feature-testing-2" ) ]
813- Example5 : pallet5,
814- }
815- ) ;
818+ #[ runtime:: pallet_index( 0 ) ]
819+ pub type System = frame_system + Call + Event < T > ;
820+
821+ #[ runtime:: pallet_index( 1 ) ]
822+ pub type Example = pallet ;
823+
824+ #[ runtime:: pallet_index( 2 ) ]
825+ #[ runtime:: disable_call]
826+ pub type Example2 = pallet2 ;
827+
828+ #[ cfg( feature = "frame-feature-testing" ) ]
829+ #[ runtime:: pallet_index( 3 ) ]
830+ pub type Example3 = pallet3 ;
831+
832+ #[ runtime:: pallet_index( 4 ) ]
833+ pub type Example4 = pallet4 ;
834+
835+ #[ cfg( feature = "frame-feature-testing-2" ) ]
836+ #[ runtime:: pallet_index( 5 ) ]
837+ pub type Example5 = pallet5 ;
838+ }
816839
817840// Test that the part `RuntimeCall` is excluded from Example2 and included in Example4.
818841fn _ensure_call_is_correctly_excluded_and_included ( call : RuntimeCall ) {
@@ -1847,6 +1870,16 @@ fn metadata() {
18471870 error: None ,
18481871 docs: vec![ " Test that the supertrait check works when we pass some parameter to the `frame_system::Config`." ] ,
18491872 } ,
1873+ PalletMetadata {
1874+ index: 4 ,
1875+ name: "Example4" ,
1876+ storage: None ,
1877+ calls: Some ( meta_type:: <pallet4:: Call <Runtime >>( ) . into( ) ) ,
1878+ event: None ,
1879+ constants: vec![ ] ,
1880+ error: None ,
1881+ docs: vec![ ] ,
1882+ } ,
18501883 #[ cfg( feature = "frame-feature-testing-2" ) ]
18511884 PalletMetadata {
18521885 index: 5 ,
0 commit comments