diff --git a/substrate/frame/nomination-pools/src/lib.rs b/substrate/frame/nomination-pools/src/lib.rs index 909a930e3821..ef87de104b4c 100644 --- a/substrate/frame/nomination-pools/src/lib.rs +++ b/substrate/frame/nomination-pools/src/lib.rs @@ -3371,15 +3371,19 @@ impl Pallet { Error::::MaxPoolMembers ); - ensure!( - TotalValueLocked::::get() == expected_tvl, - "TVL deviates from the actual sum of funds of all Pools." - ); + if StorageVersion::get::>() >= 7 { - ensure!( - TotalValueLocked::::get() <= total_balance_members, - "TVL must be equal to or less than the total balance of all PoolMembers." - ); + ensure!( + TotalValueLocked::::get() == expected_tvl, + "TVL deviates from the actual sum of funds of all Pools." + ); + + ensure!( + TotalValueLocked::::get() <= total_balance_members, + "TVL must be equal to or less than the total balance of all PoolMembers." + ); + + } if level <= 1 { return Ok(()) @@ -3404,9 +3408,13 @@ impl Pallet { ); } - // 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::>() >= 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(()) }