Skip to content

refactor: inline single-use _get_child_storage_key method - #849

Closed
ebios-star wants to merge 1 commit into
entrius:testfrom
ebios-star:refactor/inline-get-child-storage-key-method
Closed

refactor: inline single-use _get_child_storage_key method#849
ebios-star wants to merge 1 commit into
entrius:testfrom
ebios-star:refactor/inline-get-child-storage-key-method

Conversation

@ebios-star

Copy link
Copy Markdown
Contributor

Summary

`_get_child_storage_key` on `IssueCompetitionContractClient` (gittensor/validator/issue_competitions/contract_client.py:127-133) was a 7-line private method called from exactly one place: `read_issue_from_child_storage`. Same single-use-helper pattern as the merged #748, #801, and #802.

The inlined try/except is preserved verbatim and kept distinct from the existing decode-side try/except in the caller, so the per-stage debug log messages ("Error getting child storage key" vs "Error reading issue {id}") stay attributable to the right phase.

`grep -rn _get_child_storage_key` confirms no other call sites in `gittensor/`, `neurons/`, or `tests/`.

Net: -9 / +5 lines, one fewer private method on the contract client. No behavior change.

Related Issues

N/A — same family of cleanups as #641 / #748 / #801 / #802.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • `grep -rn _get_child_storage_key` confirms a single call site.
  • `uv run --extra dev pytest tests/` — all 652 tests pass.
  • `tests/utils/test_issue_competitions_storage_utils.py` covers the underlying `get_contract_child_storage_key` and still passes.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

_get_child_storage_key on IssueCompetitionContractClient was a 7-line
private method called from exactly one place: read_issue_from_child_storage.
Same single-use-helper pattern as the merged entrius#748, entrius#801, and entrius#802 work.

The inlined try/except is preserved verbatim and kept distinct from the
existing decode-side try/except in the caller, so the per-stage debug
log messages ("Error getting child storage key" vs "Error reading issue
{id}") stay attributable.

`grep -rn _get_child_storage_key` confirms no other call sites in
gittensor/, neurons/, or tests/. -9/+5 lines, full test suite passes.
@ebios-star

Copy link
Copy Markdown
Contributor Author

@anderdc @LandynDev — friendly ping for review when you have a moment.

Same family as #748 / #801 / #802 (all merged) — single-use private method inlined into its only caller. _get_child_storage_key on IssueCompetitionContractClient was a 7-line method called from exactly one place (read_issue_from_child_storage). The inlined try/except is preserved verbatim and kept distinct from the existing decode-side try/except so the per-stage debug logs stay attributable. grep confirms a single call site, no test references. -9/+5 lines, full test suite (652) passes.

Happy to rebase if needed.

@anderdc anderdc closed this Apr 28, 2026
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