File tree 1 file changed +19
-11
lines changed
substrate/frame/nomination-pools/src
1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -3802,15 +3802,19 @@ impl<T: Config> Pallet<T> {
3802
3802
Error :: <T >:: MaxPoolMembers
3803
3803
) ;
3804
3804
3805
- ensure ! (
3806
- TotalValueLocked :: <T >:: get( ) == expected_tvl,
3807
- "TVL deviates from the actual sum of funds of all Pools."
3808
- ) ;
3805
+ if StorageVersion :: get :: < crate :: Pallet < T > > ( ) >= 7 {
3809
3806
3810
- ensure ! (
3811
- TotalValueLocked :: <T >:: get( ) <= total_balance_members,
3812
- "TVL must be equal to or less than the total balance of all PoolMembers."
3813
- ) ;
3807
+ ensure ! (
3808
+ TotalValueLocked :: <T >:: get( ) == expected_tvl,
3809
+ "TVL deviates from the actual sum of funds of all Pools."
3810
+ ) ;
3811
+
3812
+ ensure ! (
3813
+ TotalValueLocked :: <T >:: get( ) <= total_balance_members,
3814
+ "TVL must be equal to or less than the total balance of all PoolMembers."
3815
+ ) ;
3816
+
3817
+ }
3814
3818
3815
3819
if level <= 1 {
3816
3820
return Ok ( ( ) )
@@ -3838,9 +3842,13 @@ impl<T: Config> Pallet<T> {
3838
3842
) ;
3839
3843
}
3840
3844
3841
- // Warn if any pool has incorrect ED frozen. We don't want to fail hard as this could be a
3842
- // result of an intentional ED change.
3843
- let _ = Self :: check_ed_imbalance ( ) ?;
3845
+ if StorageVersion :: get :: < crate :: Pallet < T > > ( ) >= 6 {
3846
+
3847
+ // Warn if any pool has incorrect ED frozen. We don't want to fail hard as this could be a
3848
+ // result of an intentional ED change.
3849
+ let _ = Self :: check_ed_imbalance ( ) ?;
3850
+
3851
+ }
3844
3852
3845
3853
Ok ( ( ) )
3846
3854
}
You can’t perform that action at this time.
0 commit comments