@@ -354,7 +354,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
354
354
wait_for_inclusion = True ,
355
355
wait_for_finalization = True ,
356
356
safe_staking = True ,
357
- rate_tolerance = 0.005 , # 0.5%
357
+ rate_tolerance = 0.001 , # 0.5%
358
358
allow_partial_stake = False ,
359
359
)
360
360
assert success is False
@@ -375,7 +375,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
375
375
wait_for_inclusion = True ,
376
376
wait_for_finalization = True ,
377
377
safe_staking = True ,
378
- rate_tolerance = 0.005 , # 0.5%
378
+ rate_tolerance = 0.001 , # 0.5%
379
379
allow_partial_stake = True ,
380
380
)
381
381
assert success is True
@@ -424,13 +424,17 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
424
424
rate_tolerance = 0.005 , # 0.5%
425
425
allow_partial_stake = False ,
426
426
)
427
- assert success is False
427
+ assert success is False , "Unstake should fail."
428
428
429
429
current_stake = subtensor .get_stake (
430
430
alice_wallet .coldkey .ss58_address ,
431
431
bob_wallet .hotkey .ss58_address ,
432
432
netuid = alice_subnet_netuid ,
433
433
)
434
+
435
+ logging .console .info (f"[orange]Current stake: { current_stake } [orange]" )
436
+ logging .console .info (f"[orange]Full stake: { full_stake } [orange]" )
437
+
434
438
assert current_stake == full_stake , (
435
439
"Stake should not change after failed unstake attempt"
436
440
)
@@ -444,7 +448,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
444
448
wait_for_inclusion = True ,
445
449
wait_for_finalization = True ,
446
450
safe_staking = True ,
447
- rate_tolerance = 0.005 , # 0.5%
451
+ rate_tolerance = 0.001 , # 0.5%
448
452
allow_partial_stake = True ,
449
453
)
450
454
assert success is True
@@ -454,6 +458,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
454
458
bob_wallet .hotkey .ss58_address ,
455
459
netuid = alice_subnet_netuid ,
456
460
)
461
+ logging .console .info (f"[orange]Partial unstake: { partial_unstake } [orange]" )
457
462
assert partial_unstake > Balance (0 ), "Some stake should remain"
458
463
459
464
# 3. Higher threshold - should succeed fully
@@ -468,7 +473,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
468
473
rate_tolerance = 0.3 , # 30%
469
474
allow_partial_stake = False ,
470
475
)
471
- assert success is True
476
+ assert success is True , "Unstake should succeed"
472
477
473
478
474
479
def test_safe_swap_stake_scenarios (subtensor , alice_wallet , bob_wallet ):
0 commit comments