diff --git a/pallets/duniter-account/src/lib.rs b/pallets/duniter-account/src/lib.rs
index cf38dba4ec5e215943bd0419149bf7e3cd2cbd5e..d7c5127bc1b23d97abc9c1385837589e37259372 100644
--- a/pallets/duniter-account/src/lib.rs
+++ b/pallets/duniter-account/src/lib.rs
@@ -484,7 +484,7 @@ where
// implement identity event handler
impl<T: Config> pallet_identity::traits::OnIdtyChange<T> for Pallet<T> {
- fn on_idty_change(idty_id: IdtyIdOf<T>, idty_event: &IdtyEvent<T>) -> Weight {
+ fn on_idty_change(idty_id: IdtyIdOf<T>, idty_event: &IdtyEvent<T>) {
match idty_event {
// link account to newly created identity
IdtyEvent::Created { owner_key, .. } => {
@@ -495,8 +495,5 @@ impl<T: Config> pallet_identity::traits::OnIdtyChange<T> for Pallet<T> {
| IdtyEvent::ChangedOwnerKey { .. }
| IdtyEvent::Removed { .. } => {}
}
- // The weight accounting is performed where the handler is called.
- // See in pallet-identity.
- Weight::zero()
}
}
diff --git a/pallets/duniter-wot/src/lib.rs b/pallets/duniter-wot/src/lib.rs
index 38951486baff47d6705e302bd70988b8691a286c..ed1c4fcff06d48093295c82b0a1e148e3dd1248a 100644
--- a/pallets/duniter-wot/src/lib.rs
+++ b/pallets/duniter-wot/src/lib.rs
@@ -363,7 +363,7 @@ where
// implement identity event handler
impl<T: Config<I>, I: 'static> pallet_identity::traits::OnIdtyChange<T> for Pallet<T, I> {
- fn on_idty_change(idty_index: IdtyIndex, idty_event: &IdtyEvent<T>) -> Weight {
+ fn on_idty_change(idty_index: IdtyIndex, idty_event: &IdtyEvent<T>) {
match idty_event {
IdtyEvent::Created { creator, .. } => {
if let Err(e) = <pallet_certification::Pallet<T, I>>::do_add_cert_checked(
@@ -394,7 +394,6 @@ impl<T: Config<I>, I: 'static> pallet_identity::traits::OnIdtyChange<T> for Pall
}
IdtyEvent::Confirmed | IdtyEvent::ChangedOwnerKey { .. } => {}
}
- Weight::zero()
}
}
diff --git a/pallets/identity/src/traits.rs b/pallets/identity/src/traits.rs
index 86acc604be0fc9e5c2d78a9fff4baffde8d6c079..536208cd062539f7d89fad8294f69ff07c9eddf7 100644
--- a/pallets/identity/src/traits.rs
+++ b/pallets/identity/src/traits.rs
@@ -55,16 +55,14 @@ pub trait IdtyNameValidator {
}
pub trait OnIdtyChange<T: Config> {
- fn on_idty_change(idty_index: T::IdtyIndex, idty_event: &IdtyEvent<T>) -> Weight;
+ fn on_idty_change(idty_index: T::IdtyIndex, idty_event: &IdtyEvent<T>);
}
#[impl_for_tuples(5)]
#[allow(clippy::let_and_return)]
impl<T: Config> OnIdtyChange<T> for Tuple {
- fn on_idty_change(idty_index: T::IdtyIndex, idty_event: &IdtyEvent<T>) -> Weight {
- let mut weight = Weight::zero();
- for_tuples!( #( weight = weight.saturating_add(Tuple::on_idty_change(idty_index, idty_event)); )* );
- weight
+ fn on_idty_change(idty_index: T::IdtyIndex, idty_event: &IdtyEvent<T>) {
+ for_tuples!( #( Tuple::on_idty_change(idty_index, idty_event); )* );
}
}
diff --git a/pallets/quota/src/lib.rs b/pallets/quota/src/lib.rs
index 91df0459e3440a6f4bbcfcb595fb3c6377d9c5aa..a2f21df2133475939faec63dde68eb0edb286996 100644
--- a/pallets/quota/src/lib.rs
+++ b/pallets/quota/src/lib.rs
@@ -348,7 +348,7 @@ fn is_eligible_for_refund<T: pallet_identity::Config>(_identity: IdtyId<T>) -> b
// implement identity event handler
impl<T: Config> pallet_identity::traits::OnIdtyChange<T> for Pallet<T> {
- fn on_idty_change(idty_id: IdtyId<T>, idty_event: &IdtyEvent<T>) -> Weight {
+ fn on_idty_change(idty_id: IdtyId<T>, idty_event: &IdtyEvent<T>) {
match idty_event {
// initialize quota on identity creation
IdtyEvent::Created { .. } => {
@@ -365,7 +365,5 @@ impl<T: Config> pallet_identity::traits::OnIdtyChange<T> for Pallet<T> {
}
IdtyEvent::Confirmed | IdtyEvent::Validated | IdtyEvent::ChangedOwnerKey { .. } => {}
}
- // TODO proper weight
- Weight::zero()
}
}
diff --git a/runtime/common/src/handlers.rs b/runtime/common/src/handlers.rs
index 540054ab341379c3410bf2a030835a6290a803df..d59ff5da5e929c19f79493a870141aeadcc5a040 100644
--- a/runtime/common/src/handlers.rs
+++ b/runtime/common/src/handlers.rs
@@ -45,7 +45,7 @@ where
T: pallet_identity::Config<IdtyIndex = IdtyIndex, IdtyData = IdtyData>,
T: pallet_universal_dividend::Config,
{
- fn on_idty_change(idty_index: IdtyIndex, idty_event: &IdtyEvent<T>) -> Weight {
+ fn on_idty_change(idty_index: IdtyIndex, idty_event: &IdtyEvent<T>) {
match idty_event {
IdtyEvent::Validated => {
// when identity is validated, it starts getting right to UD
@@ -64,7 +64,6 @@ where
}
IdtyEvent::Created { .. } | IdtyEvent::Confirmed | IdtyEvent::Removed { .. } => {}
}
- Weight::zero()
}
}