File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1599,9 +1599,15 @@ async def set_weights(
1599
1599
"""
1600
1600
retries = 0
1601
1601
success = False
1602
- uid = await self .get_uid_for_hotkey_on_subnet (
1603
- wallet .hotkey .ss58_address , netuid
1604
- )
1602
+ if (
1603
+ uid := await self .get_uid_for_hotkey_on_subnet (
1604
+ wallet .hotkey .ss58_address , netuid
1605
+ )
1606
+ ) is None :
1607
+ return (
1608
+ False ,
1609
+ f"Hotkey { wallet .hotkey .ss58_address } not registered in subnet { netuid } " ,
1610
+ )
1605
1611
1606
1612
if (await self .commit_reveal_enabled (netuid = netuid )) is True :
1607
1613
# go with `commit reveal v3` extrinsic
Original file line number Diff line number Diff line change @@ -1836,7 +1836,13 @@ def set_weights(
1836
1836
"""
1837
1837
retries = 0
1838
1838
success = False
1839
- uid = self .get_uid_for_hotkey_on_subnet (wallet .hotkey .ss58_address , netuid )
1839
+ if (
1840
+ uid := self .get_uid_for_hotkey_on_subnet (wallet .hotkey .ss58_address , netuid )
1841
+ ) is None :
1842
+ return (
1843
+ False ,
1844
+ f"Hotkey { wallet .hotkey .ss58_address } not registered in subnet { netuid } " ,
1845
+ )
1840
1846
1841
1847
if self .commit_reveal_enabled (netuid = netuid ) is True :
1842
1848
# go with `commit reveal v3` extrinsic
You can’t perform that action at this time.
0 commit comments