Feat/vote attribution and coverage - #1224
Merged
Merged
Conversation
Add an importable fastify app seam (export server, guard start() behind NODE_ENV=test) so the vote service can be driven via injection against a seeded throwaway Postgres with no live network. Includes an embedded-postgres harness, seed helpers, and a passing baseline test proving a direct vote's weight is attributed to the casting wallet in GET /v1/proposals/:proposal/votes. Wire tests into the package test script and turbo test task.
…cedure
Stop silently dropping ineligible positions when building vote transactions.
The vote response gains a skipped:[{positionMint,reason}] array (reasons
maxChoicesReached and alreadyVotedThisChoice), and the all-positions-skipped
case throws a new ALL_POSITIONS_SKIPPED error carrying the same skip report.
Additive contract change; @helium/blockchain-api gets a minor changeset.
Per ADR 0003, GET /v1/proposals/:proposal/votes resolves each marker's mint to its index-0 proxy assignment (deduped per asset across proxy configs) so weight lands on the position owner, with the casting proxy exposed in an additive castingProxies field. Falls back to the casting voter when the index-0 row is gone; ownership resolution deliberately ignores expiration.
- Skip the casting-proxy join probe for direct votes (join condition mirrors the aggregate FILTER) - Drop the enum-value prose duplicated in SkipReasonSchema's describe - Set NODE_ENV=test once (the db helper, which runs before the service import) instead of also in the test script
…nts index - Order the index-0 LATERAL lookup by expiration_time DESC, address so attribution stays deterministic if duplicate index-0 rows disagree - Provision proxy_assignments (asset, index) index in the vote service sink config to back the per-marker owner probe - Hoist duplicated seedProposal into suite-level beforeEach
madninja
approved these changes
Jul 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.