Reduce the execution time of some tests (#10377)

* Reduce the execution time of some tests

* Fix

* Fix build

* fmt
This commit is contained in:
Kian Paimani
2021-11-28 13:47:33 +01:00
committed by GitHub
parent 1fed3540ba
commit 2fafb9546e
12 changed files with 68 additions and 229 deletions
+21 -1
View File
@@ -301,7 +301,7 @@ mod pallet;
use codec::{Decode, Encode, HasCompact};
use frame_support::{
traits::{Currency, Get},
traits::{ConstU32, Currency, Get},
weights::Weight,
};
use scale_info::TypeInfo;
@@ -807,3 +807,23 @@ where
R::is_known_offence(offenders, time_slot)
}
}
/// Configurations of the benchmarking of the pallet.
pub trait BenchmarkingConfig {
/// The maximum number of validators to use.
type MaxValidators: Get<u32>;
/// The maximum number of nominators to use.
type MaxNominators: Get<u32>;
}
/// A mock benchmarking config for pallet-staking.
///
/// Should only be used for testing.
#[cfg(feature = "std")]
pub struct TestBenchmarkingConfig;
#[cfg(feature = "std")]
impl BenchmarkingConfig for TestBenchmarkingConfig {
type MaxValidators = ConstU32<100>;
type MaxNominators = ConstU32<100>;
}