Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return type annotation for alpha_to_tao_with_slippage #311

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bittensor_cli/src/bittensor/chain_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,9 @@ def tao_to_alpha_with_slippage(self, tao: Balance) -> tuple[Balance, Balance]:
)
return alpha_returned, slippage, slippage_pct_float

def alpha_to_tao_with_slippage(self, alpha: Balance) -> tuple[Balance, Balance]:
def alpha_to_tao_with_slippage(
self, alpha: Balance
) -> tuple[Balance, Balance, float]:
"""
Returns an estimate of how much TAO would a staker receive if they unstake their alpha using the current pool state.
Args:
Expand Down
10 changes: 2 additions & 8 deletions bittensor_cli/src/commands/sudo.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,7 @@ async def senate_vote(
return False

# Unlock the wallet.
if (
not unlock_key(wallet, "hot").success
and unlock_key(wallet, "cold").success
):
if not unlock_key(wallet, "hot").success and unlock_key(wallet, "cold").success:
return False

console.print(f"Fetching proposals in [dark_orange]network: {subtensor.network}")
Expand Down Expand Up @@ -736,10 +733,7 @@ async def _do_set_take() -> bool:
f"Setting take on [{COLOR_PALETTE['GENERAL']['LINKS']}]network: {subtensor.network}"
)

if (
not unlock_key(wallet, "hot").success
and unlock_key(wallet, "cold").success
):
if not unlock_key(wallet, "hot").success and unlock_key(wallet, "cold").success:
return False

result_ = await _do_set_take()
Expand Down
Loading