Skip to content

Commit 7e2f0d5

Browse files
authored
Merge pull request #585 from opentensor/fix/thewhaleking/wallet-fixes
2 parents 498a1f7 + 9c70d4a commit 7e2f0d5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

bittensor_cli/src/bittensor/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,5 +1443,5 @@ def get_hotkey_pub_ss58(wallet: Wallet) -> str:
14431443
"""
14441444
try:
14451445
return wallet.hotkeypub.ss58_address
1446-
except KeyFileError:
1446+
except (KeyFileError, AttributeError):
14471447
return wallet.hotkey.ss58_address

bittensor_cli/src/commands/wallets.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,15 @@ async def wallet_create(
452452
"error": "",
453453
"data": None,
454454
}
455+
455456
if uri:
456457
try:
457458
keypair = Keypair.create_from_uri(uri)
458-
wallet.set_coldkey(keypair=keypair, encrypt=False, overwrite=False)
459-
wallet.set_coldkeypub(keypair=keypair, encrypt=False, overwrite=False)
460-
wallet.set_hotkey(keypair=keypair, encrypt=False, overwrite=False)
461-
wallet.set_coldkeypub(keypair=keypair, encrypt=False, overwrite=False)
459+
wallet.set_coldkey(keypair=keypair, encrypt=False, overwrite=overwrite)
460+
wallet.set_coldkeypub(keypair=keypair, encrypt=False, overwrite=overwrite)
461+
wallet.set_hotkey(keypair=keypair, encrypt=False, overwrite=overwrite)
462+
wallet.set_hotkeypub(keypair=keypair, encrypt=False, overwrite=overwrite)
463+
wallet.set_coldkeypub(keypair=keypair, encrypt=False, overwrite=overwrite)
462464
output_dict["success"] = True
463465
output_dict["data"] = {
464466
"name": wallet.name,

0 commit comments

Comments
 (0)