Skip to content
Snippets Groups Projects

Fix weight accounting

Merged Benjamin Gallois requested to merge 167-fix-remove-member-weight into master
2 files
+ 33
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -33,6 +33,37 @@ where
}
}
/// Runtime handler for OnNewIdty, calling all implementations of
/// OnNewIdty and implementing logic at the runtime level.
pub struct OnNewIdtyHandler<Runtime>(core::marker::PhantomData<Runtime>);
impl<Runtime: pallet_duniter_wot::Config + pallet_quota::Config>
pallet_identity::traits::OnNewIdty<Runtime> for OnNewIdtyHandler<Runtime>
{
fn on_created(idty_index: &IdtyIndex, creator: &IdtyIndex) {
pallet_duniter_wot::Pallet::<Runtime>::on_created(idty_index, creator);
pallet_quota::Pallet::<Runtime>::on_created(idty_index, creator);
}
}
/// Runtime handler for OnRemoveIdty, calling all implementations of
/// OnRemoveIdty and implementing logic at the runtime level.
pub struct OnRemoveIdtyHandler<Runtime>(core::marker::PhantomData<Runtime>);
impl<Runtime: pallet_duniter_wot::Config + pallet_quota::Config>
pallet_identity::traits::OnRemoveIdty<Runtime> for OnRemoveIdtyHandler<Runtime>
{
fn on_removed(idty_index: &IdtyIndex) -> Weight {
let mut weight = pallet_duniter_wot::Pallet::<Runtime>::on_removed(idty_index);
weight += pallet_quota::Pallet::<Runtime>::on_removed(idty_index);
weight
}
fn on_revoked(idty_index: &IdtyIndex) -> Weight {
let mut weight = pallet_duniter_wot::Pallet::<Runtime>::on_revoked(idty_index);
weight += pallet_quota::Pallet::<Runtime>::on_revoked(idty_index);
weight
}
}
/// Runtime handler for OnNewMembership, calling all implementations of
/// OnNewMembership and implementing logic at the runtime level.
pub struct OnNewMembershipHandler<Runtime>(core::marker::PhantomData<Runtime>);
Loading