Skip to content

fix: remove unused --hotkey option and split inspect into two tables#841

Open
Nicknamess96 wants to merge 2 commits intoopentensor:stagingfrom
Nicknamess96:fix/inspect-hotkey-support
Open

fix: remove unused --hotkey option and split inspect into two tables#841
Nicknamess96 wants to merge 2 commits intoopentensor:stagingfrom
Nicknamess96:fix/inspect-hotkey-support

Conversation

@Nicknamess96
Copy link

Summary

Address the remaining work from #233 by removing the regressed --hotkey parameter from the wallet inspect command and splitting the single combined table into two separate, focused tables as suggested by @thewhaleking.

PR #770 previously removed the --hotkey option, but subsequent merges re-introduced the parameter and reverted the help text. This PR re-applies those fixes and additionally splits the inspect output into:

  1. Coldkey Overview table: Coldkey, Balance, Delegate, Stake, Emission
  2. Hotkey Details table: Coldkey, Netuid, Hotkey, Stake, Emission

Changes

  • Removed wallet_hotkey parameter from wallet_inspect CLI handler
  • Updated help text to describe the two-table output format
  • Passed None for hotkey in wallet_ask call (hotkey is not used by inspect)
  • Refactored single 9-column table into two 5-column tables
  • Extracted helper functions: _build_coldkey_table, _build_hotkey_table, _make_delegate_rows, _make_neuron_rows, _resolve_delegate_name, _calculate_daily_return, _format_hotkey_label, _populate_coldkey_table, _populate_hotkey_table
  • Removed unused itertools import
  • Added 17 unit tests covering all new helper functions

Fixes #233

Testing

  • Full unit test suite passes (pytest tests/unit_tests/ -- 81 passed)
  • Formatted with ruff format . (v0.11.5)
  • Linted with ruff check . on changed files

Remove the regressed --hotkey parameter from wallet inspect command
and split the single 9-column table into two focused tables:
a Coldkey Overview table and a Hotkey Details table.

- Remove wallet_hotkey parameter from wallet_inspect signature
- Update help text to reflect coldkey-only wallet display
- Refactor inspect output into separate coldkey and hotkey tables
- Extract helper functions for delegate/neuron row generation
- Add unit tests for all new helper functions
- Remove unused itertools import

Fixes opentensor#233
@thewhaleking thewhaleking requested a review from a team February 26, 2026 07:56
Copy link
Collaborator

@ibraheem-abe ibraheem-abe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Nicknamess96

  • Can you recheck get_delegated method in subtensor.py and compare with how the upstream returns this result? I think we need to update the data structure
  • It will be nice if we also provide a ss58_address option to the command, since there are no extrinsics involved, this will allow users to check data for other coldkeys as well
  • The hotkey details table has tao symbol in staked instead of the subnet's alpha symbol.

Comment on lines 2963 to 2964
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need to remove this

…ommand

- Remove early exit that disabled inspect on rao network
- Add --ss58-address option so users can inspect any coldkey
  without a local wallet file (read-only, no extrinsics)
- Fix hotkey details table to show subnet alpha symbols instead
  of tao symbol by calling Balance.set_unit(netuid)
- Refactor inspect() to work with SS58 addresses directly,
  decoupling data fetching from wallet file existence

Verified get_delegated in subtensor_interface.py — the method
signature and return type match upstream (main and staging).
No data structure update needed.
@Nicknamess96
Copy link
Author

Hey @ibraheem-abe, thanks for the review! Pushed fixes for all points:

1. get_delegated data structure — Checked subtensor_interface.py against both main and staging upstream branches. The method signature (-> list[tuple[DelegateInfo, Balance]]) and the DelegateInfoRuntimeApi call are identical. No data structure update needed at this time.

2. --ss58-address option — Added --ss58-address / --ss58 flag. When provided, the command skips wallet file lookup and queries the chain directly for the given coldkey. Example: btcli wallet inspect --ss58 5FHneW46...

3. Alpha symbol fix — Hotkey details table now calls Balance.set_unit(netuid) so stake and emission display the subnet's alpha symbol instead of τ.

4. Early exit removed — Removed the print_error + raise typer.Exit() that was disabling the command on rao network.

Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants