feat(governance): configurable vote duration and per-claim deadlines - #244
Merged
jhayniffy merged 2 commits intoMar 28, 2026
Merged
Conversation
- Store vote duration in instance storage; admin_set_vote_duration_ledgers (32-char limit) - Snapshot voting_deadline_ledger at filing; inclusive vote deadline; finalize after - MIN/MAX bounds + VotingDurationUpdated event; ClaimSummary includes deadline - Tests: voting_duration_config + ledger bounds; fix Claim.asset in test fixtures - Frontend: Horizon latest ledger + DeadlineDisplay from voting_deadline_ledger - Backend DTO/OpenAPI: voting_deadline_ledger; voting.mdx docs - Fix duplicate contractimpl methods and admin events import in lib/admin Made-with: Cursor
|
@aji70 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Makes claim voting windows tunable via instance storage while keeping each claim’s voting deadline fixed at filing time. Finalization and late-vote checks use the stored
voting_deadline_ledger, not the current admin config. Frontend countdowns prefer that field plus Horizon’s latest ledger; backend/OpenAPI expose it on claim summaries.closes #191
Contract
VoteDurLedgerswith getters; defaultVOTE_WINDOW_LEDGERSif unset (upgrades).admin_set_vote_duration_ledgers/get_vote_duration_ledgers(Soroban 32-char export limit).MIN_VOTING_DURATION_LEDGERS/MAX_VOTING_DURATION_LEDGERSwith rationale inledger.rs.file_claim:voting_deadline_ledger = filed_at + duration(checked_add→Overflow).is_claim_voting_open); finalize whennow > voting_deadline_ledger.VotingDurationUpdated { old_ledgers, new_ledgers }when admin changes duration.ClaimSummary+list_claimsincludevoting_deadline_ledger.tests/voting_duration_config.rs, ledger unit tests;Claimtest fixtures updated withasset.contractimplmethods inlib.rs; fixadminimport.Frontend
vote.ts:isVoteOpen/deadlineMsusevoting_deadline_ledger(inclusive semantics).use-latest-ledger+ClaimsBoard→ClaimList→ClaimRow→DeadlineDisplay(ledger + optional legacy ISO).Backend / docs
ClaimSummaryDto+ OpenAPI: optionalvoting_deadline_ledger.voting.mdx: configurable duration and immutable per-claim deadlines.How to verify