Skip to content
Snippets Groups Projects

Fix weight accounting

Merged Benjamin Gallois requested to merge 167-fix-remove-member-weight into master
Compare and Show latest version
2 files
+ 5
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -677,7 +677,6 @@ pub mod pallet {
// this should not be called while the identity is still member
// otherwise there will still be a membership in storage, but no more identity
pub fn do_remove_identity(idty_index: T::IdtyIndex, reason: RemovalReason) -> Weight {
let mut weight = T::WeightInfo::do_remove_identity_noop();
if let Some(idty_value) = Identities::<T>::get(idty_index) {
// this line allows the owner key to be used after that
IdentityIndexOf::<T>::remove(&idty_value.owner_key);
@@ -688,18 +687,18 @@ pub mod pallet {
frame_system::Pallet::<T>::dec_sufficients(&old_owner_key);
}
Self::deposit_event(Event::IdtyRemoved { idty_index, reason });
weight = weight.saturating_add(T::OnIdtyChange::on_idty_change(
let weight = T::OnIdtyChange::on_idty_change(
idty_index,
&IdtyEvent::Removed {
status: idty_value.status,
},
));
weight = weight.saturating_add(
);
return weight.saturating_add(
T::WeightInfo::do_remove_identity()
.saturating_sub(T::WeightInfo::do_remove_identity_handler()),
);
}
weight
T::WeightInfo::do_remove_identity_noop()
}
/// revoke identity
Loading