@@ -3425,6 +3425,8 @@ fn test_parent_child_chain_emission() {
3425
3425
SubtensorModule :: set_tao_weight ( 0 ) ;
3426
3426
3427
3427
let hardcoded_emission: I96F32 = I96F32 :: from_num ( 1_000_000 ) ; // 1 million (adjust as needed)
3428
+ let emission_as_alpha =
3429
+ I96F32 :: from_num ( hardcoded_emission) / SubtensorModule :: get_alpha_price ( netuid) ;
3428
3430
3429
3431
// Set pending emission to 0
3430
3432
PendingEmission :: < Test > :: insert ( netuid, 0 ) ;
@@ -3489,22 +3491,31 @@ fn test_parent_child_chain_emission() {
3489
3491
rel_stake_inc_c
3490
3492
) ;
3491
3493
3492
- let hotkeys = [ hotkey_a, hotkey_b, hotkey_c] ;
3493
- let mut total_stake_now = 0 ;
3494
- for ( hotkey, netuid, stake) in TotalHotkeyAlpha :: < Test > :: iter ( ) {
3495
- if hotkeys. contains ( & hotkey) {
3496
- total_stake_now += stake;
3497
- } else {
3498
- log:: info!( "hotkey: {:?}, netuid: {:?}, stake: {:?}" , hotkey, netuid, stake) ;
3499
- }
3500
- }
3501
- log:: info!( "total_stake_now: {:?}, total_stake_new: {:?}" , total_stake_now, total_stake_new) ;
3494
+ let hotkeys = [ hotkey_a, hotkey_b, hotkey_c] ;
3495
+ let mut total_stake_now = 0 ;
3496
+ for ( hotkey, netuid, stake) in TotalHotkeyAlpha :: < Test > :: iter ( ) {
3497
+ if hotkeys. contains ( & hotkey) {
3498
+ total_stake_now += stake;
3499
+ } else {
3500
+ log:: info!(
3501
+ "hotkey: {:?}, netuid: {:?}, stake: {:?}" ,
3502
+ hotkey,
3503
+ netuid,
3504
+ stake
3505
+ ) ;
3506
+ }
3507
+ }
3508
+ log:: info!(
3509
+ "total_stake_now: {:?}, total_stake_new: {:?}" ,
3510
+ total_stake_now,
3511
+ total_stake_new
3512
+ ) ;
3502
3513
3503
3514
let eps: I96F32 = I96F32 :: from_num ( 10_000 ) ;
3504
3515
assert ! (
3505
- ( total_stake_new - ( total_stake_old + hardcoded_emission ) ) . abs( ) <= eps,
3516
+ ( total_stake_new - ( total_stake_old + emission_as_alpha ) ) . abs( ) <= eps,
3506
3517
"Total stake should have increased by the hardcoded emission amount {:?}" ,
3507
- total_stake_new - ( total_stake_old + hardcoded_emission )
3518
+ total_stake_new - ( total_stake_old + emission_as_alpha )
3508
3519
) ;
3509
3520
} ) ;
3510
3521
}
0 commit comments