Simplify the template (#2072)

* Simplify the template

* Fix and use generated whitelisted keys

* Fixes

* Update Substrate to fix compilation

* 🤦
This commit is contained in:
Bastian Köcher
2023-01-19 13:04:14 +01:00
committed by GitHub
parent 5afb483cd5
commit 95b57c3e8c
2 changed files with 20 additions and 35 deletions
@@ -217,5 +217,6 @@ fn testnet_genesis(
polkadot_xcm: parachain_template_runtime::PolkadotXcmConfig { polkadot_xcm: parachain_template_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION), safe_xcm_version: Some(SAFE_XCM_VERSION),
}, },
transaction_payment: Default::default(),
} }
} }
+19 -35
View File
@@ -462,42 +462,36 @@ construct_runtime!(
UncheckedExtrinsic = UncheckedExtrinsic, UncheckedExtrinsic = UncheckedExtrinsic,
{ {
// System support stuff. // System support stuff.
System: frame_system::{Pallet, Call, Config, Storage, Event<T>} = 0, System: frame_system = 0,
ParachainSystem: cumulus_pallet_parachain_system::{ ParachainSystem: cumulus_pallet_parachain_system = 1,
Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned, Timestamp: pallet_timestamp = 2,
} = 1, ParachainInfo: parachain_info = 3,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2,
ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3,
// Monetary stuff. // Monetary stuff.
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 10, Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 11, TransactionPayment: pallet_transaction_payment = 11,
// Collator support. The order of these 4 are important and shall not change. // Collator support. The order of these 4 are important and shall not change.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 20, Authorship: pallet_authorship = 20,
CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 21, CollatorSelection: pallet_collator_selection = 21,
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 22, Session: pallet_session = 22,
Aura: pallet_aura::{Pallet, Storage, Config<T>} = 23, Aura: pallet_aura = 23,
AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, AuraExt: cumulus_pallet_aura_ext = 24,
// XCM helpers. // XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, XcmpQueue: cumulus_pallet_xcmp_queue = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config} = 31, PolkadotXcm: pallet_xcm = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, CumulusXcm: cumulus_pallet_xcm = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33, DmpQueue: cumulus_pallet_dmp_queue = 33,
// Template // Template
TemplatePallet: pallet_template::{Pallet, Call, Storage, Event<T>} = 40, TemplatePallet: pallet_template = 40,
} }
); );
#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
mod benches { mod benches {
define_benchmarks!( frame_benchmarking::define_benchmarks!(
[frame_system, SystemBench::<Runtime>] [frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances] [pallet_balances, Balances]
[pallet_session, SessionBench::<Runtime>] [pallet_session, SessionBench::<Runtime>]
@@ -679,18 +673,8 @@ impl_runtime_apis! {
use cumulus_pallet_session_benchmarking::Pallet as SessionBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
impl cumulus_pallet_session_benchmarking::Config for Runtime {} impl cumulus_pallet_session_benchmarking::Config for Runtime {}
let whitelist: Vec<TrackedStorageKey> = vec![ use frame_support::traits::WhitelistedStorageKeys;
// Block Number let whitelist = AllPalletsWithSystem::whitelisted_storage_keys();
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
// Total Issuance
hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
// Execution Phase
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
// Event Count
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
// System Events
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
];
let mut batches = Vec::<BenchmarkBatch>::new(); let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&config, &whitelist); let params = (&config, &whitelist);