diff --git a/pallets/certification/src/lib.rs b/pallets/certification/src/lib.rs index 0045814c2df0e1e7615cfa4277126d6eedce11a6..164efbe8e5b579afd51d34775dd7c2820efb2d93 100644 --- a/pallets/certification/src/lib.rs +++ b/pallets/certification/src/lib.rs @@ -543,11 +543,10 @@ pub mod pallet { // implement setting next_issuable_on for certification period impl<T: Config<I>, I: 'static> SetNextIssuableOn<T::BlockNumber, T::IdtyIndex> for Pallet<T, I> { - fn set_next_issuable_on(idty_index: T::IdtyIndex, next_issuable_on: T::BlockNumber) -> Weight { + fn set_next_issuable_on(idty_index: T::IdtyIndex, next_issuable_on: T::BlockNumber) { <StorageIdtyCertMeta<T, I>>::mutate_exists(idty_index, |cert_meta_opt| { let cert_meta = cert_meta_opt.get_or_insert(IdtyCertMeta::default()); cert_meta.next_issuable_on = next_issuable_on; }); - Weight::zero() } } diff --git a/pallets/certification/src/traits.rs b/pallets/certification/src/traits.rs index 6189b35e08c01f079ae4b6bcde9f754bb24c568e..ae6e37c0f2a1b15baf3658897559cdbd19d9fcc0 100644 --- a/pallets/certification/src/traits.rs +++ b/pallets/certification/src/traits.rs @@ -32,7 +32,7 @@ pub trait OnNewcert<IdtyIndex> { issuer_issued_count: u32, receiver: IdtyIndex, receiver_received_count: u32, - ) -> frame_support::dispatch::Weight; + ); } impl<IdtyIndex> OnNewcert<IdtyIndex> for () { fn on_new_cert( @@ -40,8 +40,7 @@ impl<IdtyIndex> OnNewcert<IdtyIndex> for () { _issuer_issued_count: u32, _receiver: IdtyIndex, _receiver_received_count: u32, - ) -> frame_support::dispatch::Weight { - Weight::zero() + ) { } } @@ -52,7 +51,7 @@ pub trait OnRemovedCert<IdtyIndex> { receiver: IdtyIndex, receiver_received_count: u32, expiration: bool, - ) -> frame_support::dispatch::Weight; + ); } impl<IdtyIndex> OnRemovedCert<IdtyIndex> for () { fn on_removed_cert( @@ -61,14 +60,10 @@ impl<IdtyIndex> OnRemovedCert<IdtyIndex> for () { _receiver: IdtyIndex, _receiver_received_count: u32, _expiration: bool, - ) -> frame_support::dispatch::Weight { - Weight::zero() + ) { } } pub trait SetNextIssuableOn<BlockNumber, IdtyIndex> { - fn set_next_issuable_on( - idty_index: IdtyIndex, - next_issuable_on: BlockNumber, - ) -> frame_support::dispatch::Weight; + fn set_next_issuable_on(idty_index: IdtyIndex, next_issuable_on: BlockNumber); } diff --git a/pallets/duniter-wot/src/lib.rs b/pallets/duniter-wot/src/lib.rs index 44f400d1d0f774e5bee2763550f7d2ebb369b636..38951486baff47d6705e302bd70988b8691a286c 100644 --- a/pallets/duniter-wot/src/lib.rs +++ b/pallets/duniter-wot/src/lib.rs @@ -406,11 +406,10 @@ impl<T: Config<I>, I: 'static> pallet_certification::traits::OnNewcert<IdtyIndex _issuer_issued_count: u32, receiver: IdtyIndex, receiver_received_count: u32, - ) -> Weight { + ) { if receiver_received_count == T::MinReceivedCertToBeAbleToIssueCert::get() { Self::do_apply_first_issuable_on(receiver); } - Weight::zero() } } @@ -424,7 +423,7 @@ impl<T: Config<I>, I: 'static> pallet_certification::traits::OnRemovedCert<IdtyI receiver: IdtyIndex, receiver_received_count: u32, _expiration: bool, - ) -> Weight { + ) { if receiver_received_count < T::MinCertForMembership::get() && pallet_membership::Pallet::<T, I>::is_member(&receiver) { @@ -436,8 +435,5 @@ impl<T: Config<I>, I: 'static> pallet_certification::traits::OnRemovedCert<IdtyI } } } - // The weight accounting is performed where the handler is called. - // See remove_cert_inner in pallet-certification. - Weight::zero() } }