Skip to content

feat: add V-PROGRAM to address stats sort keys and counts - #292

Merged
odesenfans merged 1 commit into
mainfrom
feat/sort-by-v-program
Aug 25, 2026
Merged

feat: add V-PROGRAM to address stats sort keys and counts#292
odesenfans merged 1 commit into
mainfrom
feat/sort-by-v-program

Conversation

@odesenfans

Copy link
Copy Markdown
Contributor

Summary

  • SortByMessageType.V_PROGRAM = "v_program" for AddressesFilter(sort_by=...).
  • AddressStats.v_program: int = 0. The model is extra="forbid", so without this the SDK would fail to parse /api/v1/addresses/stats.json the day pyaleph starts returning a v_program column; the default keeps it working with nodes that do not.

Note: pyaleph's get_message_stats_by_address does not expose a v_program column yet, so sortBy=v_program is not accepted server-side today. This PR only makes the client ready; the server change is a separate pyaleph PR.

Test plan

  • pytest tests/unit (240 passed)

🤖 Generated with Claude Code

https://claude.ai/code/session_018hGRkZE1a3i19yrf2uBasD

SortByMessageType gains V_PROGRAM and AddressStats a v_program counter
(defaulting to 0 so responses from nodes that do not report it still
parse, given extra="forbid").

@foxpatch-aleph foxpatch-aleph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A small, focused PR that adds V-PROGRAM support to the address stats query and response models. The new enum value, model field with default=0 (for backward compatibility with servers that don't yet return v_program), and docstring update are all correct. The two new unit tests properly verify the filter serialization and model default behavior. No bugs, security issues, or logic errors found.

tests/unit/test_asynchronous_get.py (line 399): Minor: the two new tests are placed after the if __name__ == "__main__" block (line 395). This works fine with pytest but is slightly unusual. Consider moving them above that block for consistency.

@github-actions

Copy link
Copy Markdown

Failed to retrieve llama text: POST 502: Bad Gateway

@odesenfans
odesenfans merged commit cde35be into main Aug 25, 2026
6 checks passed
@odesenfans
odesenfans deleted the feat/sort-by-v-program branch August 25, 2026 13:37
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