Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nomination-pools): Skip ED and TVL check for v6 and v7 #2

Merged
merged 2 commits into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3371,15 +3371,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 All @@ -3404,9 +3408,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
Loading