@@ -256,7 +256,7 @@ impl frame_system::Config for Runtime {
256256
257257impl pallet_validator_set:: Config for Runtime {
258258 type RuntimeEvent = RuntimeEvent ;
259- type WeightInfo = pallet_validator_set :: weights :: SubstrateWeight < Runtime > ;
259+ type WeightInfo = weights :: pallet_validator_set :: WeightInfo < Runtime > ;
260260 type AddRemoveOrigin = EnsureRoot < AccountId > ;
261261 type MaxAuthorities = MaxAuthorities ;
262262 type SetKeysCooldownBlocks = SetKeysCooldownBlocks ;
@@ -289,7 +289,7 @@ impl pallet_babe::Config for Runtime {
289289 type ExpectedBlockTime = ConstU64 < MILLISECS_PER_BLOCK > ;
290290 type EpochChangeTrigger = pallet_babe:: ExternalTrigger ;
291291 type DisabledValidators = Session ;
292- // TODO: weights
292+
293293 type WeightInfo = ( ) ;
294294 type MaxAuthorities = MaxAuthorities ;
295295 type MaxNominators = ConstU32 < 0 > ;
@@ -305,7 +305,7 @@ impl pallet_babe::Config for Runtime {
305305
306306impl pallet_grandpa:: Config for Runtime {
307307 type RuntimeEvent = RuntimeEvent ;
308- // TODO: weights
308+
309309 type WeightInfo = ( ) ;
310310 type MaxAuthorities = MaxAuthorities ;
311311 type MaxNominators = ConstU32 < 0 > ;
@@ -336,14 +336,14 @@ impl pallet_timestamp::Config for Runtime {
336336 type Moment = u64 ;
337337 type OnTimestampSet = Babe ;
338338 type MinimumPeriod = ConstU64 < { SLOT_DURATION / 2 } > ;
339- // TODO: weights
340- type WeightInfo = ( ) ;
339+ type WeightInfo = weights:: pallet_timestamp:: WeightInfo < Runtime > ;
341340}
342341
343342impl pallet_transaction_storage:: Config for Runtime {
344343 type RuntimeEvent = RuntimeEvent ;
345- type WeightInfo = pallet_transaction_storage :: weights :: SubstrateWeight < Runtime > ;
344+ type WeightInfo = weights :: pallet_transaction_storage :: WeightInfo < Runtime > ;
346345 type MaxBlockTransactions = ConstU32 < 512 > ;
346+ // TODO: add here comment
347347 type MaxTransactionSize = ConstU32 < { 8 * 1024 * 1024 } > ;
348348 type StoragePeriod = StoragePeriod ;
349349 type AuthorizationPeriod = AuthorizationPeriod ;
@@ -356,7 +356,7 @@ impl pallet_transaction_storage::Config for Runtime {
356356
357357impl pallet_relayer_set:: Config for Runtime {
358358 type RuntimeEvent = RuntimeEvent ;
359- type WeightInfo = pallet_relayer_set :: weights :: SubstrateWeight < Runtime > ;
359+ type WeightInfo = weights :: pallet_relayer_set :: WeightInfo < Runtime > ;
360360 type AddRemoveOrigin = EnsureRoot < AccountId > ;
361361 type BridgeTxFailCooldownBlocks = BridgeTxFailCooldownBlocks ;
362362}
@@ -631,8 +631,10 @@ pub type Executive = frame_executive::Executive<
631631
632632#[ cfg( feature = "runtime-benchmarks" ) ]
633633mod benches {
634+ use super :: * ;
635+
634636 frame_benchmarking:: define_benchmarks!(
635- [ frame_benchmarking, BaselineBench :: <Runtime >]
637+ [ frame_benchmarking:: baseline , Baseline :: <Runtime >]
636638 [ frame_system, SystemBench :: <Runtime >]
637639 [ pallet_timestamp, Timestamp ]
638640 [ pallet_transaction_storage, TransactionStorage ]
@@ -643,8 +645,22 @@ mod benches {
643645 // [pallet_bridge_parachains, BridgeParachainsBench::<Runtime, bridge_config::WithPolkadotBridgeParachainsInstance>]
644646 // [pallet_bridge_messages, BridgeMessagesBench::<Runtime, bridge_config::WithPeoplePolkadotMessagesInstance>]
645647 ) ;
648+
649+ pub use frame_benchmarking:: { baseline:: Pallet as Baseline , BenchmarkBatch , BenchmarkList } ;
650+ pub use frame_system_benchmarking:: Pallet as SystemBench ;
651+
652+ pub use frame_support:: traits:: { StorageInfoTrait , WhitelistedStorageKeys } ;
653+ pub use pallet_bridge_messages:: benchmarking:: Pallet as BridgeMessagesBench ;
654+ pub use pallet_bridge_parachains:: benchmarking:: Pallet as BridgeParachainsBench ;
655+ pub use sp_storage:: TrackedStorageKey ;
656+
657+ impl frame_system_benchmarking:: Config for Runtime { }
658+ impl frame_benchmarking:: baseline:: Config for Runtime { }
646659}
647660
661+ #[ cfg( feature = "runtime-benchmarks" ) ]
662+ use benches:: * ;
663+
648664impl_runtime_apis ! {
649665 impl sp_api:: Core <Block > for Runtime {
650666 fn version( ) -> RuntimeVersion {
@@ -883,41 +899,18 @@ impl_runtime_apis! {
883899 Vec <frame_benchmarking:: BenchmarkList >,
884900 Vec <frame_support:: traits:: StorageInfo >,
885901 ) {
886- use frame_benchmarking:: { baseline, Benchmarking , BenchmarkList } ;
887- use frame_support:: traits:: StorageInfoTrait ;
888- use frame_system_benchmarking:: Pallet as SystemBench ;
889- use baseline:: Pallet as BaselineBench ;
890-
891- use pallet_bridge_parachains:: benchmarking:: Pallet as BridgeParachainsBench ;
892- use pallet_bridge_messages:: benchmarking:: Pallet as BridgeMessagesBench ;
893-
894902 let mut list = Vec :: <BenchmarkList >:: new( ) ;
895903 list_benchmarks!( list, extra) ;
896904
897905 let storage_info = AllPalletsWithSystem :: storage_info( ) ;
898-
899906 ( list, storage_info)
900907 }
901908
902909 #[ allow( non_local_definitions) ]
903910 fn dispatch_benchmark(
904911 config: frame_benchmarking:: BenchmarkConfig
905912 ) -> Result <Vec <frame_benchmarking:: BenchmarkBatch >, alloc:: string:: String > {
906- use sp_storage:: TrackedStorageKey ;
907- use frame_benchmarking:: { baseline, Benchmarking , BenchmarkBatch } ;
908-
909- use frame_system_benchmarking:: Pallet as SystemBench ;
910- use baseline:: Pallet as BaselineBench ;
911-
912- use pallet_bridge_parachains:: benchmarking:: Pallet as BridgeParachainsBench ;
913- use pallet_bridge_messages:: benchmarking:: Pallet as BridgeMessagesBench ;
914-
915- impl frame_system_benchmarking:: Config for Runtime { }
916- impl baseline:: Config for Runtime { }
917-
918- use frame_support:: traits:: WhitelistedStorageKeys ;
919913 let whitelist: Vec <TrackedStorageKey > = AllPalletsWithSystem :: whitelisted_storage_keys( ) ;
920-
921914 let mut batches = Vec :: <BenchmarkBatch >:: new( ) ;
922915 let params = ( & config, & whitelist) ;
923916 add_benchmarks!( params, batches) ;
0 commit comments