@@ -3169,12 +3169,12 @@ fn test_childkey_set_weights_single_parent() {
3169
3169
) ) ;
3170
3170
3171
3171
// Set the min stake very high
3172
- SubtensorModule :: set_weights_min_stake ( stake_to_give_child * 5 ) ;
3172
+ SubtensorModule :: set_stake_threshold ( stake_to_give_child * 5 ) ;
3173
3173
3174
3174
// Check the child has less stake than required
3175
3175
assert ! (
3176
3176
SubtensorModule :: get_stake_for_hotkey_on_subnet( & child, netuid)
3177
- < SubtensorModule :: get_weights_min_stake ( )
3177
+ < SubtensorModule :: get_stake_threshold ( )
3178
3178
) ;
3179
3179
3180
3180
// Check the child cannot set weights
@@ -3192,12 +3192,12 @@ fn test_childkey_set_weights_single_parent() {
3192
3192
assert ! ( !SubtensorModule :: check_weights_min_stake( & child, netuid) ) ;
3193
3193
3194
3194
// Set a minimum stake to set weights
3195
- SubtensorModule :: set_weights_min_stake ( stake_to_give_child - 5 ) ;
3195
+ SubtensorModule :: set_stake_threshold ( stake_to_give_child - 5 ) ;
3196
3196
3197
3197
// Check if the stake for the child is above
3198
3198
assert ! (
3199
3199
SubtensorModule :: get_stake_for_hotkey_on_subnet( & child, netuid)
3200
- >= SubtensorModule :: get_weights_min_stake ( )
3200
+ >= SubtensorModule :: get_stake_threshold ( )
3201
3201
) ;
3202
3202
3203
3203
// Check the child can set weights
@@ -3252,12 +3252,12 @@ fn test_set_weights_no_parent() {
3252
3252
let version_key = SubtensorModule :: get_weights_version_key ( netuid) ;
3253
3253
3254
3254
// Set the min stake very high
3255
- SubtensorModule :: set_weights_min_stake ( stake_to_give_child * 5 ) ;
3255
+ SubtensorModule :: set_stake_threshold ( stake_to_give_child * 5 ) ;
3256
3256
3257
3257
// Check the key has less stake than required
3258
3258
assert ! (
3259
3259
SubtensorModule :: get_stake_for_hotkey_on_subnet( & hotkey, netuid)
3260
- < SubtensorModule :: get_weights_min_stake ( )
3260
+ < SubtensorModule :: get_stake_threshold ( )
3261
3261
) ;
3262
3262
3263
3263
// Check the hotkey cannot set weights
@@ -3275,12 +3275,12 @@ fn test_set_weights_no_parent() {
3275
3275
assert ! ( !SubtensorModule :: check_weights_min_stake( & hotkey, netuid) ) ;
3276
3276
3277
3277
// Set a minimum stake to set weights
3278
- SubtensorModule :: set_weights_min_stake ( stake_to_give_child - 5 ) ;
3278
+ SubtensorModule :: set_stake_threshold ( stake_to_give_child - 5 ) ;
3279
3279
3280
3280
// Check if the stake for the hotkey is above
3281
3281
assert ! (
3282
3282
SubtensorModule :: get_stake_for_hotkey_on_subnet( & hotkey, netuid)
3283
- >= SubtensorModule :: get_weights_min_stake ( )
3283
+ >= SubtensorModule :: get_stake_threshold ( )
3284
3284
) ;
3285
3285
3286
3286
// Check the hotkey can set weights
@@ -3643,6 +3643,7 @@ fn test_do_set_child_below_min_stake() {
3643
3643
// Add network and register hotkey
3644
3644
add_network ( netuid, 13 , 0 ) ;
3645
3645
register_ok_neuron ( netuid, hotkey, coldkey, 0 ) ;
3646
+ StakeThreshold :: < Test > :: set ( 1_000_000_000_000 ) ;
3646
3647
3647
3648
// Attempt to set child
3648
3649
assert_err ! (
@@ -3671,10 +3672,13 @@ fn test_do_remove_stake_clears_pending_childkeys() {
3671
3672
add_network ( netuid, 13 , 0 ) ;
3672
3673
register_ok_neuron ( netuid, hotkey, coldkey, 0 ) ;
3673
3674
3675
+ // Set non-default value for childkey stake threshold
3676
+ StakeThreshold :: < Test > :: set ( 1_000_000_000_000 ) ;
3677
+
3674
3678
SubtensorModule :: increase_stake_on_coldkey_hotkey_account (
3675
3679
& coldkey,
3676
3680
& hotkey,
3677
- ChildkeysMinStake :: < Test > :: get ( ) ,
3681
+ StakeThreshold :: < Test > :: get ( ) ,
3678
3682
) ;
3679
3683
3680
3684
// Attempt to set child
@@ -3720,7 +3724,7 @@ fn test_do_set_child_cooldown_period() {
3720
3724
3721
3725
// Set minimum stake for setting children
3722
3726
let parent_total_stake_original = TotalHotkeyStake :: < Test > :: get ( parent) ;
3723
- TotalHotkeyStake :: < Test > :: insert ( parent, ChildkeysMinStake :: < Test > :: get ( ) ) ;
3727
+ TotalHotkeyStake :: < Test > :: insert ( parent, StakeThreshold :: < Test > :: get ( ) ) ;
3724
3728
3725
3729
// Schedule parent-child relationship
3726
3730
assert_ok ! ( SubtensorModule :: do_schedule_children(
0 commit comments