@@ -720,9 +720,11 @@ fn test_stake_fee_api() {
720
720
stake_amount,
721
721
) ; // Charged a dynamic fee
722
722
let dynamic_fee_5 = SubtensorModule :: calculate_staking_fee (
723
- netuid0,
724
- & hotkey1,
725
- I96F32 :: from_num ( stake_amount) ,
723
+ Some ( ( & hotkey1, netuid0) ) ,
724
+ & coldkey1,
725
+ Some ( ( & hotkey1, root_netuid) ) ,
726
+ & coldkey1,
727
+ I96F32 :: saturating_from_num ( stake_amount) ,
726
728
) ;
727
729
assert_eq ! ( stake_fee_5, dynamic_fee_5) ;
728
730
@@ -735,9 +737,11 @@ fn test_stake_fee_api() {
735
737
stake_amount,
736
738
) ; // Charged a dynamic fee
737
739
let dynamic_fee_6 = SubtensorModule :: calculate_staking_fee (
738
- netuid0,
739
- & hotkey1,
740
- I96F32 :: from_num ( stake_amount) ,
740
+ Some ( ( & hotkey1, netuid0) ) ,
741
+ & coldkey1,
742
+ Some ( ( & hotkey2, netuid0) ) ,
743
+ & coldkey1,
744
+ I96F32 :: saturating_from_num ( stake_amount) ,
741
745
) ;
742
746
assert_eq ! ( stake_fee_6, dynamic_fee_6) ;
743
747
@@ -750,9 +754,11 @@ fn test_stake_fee_api() {
750
754
stake_amount,
751
755
) ; // Charged a dynamic fee
752
756
let dynamic_fee_7 = SubtensorModule :: calculate_staking_fee (
753
- netuid0,
754
- & hotkey1,
755
- I96F32 :: from_num ( stake_amount) ,
757
+ Some ( ( & hotkey1, netuid0) ) ,
758
+ & coldkey1,
759
+ Some ( ( & hotkey1, netuid0) ) ,
760
+ & coldkey2,
761
+ I96F32 :: saturating_from_num ( stake_amount) ,
756
762
) ;
757
763
assert_eq ! ( stake_fee_7, dynamic_fee_7) ;
758
764
@@ -765,9 +771,11 @@ fn test_stake_fee_api() {
765
771
stake_amount,
766
772
) ; // Charged a dynamic fee
767
773
let dynamic_fee_8 = SubtensorModule :: calculate_staking_fee (
768
- netuid0,
769
- & hotkey1,
770
- I96F32 :: from_num ( stake_amount) ,
774
+ Some ( ( & hotkey1, netuid0) ) ,
775
+ & coldkey1,
776
+ Some ( ( & hotkey1, netuid1) ) ,
777
+ & coldkey1,
778
+ I96F32 :: saturating_from_num ( stake_amount) ,
771
779
) ;
772
780
assert_eq ! ( stake_fee_8, dynamic_fee_8) ;
773
781
} ) ;
0 commit comments