Skip to content

Commit

Permalink
Hotfix - Cli unstake fix (#1233)
Browse files Browse the repository at this point in the history
cli unstake fix
  • Loading branch information
Eugene-hu authored Mar 26, 2023
1 parent 016e05c commit 9443c66
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions bittensor/_cli/commands/unstake.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,6 @@ def run( cli ):
final_amounts: List[Union[float, Balance]] = []
for hotkey in tqdm(hotkeys_to_unstake_from):
hotkey: Tuple[Optional[str], str] # (hotkey_name (or None), hotkey_ss58)
if not subtensor.is_hotkey_registered_any( hotkey_ss58 = hotkey[1] ):
# Hotkey is not registered.
if (len(hotkeys_to_unstake_from) == 1):
# Only one hotkey, error
bittensor.__console__.print(f"[red]Hotkey [bold]{hotkey[1]}[/bold] is not registered. Aborting.[/red]")
return None
else:
# Otherwise, print warning and skip
bittensor.__console__.print(f"[yellow]Hotkey [bold]{hotkey[1]}[/bold] is not registered. Skipping.[/yellow]")
continue

unstake_amount_tao: float = cli.config.get('amount') # The amount specified to unstake.
hotkey_stake: Balance = subtensor.get_stake_for_coldkey_and_hotkey( hotkey_ss58 = hotkey[1], coldkey_ss58 = wallet.coldkeypub.ss58_address )
if unstake_amount_tao == None:
Expand Down

0 comments on commit 9443c66

Please sign in to comment.