function to trigger nullification period, tests for the new functionality and expansion of NetworkData trait

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch
2025-06-04 15:35:48 +03:00
parent c55d9a05d9
commit 1e4abbfe69
5 changed files with 24 additions and 2 deletions

View File

@@ -697,4 +697,13 @@ impl<T: Config> NetworkDataMutateHandler<NetworkData, BalanceOf<T>> for Pallet<T
fn nullify_commission() {
AccumulatedCommission::<T>::set(Default::default());
}
fn trigger_nullification() {
if NullifyNeeded::<T>::get() {
Self::nullify_commission();
NullifyNeeded::<T>::put(false);
} else {
NullifyNeeded::<T>::put(true);
}
}
}