Skip to content
Snippets Groups Projects
Unverified Commit 605274fb authored by bgallois's avatar bgallois
Browse files

remove handlers weights for pallet_certification

parent 34661801
No related branches found
No related tags found
No related merge requests found
Pipeline #34440 passed
......@@ -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()
}
}
......@@ -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);
}
......@@ -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()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment