Skip to content

refactor: extract duplicate validator axon collection to shared helper#426

Merged
anderdc merged 1 commit intoentrius:testfrom
dataCenter430:refactor/extract-get-validator-axons
Apr 15, 2026
Merged

refactor: extract duplicate validator axon collection to shared helper#426
anderdc merged 1 commit intoentrius:testfrom
dataCenter430:refactor/extract-get-validator-axons

Conversation

@dataCenter430
Copy link
Copy Markdown
Contributor

The same 5-line loop — iterating over metagraph.n to collect axons and UIDs for validators with vtrust > 0.1 — was copy-pasted across both post.py and check.py. Extracting it as _get_validator_axons(metagraph) in post.py means check.py (which already imports helpers from post.py) can simply call the shared function.

  • Pyright clean
  • Ruff lint and format clean

@dataCenter430
Copy link
Copy Markdown
Contributor Author

Hi, @anderdc
I'd be happy to review this PR when you have a chance.

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

move it to the cli helpers file

@dataCenter430
Copy link
Copy Markdown
Contributor Author

move it to the cli helpers file

Thanks for your review. 👍
Okay, I will got it.

anderdc
anderdc previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

unintended approval

@dataCenter430
Copy link
Copy Markdown
Contributor Author

Okay, I'm fixing now.

@dataCenter430
Copy link
Copy Markdown
Contributor Author

Just done!
Ready to review.

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

Looks good — clean dedup, follows the existing issue_commands/helpers.py pattern.

Minor note: check.py still imports _error, _load_config_value, _resolve_endpoint, and NETUID_DEFAULT from post.py as shared helpers. If more helpers get extracted in the future, consider moving those into helpers.py too so shared utilities live in one place.

@dataCenter430
Copy link
Copy Markdown
Contributor Author

Looks good — clean dedup, follows the existing issue_commands/helpers.py pattern.

Minor note: check.py still imports _error, _load_config_value, _resolve_endpoint, and NETUID_DEFAULT from post.py as shared helpers. If more helpers get extracted in the future, consider moving those into helpers.py too so shared utilities live in one place.

May I open a follow-up PR for it or implement it on this PR?

@anderdc anderdc merged commit e893d56 into entrius:test Apr 15, 2026
4 checks passed
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