Skip to content

Commit 2313826

Browse files
committed
Ruff
1 parent 0d77c55 commit 2313826

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

bittensor/core/async_subtensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,14 +2831,14 @@ async def add_stake(
28312831
allow_partial_stake (bool): If true and safe_staking is enabled, allows partial staking when
28322832
the full amount would exceed the price threshold. If false, the entire stake fails if it would
28332833
exceed the threshold. Default is False.
2834-
rate_threshold (float): The maximum allowed price change ratio when staking. For example,
2834+
rate_threshold (float): The maximum allowed price change ratio when staking. For example,
28352835
0.005 = 0.5% maximum price increase. Only used when safe_staking is True. Default is 0.005.
28362836
28372837
Returns:
28382838
bool: ``True`` if the staking is successful, False otherwise.
28392839
2840-
This function enables neurons to increase their stake in the network, enhancing their influence and potential
2841-
rWhen safe_staking is enabled, it provides protection against price fluctuations during the time stake is
2840+
This function enables neurons to increase their stake in the network, enhancing their influence and potential.
2841+
When safe_staking is enabled, it provides protection against price fluctuations during the time stake is
28422842
executed and the time it is actually processed by the chain.
28432843
"""
28442844
amount = check_and_convert_to_balance(amount)
@@ -3632,7 +3632,7 @@ async def unstake(
36323632
allow_partial_stake (bool): If true and safe_staking is enabled, allows partial unstaking when
36333633
the full amount would exceed the price threshold. If false, the entire unstake fails if it would
36343634
exceed the threshold. Default is False.
3635-
rate_threshold (float): The maximum allowed price change ratio when unstaking. For example,
3635+
rate_threshold (float): The maximum allowed price change ratio when unstaking. For example,
36363636
0.005 = 0.5% maximum price decrease. Only used when safe_staking is True. Default is 0.005.
36373637
36383638
Returns:

tests/e2e_tests/test_staking.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,9 @@ def test_safe_swap_stake_scenarios(subtensor, alice_wallet, bob_wallet):
485485
alice_wallet.hotkey.ss58_address,
486486
netuid=dest_netuid,
487487
)
488-
assert dest_stake == Balance(0), "Destination stake should remain 0 after failed swap"
488+
assert dest_stake == Balance(
489+
0
490+
), "Destination stake should remain 0 after failed swap"
489491

490492
# 2. Try swap with higher threshold - should succeed
491493
success = subtensor.swap_stake(
@@ -513,4 +515,6 @@ def test_safe_swap_stake_scenarios(subtensor, alice_wallet, bob_wallet):
513515
alice_wallet.hotkey.ss58_address,
514516
netuid=dest_netuid,
515517
)
516-
assert dest_stake > Balance(0), "Destination stake should be non-zero after successful swap"
518+
assert dest_stake > Balance(
519+
0
520+
), "Destination stake should be non-zero after successful swap"

0 commit comments

Comments
 (0)