Skip to content

Commit 0401f08

Browse files
committed
Fix test_do_move_max_values
1 parent e616286 commit 0401f08

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pallets/subtensor/src/tests/move_stake.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ fn test_do_move_storage_updates() {
724724

725725
// 18. test_do_move_max_values
726726
// Description: Test moving the maximum possible stake values to check for overflows
727-
// SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --test move -- test_do_move_max_values --exact --nocapture
727+
// SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --package pallet-subtensor --lib -- tests::move_stake::test_do_move_max_values --exact --show-output
728728
#[test]
729729
fn test_do_move_max_values() {
730730
new_test_ext(1).execute_with(|| {
@@ -740,6 +740,11 @@ fn test_do_move_max_values() {
740740
// Set up initial stake with maximum value
741741
SubtensorModule::create_account_if_non_existent(&coldkey, &origin_hotkey);
742742
SubtensorModule::create_account_if_non_existent(&coldkey, &destination_hotkey);
743+
744+
// Add lots of liquidity to bypass low liquidity check
745+
SubnetTAO::<Test>::insert(netuid, u64::MAX/1000);
746+
SubnetAlphaIn::<Test>::insert(netuid, u64::MAX/1000);
747+
743748
SubtensorModule::stake_into_subnet(&origin_hotkey, &coldkey, netuid, max_stake, fee);
744749
let alpha = SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet(
745750
&origin_hotkey,
@@ -773,7 +778,7 @@ fn test_do_move_max_values() {
773778
netuid
774779
),
775780
alpha,
776-
epsilon = 5
781+
epsilon = alpha / 1_000_000
777782
);
778783
});
779784
}

0 commit comments

Comments
 (0)