Skip to content

Commit

Permalink
Use better functions
Browse files Browse the repository at this point in the history
  • Loading branch information
keithtensor committed Jan 9, 2025
1 parent 028244f commit 3b46cff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pallets/subtensor/src/tests/children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,7 @@ fn test_childkey_set_weights_single_parent() {

// Check the child has less stake than required
assert!(
SubtensorModule::get_stake_for_hotkey_on_subnet(&child, netuid)
SubtensorModule::get_stake_weights_for_hotkey_on_subnet(&child, netuid).0
< SubtensorModule::get_stake_threshold()
);

Expand All @@ -2713,11 +2713,11 @@ fn test_childkey_set_weights_single_parent() {
// Set a minimum stake to set weights
SubtensorModule::set_stake_threshold(stake_to_give_child - 5);

let (total_stakes, _, _) = SubtensorModule::get_stake_weights_for_network(netuid);
let child_stake = total_stakes[child.as_usize()];

// Check if the stake for the child is above
assert!(child_stake >= SubtensorModule::get_stake_threshold());
assert!(
SubtensorModule::get_stake_weights_for_hotkey_on_subnet(&child, netuid).0
>= SubtensorModule::get_stake_threshold()
);

// Check the child can set weights
assert_ok!(SubtensorModule::set_weights(
Expand Down

0 comments on commit 3b46cff

Please sign in to comment.