refactor: extract duplicate validator axon collection to shared helper#426
Conversation
|
Hi, @anderdc |
anderdc
left a comment
There was a problem hiding this comment.
move it to the cli helpers file
Thanks for your review. 👍 |
|
Okay, I'm fixing now. |
906a9cc to
6bf9b5a
Compare
|
Just done! |
anderdc
left a comment
There was a problem hiding this comment.
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? |
The same 5-line loop — iterating over
metagraph.nto collect axons and UIDs for validators withvtrust > 0.1— was copy-pasted across bothpost.pyandcheck.py. Extracting it as_get_validator_axons(metagraph)inpost.pymeanscheck.py(which already imports helpers frompost.py) can simply call the shared function.