Skip to content

Commit

Permalink
fix(nomination-pools): Skip ED and TVL check for v6 and v7
Browse files Browse the repository at this point in the history
  • Loading branch information
ukint-vs committed Oct 14, 2024
1 parent 582851f commit 5e290b6
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions substrate/frame/nomination-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3802,15 +3802,19 @@ impl<T: Config> Pallet<T> {
Error::<T>::MaxPoolMembers
);

ensure!(
TotalValueLocked::<T>::get() == expected_tvl,
"TVL deviates from the actual sum of funds of all Pools."
);
if StorageVersion::get::<crate::Pallet<T>>() >= 7 {

ensure!(
TotalValueLocked::<T>::get() <= total_balance_members,
"TVL must be equal to or less than the total balance of all PoolMembers."
);
ensure!(
TotalValueLocked::<T>::get() == expected_tvl,
"TVL deviates from the actual sum of funds of all Pools."
);

ensure!(
TotalValueLocked::<T>::get() <= total_balance_members,
"TVL must be equal to or less than the total balance of all PoolMembers."
);

}

if level <= 1 {
return Ok(())
Expand Down Expand Up @@ -3838,9 +3842,13 @@ impl<T: Config> Pallet<T> {
);
}

// Warn if any pool has incorrect ED frozen. We don't want to fail hard as this could be a
// result of an intentional ED change.
let _ = Self::check_ed_imbalance()?;
if StorageVersion::get::<crate::Pallet<T>>() >= 6 {

// Warn if any pool has incorrect ED frozen. We don't want to fail hard as this could be a
// result of an intentional ED change.
let _ = Self::check_ed_imbalance()?;

}

Ok(())
}
Expand Down

0 comments on commit 5e290b6

Please sign in to comment.