@@ -609,8 +609,9 @@ fn test_migrate_dissolve_sn73_pays_out_subnet_tao() {
609
609
( staker_0_hk, staker_0_ck, 100_000_000_000 ) ,
610
610
( staker_1_hk, staker_1_ck, 200_000_000_000 ) ,
611
611
( staker_2_hk, staker_2_ck, 123_456_789_000 ) ,
612
- ( staker_2_hk, delegate_0_ck, 100_000_000_000 ) , // delegates to hk 2
613
- ( staker_2_hk, delegate_1_ck, 200_000_000_000 ) , // delegates to hk 2
612
+ ( staker_2_hk, delegate_0_ck, 400_000_000_000 ) , // delegates to hk 2
613
+ ( staker_2_hk, delegate_1_ck, 500_000_000_000 ) , // delegates to hk 2
614
+ ( staker_1_hk, delegate_0_ck, 456_789_000_000 ) , // delegate 0 also stakes to hk 1
614
615
] ;
615
616
let total_alpha = stakes. iter ( ) . map ( |( _, _, stake) | stake) . sum :: < u64 > ( ) ;
616
617
@@ -640,17 +641,27 @@ fn test_migrate_dissolve_sn73_pays_out_subnet_tao() {
640
641
// Calculate expected balances
641
642
let denom = I96F32 :: from_num ( total_alpha) ;
642
643
let subnet_tao_float = I96F32 :: from_num ( subnet_tao) ;
644
+
645
+ log:: debug!( "Subnet TAO: {}" , subnet_tao) ;
646
+ log:: debug!( "Denom: {}" , denom) ;
643
647
let mut expected_balances: BTreeMap < U256 , u64 > = BTreeMap :: new ( ) ;
644
648
for ( hk, ck, stake) in stakes. iter ( ) {
645
649
// Calculate share of the subnetTAO expected for the coldkey
646
650
let hotkey_alpha = I96F32 :: from_num ( * stake) ;
647
651
let hotkey_share = hotkey_alpha. saturating_div ( denom) ;
648
652
let hotkey_tao = hotkey_share. saturating_mul ( subnet_tao_float) ;
649
653
654
+ log:: debug!(
655
+ "Expected: hk {}, ck {}, stake {}, hotkey_tao {}" ,
656
+ hk,
657
+ ck,
658
+ stake,
659
+ hotkey_tao
660
+ ) ;
650
661
expected_balances
651
662
. entry ( * ck)
652
- . or_insert ( 0 )
653
- . saturating_add ( hotkey_tao. saturating_to_num :: < u64 > ( ) ) ;
663
+ . and_modify ( |e| * e = e . saturating_add ( hotkey_tao . saturating_to_num :: < u64 > ( ) ) )
664
+ . or_insert ( hotkey_tao. saturating_to_num :: < u64 > ( ) ) ;
654
665
}
655
666
656
667
// Verify that each staker has received their share of the subnetTAO
0 commit comments