Skip to content

fix(cli): report vote list validator read failures as read_failed#1472

Merged
anderdc merged 2 commits into
entrius:testfrom
carlos4s:fix-vote-list-read-failure
Jun 17, 2026
Merged

fix(cli): report vote list validator read failures as read_failed#1472
anderdc merged 2 commits into
entrius:testfrom
carlos4s:fix-vote-list-read-failure

Conversation

@carlos4s

@carlos4s carlos4s commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1471

Fix gitt vote list --json so validator whitelist read failures no longer look like a successful empty whitelist.

Changes:

  • Add ContractReadError for trustworthy contract-read failure reporting.
  • Make IssueCompetitionContractClient.get_validators() raise on failed raw reads, read exceptions, and malformed validator Vec payloads.
  • Preserve successful empty whitelist behavior for a valid encoded empty Vec.
  • Map validator whitelist read failures in vote list to error.type == "read_failed".
  • Add CLI regression tests for raw read None, read exception, malformed payload, and real empty whitelist.

Verification (live finney — real data, no mocks)

Run against the live finney network using the exact contract addresses from #1471:

Contract Meaning
5DU266Ac3kVL6b3gGKNVqQ467WAq4JpucRAwxU1z9B98Bkav deployed non-issues contract — the get_validators read fails
5FWNdk8YNtNcHKrAx2krqenFrFAZG7vmsd2XN2isJSew3MrD real issues contract — returns the live validator whitelist

Before / After — failed read

Same failed-read contract, same command. Before this PR a failed read was reported as a successful empty whitelist (success: true, exit 0); after it is correctly surfaced as read_failed (exit 1).

gitt vote list --json --network finney \
  --contract 5DU266Ac3kVL6b3gGKNVqQ467WAq4JpucRAwxU1z9B98Bkav

before/after — failed read now returns read_failed

Regression check — real whitelist still reads correctly

A genuine read against the real issues contract is unchanged: it still succeeds and returns the live validator (success: true, exit 0).

gitt vote list --json --network finney \
  --contract 5FWNdk8YNtNcHKrAx2krqenFrFAZG7vmsd2XN2isJSew3MrD

real whitelist still succeeds

Testing

  • uv run --extra dev pytest
  • uv run --extra dev ruff check .
  • uv run --extra dev ruff format --check .
  • uv run --extra dev pyright

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 12, 2026
@anderdc

anderdc commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

please provide screenshots of the cli command working

@carlos4s

Copy link
Copy Markdown
Contributor Author

@anderdc I've attached cli command working screenshots in PR description. Please review again.

@anderdc anderdc merged commit 38e3f15 into entrius:test Jun 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] gitt vote list --json reports an empty validator whitelist when the contract read fails

2 participants