77include ! ( concat!( env!( "OUT_DIR" ) , "/wasm_binary.rs" ) ) ;
88
99pub mod apis;
10+ #[ cfg( feature = "runtime-benchmarks" ) ]
11+ mod benchmarks;
1012mod configs;
1113mod weights;
1214
@@ -23,7 +25,6 @@ use sp_version::NativeVersion;
2325use sp_version:: RuntimeVersion ;
2426
2527use frame_support:: {
26- construct_runtime,
2728 weights:: {
2829 constants:: WEIGHT_REF_TIME_PER_SECOND , Weight , WeightToFeeCoefficient ,
2930 WeightToFeeCoefficients , WeightToFeePolynomial ,
@@ -232,43 +233,69 @@ pub fn native_version() -> NativeVersion {
232233}
233234
234235// Create the runtime by composing the FRAME pallets that were previously configured.
235- construct_runtime ! (
236- pub enum Runtime {
237- // System support stuff.
238- System : frame_system = 0 ,
239- ParachainSystem : cumulus_pallet_parachain_system = 1 ,
240- Timestamp : pallet_timestamp = 2 ,
241- ParachainInfo : parachain_info = 3 ,
242-
243- // Monetary stuff.
244- Balances : pallet_balances = 10 ,
245- TransactionPayment : pallet_transaction_payment = 11 ,
246-
247- // Governance
248- Sudo : pallet_sudo = 15 ,
249-
250- // Collator support. The order of these 4 are important and shall not change.
251- Authorship : pallet_authorship = 20 ,
252- CollatorSelection : pallet_collator_selection = 21 ,
253- Session : pallet_session = 22 ,
254- Aura : pallet_aura = 23 ,
255- AuraExt : cumulus_pallet_aura_ext = 24 ,
256-
257- // XCM helpers.
258- XcmpQueue : cumulus_pallet_xcmp_queue = 30 ,
259- PolkadotXcm : pallet_xcm = 31 ,
260- CumulusXcm : cumulus_pallet_xcm = 32 ,
261- MessageQueue : pallet_message_queue = 33 ,
262-
263- // Template
264- TemplatePallet : pallet_parachain_template = 50 ,
265- }
266- ) ;
236+ #[ frame_support:: runtime]
237+ mod runtime {
238+ #[ runtime:: runtime]
239+ #[ runtime:: derive(
240+ RuntimeCall ,
241+ RuntimeEvent ,
242+ RuntimeError ,
243+ RuntimeOrigin ,
244+ RuntimeFreezeReason ,
245+ RuntimeHoldReason ,
246+ RuntimeSlashReason ,
247+ RuntimeLockId ,
248+ RuntimeTask
249+ ) ]
250+ pub struct Runtime ;
251+
252+ #[ runtime:: pallet_index( 0 ) ]
253+ pub type System = frame_system ;
254+ #[ runtime:: pallet_index( 1 ) ]
255+ pub type ParachainSystem = cumulus_pallet_parachain_system ;
256+ #[ runtime:: pallet_index( 2 ) ]
257+ pub type Timestamp = pallet_timestamp ;
258+ #[ runtime:: pallet_index( 3 ) ]
259+ pub type ParachainInfo = parachain_info ;
260+
261+ // Monetary stuff.
262+ #[ runtime:: pallet_index( 10 ) ]
263+ pub type Balances = pallet_balances ;
264+ #[ runtime:: pallet_index( 11 ) ]
265+ pub type TransactionPayment = pallet_transaction_payment ;
266+
267+ // Governance
268+ #[ runtime:: pallet_index( 15 ) ]
269+ pub type Sudo = pallet_sudo ;
270+
271+ // Collator support. The order of these 4 are important and shall not change.
272+ #[ runtime:: pallet_index( 20 ) ]
273+ pub type Authorship = pallet_authorship ;
274+ #[ runtime:: pallet_index( 21 ) ]
275+ pub type CollatorSelection = pallet_collator_selection ;
276+ #[ runtime:: pallet_index( 22 ) ]
277+ pub type Session = pallet_session ;
278+ #[ runtime:: pallet_index( 23 ) ]
279+ pub type Aura = pallet_aura ;
280+ #[ runtime:: pallet_index( 24 ) ]
281+ pub type AuraExt = cumulus_pallet_aura_ext ;
282+
283+ // XCM helpers.
284+ #[ runtime:: pallet_index( 30 ) ]
285+ pub type XcmpQueue = cumulus_pallet_xcmp_queue ;
286+ #[ runtime:: pallet_index( 31 ) ]
287+ pub type PolkadotXcm = pallet_xcm ;
288+ #[ runtime:: pallet_index( 32 ) ]
289+ pub type CumulusXcm = cumulus_pallet_xcm ;
290+ #[ runtime:: pallet_index( 33 ) ]
291+ pub type MessageQueue = pallet_message_queue ;
292+ #[ runtime:: pallet_index( 50 ) ]
293+
294+ // Include the custom logic from the pallet-template in the runtime.
295+ pub type TemplatePallet = pallet_parachain_template ;
296+ }
267297
268298cumulus_pallet_parachain_system:: register_validate_block! {
269299 Runtime = Runtime ,
270300 BlockExecutor = cumulus_pallet_aura_ext:: BlockExecutor :: <Runtime , Executive >,
271301}
272-
273- #[ cfg( feature = "runtime-benchmarks" ) ]
274- mod benchmarks;
0 commit comments