From 1ced08dec514d3da4f5860e894e28287cf15a314 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 24 Oct 2024 09:39:02 -0700 Subject: [PATCH 1/2] fix netuid from str to int --- bittensor_cli/src/commands/stake/stake.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bittensor_cli/src/commands/stake/stake.py b/bittensor_cli/src/commands/stake/stake.py index 6a783aab7..b47bd931a 100644 --- a/bittensor_cli/src/commands/stake/stake.py +++ b/bittensor_cli/src/commands/stake/stake.py @@ -1177,7 +1177,7 @@ async def unstake( ): """Unstake token of amount from hotkey(s).""" netuids = ( - [netuid] if netuid is not None else await subtensor.get_all_subnet_netuids() + [int(netuid)] if netuid is not None else await subtensor.get_all_subnet_netuids() ) # Get the hotkey_names (if any) and the hotkey_ss58s. hotkeys_to_unstake_from: list[tuple[Optional[str], str]] = [] @@ -1352,7 +1352,7 @@ async def unstake( f"Amount ({Balance.get_unit(1)})", justify="center", style="dark_sea_green" ) table.add_column( - f"Rate ({Balance.get_unit(0)}/{bt.Balance.get_unit(1)})", + f"Rate ({Balance.get_unit(0)}/{Balance.get_unit(1)})", justify="center", style="light_goldenrod2", ) @@ -1365,7 +1365,7 @@ async def unstake( table.add_column("Slippage", justify="center", style="rgb(220,50,47)") for row in rows: table.add_row(*row) - bt.__console__.print(table) + console.print(table) message = "" if max_float_slippage > 5: message += f"-------------------------------------------------------------------------------------------------------------------\n" From f682bdddfcca416bfa85683ca189d4268edb1b21 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 24 Oct 2024 09:49:12 -0700 Subject: [PATCH 2/2] for `stake_add` fix netuid from str to int --- bittensor_cli/src/commands/stake/stake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bittensor_cli/src/commands/stake/stake.py b/bittensor_cli/src/commands/stake/stake.py index b47bd931a..90eee19c5 100644 --- a/bittensor_cli/src/commands/stake/stake.py +++ b/bittensor_cli/src/commands/stake/stake.py @@ -860,7 +860,7 @@ async def stake_add( """ netuids = ( - [netuid] if netuid is not None else await subtensor.get_all_subnet_netuids() + [int(netuid)] if netuid is not None else await subtensor.get_all_subnet_netuids() ) # Init the table. table = Table(