refactor: inline single-use _get_contract_child_storage_key - #801
Merged
anderdc merged 3 commits intoApr 28, 2026
Merged
Conversation
_get_contract_child_storage_key was a private wrapper with one caller — _read_issues_from_child_storage — that just added a try/except plus a verbose debug log around get_contract_child_storage_key. The neighbouring _read_contract_packed_storage already calls get_contract_child_storage_key directly, so the wrapper wasn't a load-bearing abstraction. Inlining matches the pattern from entrius#748 / entrius#641 (remove single-use indirection). The inline version preserves the same behaviour: try the RPC, log the failure when --verbose, and treat both empty results and exceptions as "no child storage key". The "Cannot read issues" debug line now includes the contract address so a `gitt issues list -v` against a missing contract is easier to diagnose. Net: -27 / +8 lines; tests/cli already cover the path through read_issues_from_contract.
Contributor
Author
|
@anderdc @LandynDev — friendly ping for review when you have a moment. This is the same family as #748 (which you merged) — single-use private helper inlined into its only caller. Happy to rebase if needed. |
anderdc
approved these changes
Apr 28, 2026
This was referenced Apr 28, 2026
plind-junior
added a commit
to plind-junior/gittensor
that referenced
this pull request
Apr 30, 2026
…lper - Restore additional_acceptable_branches dropped during rebase (jupyterlab, FastGPT, monero, nextcloud/desktop, nextcloud/server, zed) — added upstream in entrius#831 and lost when this branch was based on a stale snapshot. - Add entrius/das-github-mirror at weight 0.2 with trusted_label_pipeline (deliverable entrius#4 from issue entrius#911). - Inline _label_actor_trusted into _resolve_maintainer_set_label per the codebase's single-use-helper convention (entrius#818/entrius#811/entrius#801); drop the now-redundant TestLabelActorTrusted truth table since coverage lives in TestLabelResolution end-to-end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`_get_contract_child_storage_key` in gittensor/cli/issue_commands/helpers.py was a private wrapper with exactly one caller — `_read_issues_from_child_storage` — that just added a try/except plus a verbose debug log around `get_contract_child_storage_key`.
The neighbouring `_read_contract_packed_storage` already calls `get_contract_child_storage_key` directly (without going through this wrapper), so the wrapper isn't a load-bearing abstraction. Inlining matches the pattern from #748 / #641 ("inline single-use helper into its only caller").
The inline version preserves the same behaviour:
Net: -27 / +8 lines, one fewer private helper in `helpers.py`.
Related Issues
N/A — same family of cleanups as #641 / #748.
Type of Change
Testing
Checklist