git.delta.rocks / unique-network / refs/commits / 7663d36d3458

difftreelog

feat enable split benchmarks

Yaroslav Bolyukin2021-10-22parent: #1d12e73.patch.diff
in: master

1 file changed

modifiedruntime/src/lib.rsdiffbeforeafterboth
12471247
1248 #[cfg(feature = "runtime-benchmarks")]1248 #[cfg(feature = "runtime-benchmarks")]
1249 impl frame_benchmarking::Benchmark<Block> for Runtime {1249 impl frame_benchmarking::Benchmark<Block> for Runtime {
1250 fn benchmark_metadata(extra: bool) -> (
1251 Vec<frame_benchmarking::BenchmarkList>,
1252 Vec<frame_support::traits::StorageInfo>,
1253 ) {
1254 use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
1255 use frame_support::traits::StorageInfoTrait;
1256
1257 let mut list = Vec::<BenchmarkList>::new();
1258
1259 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);
1260 list_benchmark!(list, extra, pallet_nft, Nft);
1261 list_benchmark!(list, extra, pallet_inflation, Inflation);
1262 list_benchmark!(list, extra, pallet_fungible, Fungible);
1263 list_benchmark!(list, extra, pallet_refungible, Refungible);
1264 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);
1265
1266 let storage_info = AllPalletsWithSystem::storage_info();
1267
1268 return (list, storage_info)
1269 }
1270
1250 fn dispatch_benchmark(1271 fn dispatch_benchmark(
1251 config: frame_benchmarking::BenchmarkConfig1272 config: frame_benchmarking::BenchmarkConfig
1252 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {1273 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
1253 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};1274 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
12541275
1255 let whitelist: Vec<TrackedStorageKey> = vec![1276 let whitelist: Vec<TrackedStorageKey> = vec![
1256 // Alice account1277 // Block Number
1257 hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),1278 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
1258 // // Total Issuance1279 // Total Issuance
1259 // hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),1280 hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
1260 // // Execution Phase1281 // Execution Phase
1261 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),1282 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
1262 // // Event Count1283 // Event Count
1263 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),1284 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
1264 // // System Events1285 // System Events
1265 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),1286 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
1266 ];1287 ];
12671288
1268 let mut batches = Vec::<BenchmarkBatch>::new();1289 let mut batches = Vec::<BenchmarkBatch>::new();
1271 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);1292 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);
1272 add_benchmark!(params, batches, pallet_nft, Nft);1293 add_benchmark!(params, batches, pallet_nft, Nft);
1273 add_benchmark!(params, batches, pallet_inflation, Inflation);1294 add_benchmark!(params, batches, pallet_inflation, Inflation);
1295 add_benchmark!(params, batches, pallet_fungible, Fungible);
1296 add_benchmark!(params, batches, pallet_refungible, Refungible);
1297 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);
12741298
1275 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }1299 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
1276 Ok(batches)1300 Ok(batches)