diff --git a/pallets/authority-members/src/lib.rs b/pallets/authority-members/src/lib.rs index 3dbe5e113017c3549eaefcb7d4da1d5be22f5117..355eb1ff7f517e0567ef64aae7926b26d49336fe 100644 --- a/pallets/authority-members/src/lib.rs +++ b/pallets/authority-members/src/lib.rs @@ -405,7 +405,7 @@ pub mod pallet { // Emit event Self::deposit_event(Event::MemberRemoved { member: member_id }); - let _ = T::OnRemovedMember::on_removed_member(member_id); + T::OnRemovedMember::on_removed_member(member_id); } /// perform incoming authorities insertion fn insert_in(member_id: T::MemberId) -> bool { diff --git a/pallets/authority-members/src/traits.rs b/pallets/authority-members/src/traits.rs index 3cd7566d9b2752ff8e151f5faf9f0af106e3d7d8..81f36396e9e1b5f3cd4baebc3c07c6c4f013365e 100644 --- a/pallets/authority-members/src/traits.rs +++ b/pallets/authority-members/src/traits.rs @@ -15,24 +15,19 @@ // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. use super::SessionIndex; -use frame_support::pallet_prelude::Weight; pub trait OnNewSession { - fn on_new_session(index: SessionIndex) -> Weight; + fn on_new_session(index: SessionIndex); } impl OnNewSession for () { - fn on_new_session(_: SessionIndex) -> Weight { - Weight::zero() - } + fn on_new_session(_: SessionIndex) {} } pub trait OnRemovedMember<MemberId> { - fn on_removed_member(member_id: MemberId) -> Weight; + fn on_removed_member(member_id: MemberId); } impl<MemberId> OnRemovedMember<MemberId> for () { - fn on_removed_member(_: MemberId) -> Weight { - Weight::zero() - } + fn on_removed_member(_: MemberId) {} } diff --git a/pallets/distance/src/lib.rs b/pallets/distance/src/lib.rs index 62a33b4fa55f7915a41d2c940b95d7b0306a4705..0a13a751c08fc503f07c50da2dca6b399582f4f9 100644 --- a/pallets/distance/src/lib.rs +++ b/pallets/distance/src/lib.rs @@ -461,7 +461,7 @@ pub mod pallet { } impl<T: Config> pallet_authority_members::OnNewSession for Pallet<T> { - fn on_new_session(index: SessionIndex) -> Weight { + fn on_new_session(index: SessionIndex) { EvaluationBlock::<T>::set(frame_system::Pallet::<T>::parent_hash()); // Make results expire @@ -505,7 +505,6 @@ pub mod pallet { ); } } - Weight::zero() } } diff --git a/runtime/common/src/handlers.rs b/runtime/common/src/handlers.rs index 194a9f3acfb7ef7d1a850869f638580ec3ee35a9..a0a084988ca7a8440c278027b707fcce8247d6a9 100644 --- a/runtime/common/src/handlers.rs +++ b/runtime/common/src/handlers.rs @@ -29,9 +29,9 @@ impl<Runtime> pallet_authority_members::traits::OnNewSession for OnNewSessionHan where Runtime: pallet_provide_randomness::Config + pallet_distance::Config, { - fn on_new_session(index: sp_staking::SessionIndex) -> Weight { + fn on_new_session(index: sp_staking::SessionIndex) { pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch(); - pallet_distance::Pallet::<Runtime>::on_new_session(index) + pallet_distance::Pallet::<Runtime>::on_new_session(index); } } @@ -154,11 +154,9 @@ impl<Runtime> pallet_authority_members::traits::OnRemovedMember<IdtyIndex> where Runtime: frame_system::Config + pallet_membership::Config<Instance2, IdtyId = IdtyIndex>, { - fn on_removed_member(idty_index: IdtyIndex) -> Weight { + fn on_removed_member(idty_index: IdtyIndex) { // TODO investigate why we should remove smith membership when removing authority member pallet_membership::Pallet::<Runtime, Instance2>::force_revoke_membership(idty_index); - // TODO investigate why weight zero - Weight::zero() } }