Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't check size of PGP fingerprint if it's not set #110

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bittensor_cli/src/bittensor/extrinsics/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ async def is_hotkey_registered(
params=[netuid, hotkey_ss58],
)
if _result is not None:
print(_result)
return True
else:
return False
Expand Down
13 changes: 9 additions & 4 deletions bittensor_cli/src/bittensor/extrinsics/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,22 @@ async def root_register_extrinsic(

# Successful registration, final check for neuron and pubkey
else:
is_registered = await is_hotkey_registered(
subtensor, netuid=0, hotkey_ss58=wallet.hotkey.ss58_address
uid = await subtensor.substrate.query(
module="SubtensorModule",
storage_function="Uids",
params=[0, wallet.hotkey.ss58_address],
)
if is_registered:
console.print(":white_heavy_check_mark: [green]Registered[/green]")
if uid is not None:
console.print(
f":white_heavy_check_mark: [green]Registered with UID {uid}[/green]"
)
return True
else:
# neuron not found, try again
err_console.print(
":cross_mark: [red]Unknown error. Neuron not found.[/red]"
)
return False


async def set_root_weights_extrinsic(
Expand Down
16 changes: 12 additions & 4 deletions bittensor_cli/src/commands/wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ async def _get_total_balance(
(
await subtensor.get_balance(
*(x.coldkeypub.ss58_address for x in _balance_cold_wallets),
block_hash=block_hash
block_hash=block_hash,
)
).values()
)
Expand Down Expand Up @@ -610,8 +610,12 @@ async def overview(

coldkeys_to_check = []
ck_stakes = await subtensor.get_total_stake_for_coldkey(
*(coldkey_wallet.coldkeypub.ss58_address for coldkey_wallet in all_coldkey_wallets if coldkey_wallet.coldkeypub),
block_hash=block_hash
*(
coldkey_wallet.coldkeypub.ss58_address
for coldkey_wallet in all_coldkey_wallets
if coldkey_wallet.coldkeypub
),
block_hash=block_hash,
)
for coldkey_wallet in all_coldkey_wallets:
if coldkey_wallet.coldkeypub:
Expand Down Expand Up @@ -1479,7 +1483,11 @@ async def set_id(
}

for field, string in id_dict.items():
if field == "pgp_fingerprint" and len(pgp_fingerprint_encoded) != 20:
if (
field == "pgp_fingerprint"
and pgp_fingerprint
and len(pgp_fingerprint_encoded) != 20
):
err_console.print(
"[red]Error:[/red] PGP Fingerprint must be exactly 20 bytes."
)
Expand Down
Loading