@@ -356,12 +356,12 @@ async def unstake_all(
356356 old_identities = old_identities ,
357357 )
358358 elif not hotkey_ss58_address :
359- hotkeys = [(wallet .hotkey_str , wallet .hotkey .ss58_address )]
359+ hotkeys = [(wallet .hotkey_str , wallet .hotkey .ss58_address , None )]
360360 else :
361- hotkeys = [(None , hotkey_ss58_address )]
361+ hotkeys = [(None , hotkey_ss58_address , None )]
362362
363- hotkey_names = {ss58 : name for name , ss58 in hotkeys if name is not None }
364- hotkey_ss58s = [ss58 for _ , ss58 in hotkeys ]
363+ hotkey_names = {ss58 : name for name , ss58 , _ in hotkeys if name is not None }
364+ hotkey_ss58s = [item [ 1 ] for item in hotkeys ]
365365 stake_info = [
366366 stake for stake in stake_info if stake .hotkey_ss58 in hotkey_ss58s
367367 ]
@@ -1058,7 +1058,7 @@ def _get_hotkeys_to_unstake(
10581058 stake_infos : list ,
10591059 identities : dict ,
10601060 old_identities : dict ,
1061- ) -> list [tuple [Optional [str ], str ]]:
1061+ ) -> list [tuple [Optional [str ], str , None ]]:
10621062 """Get list of hotkeys to unstake from based on input parameters.
10631063
10641064 Args:
@@ -1069,26 +1069,28 @@ def _get_hotkeys_to_unstake(
10691069 exclude_hotkeys: List of hotkey names to exclude
10701070
10711071 Returns:
1072- List of tuples containing (hotkey_name, hotkey_ss58) pairs to unstake from
1072+ List of tuples containing (hotkey_name, hotkey_ss58, None) pairs to unstake from. The final None is important
1073+ for compatibility with the `_unstake_selection` function.
10731074 """
10741075 if hotkey_ss58_address :
10751076 print_verbose (f"Unstaking from ss58 ({ hotkey_ss58_address } )" )
1076- return [(None , hotkey_ss58_address )]
1077+ return [(None , hotkey_ss58_address , None )]
10771078
10781079 if all_hotkeys :
10791080 print_verbose ("Unstaking from all hotkeys" )
10801081 all_hotkeys_ = get_hotkey_wallets_for_wallet (wallet = wallet )
10811082 wallet_hotkeys = [
1082- (wallet .hotkey_str , wallet .hotkey .ss58_address )
1083+ (wallet .hotkey_str , wallet .hotkey .ss58_address , None )
10831084 for wallet in all_hotkeys_
10841085 if wallet .hotkey_str not in exclude_hotkeys
10851086 ]
10861087
1087- wallet_hotkey_addresses = {addr for _ , addr in wallet_hotkeys }
1088+ wallet_hotkey_addresses = {hk [ 1 ] for hk in wallet_hotkeys }
10881089 chain_hotkeys = [
10891090 (
10901091 get_hotkey_identity (stake_info .hotkey_ss58 , identities , old_identities ),
10911092 stake_info .hotkey_ss58 ,
1093+ None ,
10921094 )
10931095 for stake_info in stake_infos
10941096 if (
@@ -1103,22 +1105,22 @@ def _get_hotkeys_to_unstake(
11031105 result = []
11041106 for hotkey_identifier in include_hotkeys :
11051107 if is_valid_ss58_address (hotkey_identifier ):
1106- result .append ((None , hotkey_identifier ))
1108+ result .append ((None , hotkey_identifier , None ))
11071109 else :
11081110 wallet_ = Wallet (
11091111 name = wallet .name ,
11101112 path = wallet .path ,
11111113 hotkey = hotkey_identifier ,
11121114 )
1113- result .append ((wallet_ .hotkey_str , wallet_ .hotkey .ss58_address ))
1115+ result .append ((wallet_ .hotkey_str , wallet_ .hotkey .ss58_address , None ))
11141116 return result
11151117
11161118 # Only cli.config.wallet.hotkey is specified
11171119 print_verbose (
11181120 f"Unstaking from wallet: ({ wallet .name } ) from hotkey: ({ wallet .hotkey_str } )"
11191121 )
11201122 assert wallet .hotkey is not None
1121- return [(wallet .hotkey_str , wallet .hotkey .ss58_address )]
1123+ return [(wallet .hotkey_str , wallet .hotkey .ss58_address , None )]
11221124
11231125
11241126def _create_unstake_table (
0 commit comments