@@ -17,23 +17,25 @@ impl<T: Config> Pallet<T> {
17
17
pub fn check_accounting_invariants ( ) -> Result < ( ) , sp_runtime:: TryRuntimeError > {
18
18
use frame_support:: traits:: fungible:: Inspect ;
19
19
20
- // Calculate the total staked amount
21
- let total_staked = SubnetTAO :: < T > :: iter ( ) . fold ( 0u64 , |acc, ( netuid, stake) | {
22
- let acc = acc. saturating_add ( stake) ;
20
+ // Disabled: https://github.com/opentensor/subtensor/pull/1166
21
+ //
22
+ // // Calculate the total staked amount
23
+ // let total_staked = SubnetTAO::<T>::iter().fold(0u64, |acc, (netuid, stake)| {
24
+ // let acc = acc.saturating_add(stake);
23
25
24
- if netuid == Self :: get_root_netuid ( ) {
25
- // root network doesn't have initial pool TAO
26
- acc
27
- } else {
28
- acc. saturating_sub ( POOL_INITIAL_TAO )
29
- }
30
- } ) ;
26
+ // if netuid == Self::get_root_netuid() {
27
+ // // root network doesn't have initial pool TAO
28
+ // acc
29
+ // } else {
30
+ // acc.saturating_sub(POOL_INITIAL_TAO)
31
+ // }
32
+ // });
31
33
32
- // Verify that the calculated total stake matches the stored TotalStake
33
- ensure ! (
34
- total_staked == TotalStake :: <T >:: get( ) ,
35
- "TotalStake does not match total staked" ,
36
- ) ;
34
+ // // Verify that the calculated total stake matches the stored TotalStake
35
+ // ensure!(
36
+ // total_staked == TotalStake::<T>::get(),
37
+ // "TotalStake does not match total staked",
38
+ // );
37
39
38
40
// Get the total subnet locked amount
39
41
let total_subnet_locked = Self :: get_total_subnet_locked ( ) ;
@@ -43,7 +45,7 @@ impl<T: Config> Pallet<T> {
43
45
44
46
// Calculate the expected total issuance
45
47
let expected_total_issuance = currency_issuance
46
- . saturating_add ( total_staked )
48
+ . saturating_add ( TotalStake :: < T > :: get ( ) )
47
49
. saturating_add ( total_subnet_locked) ;
48
50
49
51
// Verify the diff between calculated TI and actual TI is less than delta
0 commit comments