--- a/Makefile +++ b/Makefile @@ -146,5 +146,5 @@ make _bench PALLET=app-promotion PALLET_DIR=app-promotion .PHONY: bench -# Disabled: bench-scheduler, bench-rmrk-core, bench-rmrk-equip -bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-collator-selection bench-identity +# Disabled: bench-scheduler, bench-collator-selection, bench-rmrk-core, bench-rmrk-equip +bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-identity --- a/pallets/collator-selection/src/benchmarking.rs +++ b/pallets/collator-selection/src/benchmarking.rs @@ -128,10 +128,10 @@ let candidates = (0..count) .map(|c| account("candidate", c, SEED)) .collect::>(); - /*assert!( + assert!( >::get() > 0u32.into(), "Bond cannot be zero!" - );*/ + ); for who in candidates { T::Currency::make_free_balance_be(&who, >::get() * 2u32.into()); @@ -144,10 +144,10 @@ let candidates = (0..count) .map(|c| account("candidate", c, SEED)) .collect::>(); - /*assert!( + assert!( >::get() > 0u32.into(), "Bond cannot be zero!" - );*/ + ); for who in candidates { T::Currency::make_free_balance_be(&who, >::get() * 2u32.into()); @@ -158,6 +158,9 @@ benchmarks! { where_clause { where T: pallet_authorship::Config + session::Config + configuration::Config } + // todo:collator this and all the following do not work for some reason, going all the way up to 10 in length + // Both invulnerables and candidates count together against MaxCollators. + // Maybe try putting it in braces? 1 .. (T::MaxCollators::get() - 2) add_invulnerable { let b in 1 .. T::MaxCollators::get() - 3; register_validators::(b); --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -219,13 +219,13 @@ type DefaultCollatorSelectionMaxCollators = MaxCollators; type DefaultCollatorSelectionKickThreshold = KickThreshold; type DefaultCollatorSelectionLicenseBond = LicenseBond; - // the following we don't care about + // the following constants we don't care about type DefaultWeightToFeeCoefficient = DefaultWeightToFeeCoefficient; type DefaultMinGasPrice = DefaultMinGasPrice; type MaxXcmAllowedLocations = MaxXcmAllowedLocations; type AppPromotionDailyRate = AppPromotionDailyRate; type DayRelayBlocks = DayRelayBlocks; - type WeightInfo = (); + type WeightInfo = pallet_configuration::weights::SubstrateWeight; } ord_parameter_types! {