Skip to content
Snippets Groups Projects
Commit 1d46a43a authored by Cédric Moreau's avatar Cédric Moreau
Browse files

wip: refact: mutate_pool_for_session

parent 65905fcc
No related branches found
No related tags found
No related merge requests found
...@@ -239,7 +239,7 @@ pub mod pallet { ...@@ -239,7 +239,7 @@ pub mod pallet {
Error::<T, I>::ManyEvaluationsInBlock, Error::<T, I>::ManyEvaluationsInBlock,
); );
Pallet::<T, I>::mutate_current_pool( Pallet::<T, I>::mutate_pool_for_session(
pallet_session::CurrentIndex::<T>::get().wrapping_add(1), pallet_session::CurrentIndex::<T>::get().wrapping_add(1),
|result_pool| { |result_pool| {
ensure!( ensure!(
...@@ -279,7 +279,7 @@ pub mod pallet { ...@@ -279,7 +279,7 @@ pub mod pallet {
who: T::AccountId, who: T::AccountId,
idty_index: <T as pallet_certification::Config<I>>::IdtyIndex, idty_index: <T as pallet_certification::Config<I>>::IdtyIndex,
) -> Result<(), DispatchError> { ) -> Result<(), DispatchError> {
Pallet::<T, I>::mutate_current_pool( Pallet::<T, I>::mutate_pool_for_session(
pallet_session::CurrentIndex::<T>::get(), pallet_session::CurrentIndex::<T>::get(),
|current_pool| { |current_pool| {
ensure!( ensure!(
...@@ -305,7 +305,7 @@ pub mod pallet { ...@@ -305,7 +305,7 @@ pub mod pallet {
impl<T: Config<I>, I: 'static> Pallet<T, I> { impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Mutate the evaluation pool containing the results to be applied on this session. /// Mutate the evaluation pool containing the results to be applied on this session.
fn mutate_current_pool< fn mutate_pool_for_session<
R, R,
F: FnOnce( F: FnOnce(
&mut EvaluationPool< &mut EvaluationPool<
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment