From 0aeaa78cbd71595fdf5e50557cc9cc65f7c1627d Mon Sep 17 00:00:00 2001 From: bgallois <benjamin@gallois.cc> Date: Mon, 18 Dec 2023 13:35:58 +0100 Subject: [PATCH] remove unused BenchmarkSetupHandler trait --- pallets/distance/src/mock.rs | 2 -- pallets/duniter-wot/src/mock.rs | 2 -- pallets/identity/src/lib.rs | 3 --- pallets/identity/src/mock.rs | 2 -- pallets/identity/src/traits.rs | 13 ------------- pallets/quota/src/mock.rs | 2 -- runtime/common/src/pallets_config.rs | 2 -- runtime/common/src/providers.rs | 2 -- 8 files changed, 28 deletions(-) diff --git a/pallets/distance/src/mock.rs b/pallets/distance/src/mock.rs index 988c9b43f..a05d58577 100644 --- a/pallets/distance/src/mock.rs +++ b/pallets/distance/src/mock.rs @@ -245,8 +245,6 @@ impl pallet_identity::Config for Test { type OnIdtyChange = (); type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler = (); } parameter_types! { diff --git a/pallets/duniter-wot/src/mock.rs b/pallets/duniter-wot/src/mock.rs index 9420b482f..268a6bf01 100644 --- a/pallets/duniter-wot/src/mock.rs +++ b/pallets/duniter-wot/src/mock.rs @@ -138,8 +138,6 @@ impl pallet_identity::Config for Test { type OnIdtyChange = (DuniterWot, SmithSubWot); type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler = (); } // Membership diff --git a/pallets/identity/src/lib.rs b/pallets/identity/src/lib.rs index 17c4d3845..c9656a498 100644 --- a/pallets/identity/src/lib.rs +++ b/pallets/identity/src/lib.rs @@ -125,9 +125,6 @@ pub mod pallet { type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>; /// Type representing the weight of this pallet type WeightInfo: WeightInfo; - /// Type representing the a distance handler to prepare identity for benchmarking - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler: SetupBenchmark<Self::IdtyIndex, Self::AccountId>; } // GENESIS STUFF // diff --git a/pallets/identity/src/mock.rs b/pallets/identity/src/mock.rs index 9421a70f0..59242164b 100644 --- a/pallets/identity/src/mock.rs +++ b/pallets/identity/src/mock.rs @@ -118,8 +118,6 @@ impl pallet_identity::Config for Test { type OnIdtyChange = (); type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler = (); } // Build genesis storage according to the mock runtime. diff --git a/pallets/identity/src/traits.rs b/pallets/identity/src/traits.rs index 95bd30641..925714813 100644 --- a/pallets/identity/src/traits.rs +++ b/pallets/identity/src/traits.rs @@ -60,16 +60,3 @@ impl<AccountId, IdtyIndex> LinkIdty<AccountId, IdtyIndex> for () { Ok(()) } } - -/// trait used only in benchmarks to prepare identity for benchmarking -#[cfg(feature = "runtime-benchmarks")] -pub trait SetupBenchmark<IndtyIndex, AccountId> { - fn force_status_ok(idty_index: &IndtyIndex, account: &AccountId) -> (); - fn add_cert(issuer: &IndtyIndex, receiver: &IndtyIndex) -> (); -} - -#[cfg(feature = "runtime-benchmarks")] -impl<IdtyIndex, AccountId> SetupBenchmark<IdtyIndex, AccountId> for () { - fn force_status_ok(_idty_id: &IdtyIndex, _account: &AccountId) -> () {} - fn add_cert(_issuer: &IdtyIndex, _receiver: &IdtyIndex) -> () {} -} diff --git a/pallets/quota/src/mock.rs b/pallets/quota/src/mock.rs index d023eebee..06548263b 100644 --- a/pallets/quota/src/mock.rs +++ b/pallets/quota/src/mock.rs @@ -164,8 +164,6 @@ impl pallet_identity::Config for Test { type OnIdtyChange = (); type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler = (); } // Build genesis storage according to the mock runtime. diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index cf6728e0b..b0a05f386 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -482,8 +482,6 @@ macro_rules! pallets_config { type OnIdtyChange = (Wot, SmithSubWot, Quota); type RuntimeEvent = RuntimeEvent; type WeightInfo = common_runtime::weights::pallet_identity::WeightInfo<Runtime>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetupHandler = common_runtime::providers::BenchmarkSetupHandler<Runtime>; } impl pallet_membership::Config<frame_support::instances::Instance1> for Runtime { diff --git a/runtime/common/src/providers.rs b/runtime/common/src/providers.rs index b9d235720..8eb38d6e7 100644 --- a/runtime/common/src/providers.rs +++ b/runtime/common/src/providers.rs @@ -160,5 +160,3 @@ macro_rules! impl_benchmark_setup_handler { #[cfg(feature = "runtime-benchmarks")] impl_benchmark_setup_handler!(pallet_membership::SetupBenchmark<<T as pallet_identity::Config>::IdtyIndex, T::AccountId>); -#[cfg(feature = "runtime-benchmarks")] -impl_benchmark_setup_handler!(pallet_identity::traits::SetupBenchmark<<T as pallet_identity::Config>::IdtyIndex, T::AccountId>); -- GitLab