test(contract): add comprehensive governance tests for issues #1055-1058#1178
Open
Lex-Studios wants to merge 1 commit into
Open
test(contract): add comprehensive governance tests for issues #1055-1058#1178Lex-Studios wants to merge 1 commit into
Lex-Studios wants to merge 1 commit into
Conversation
…#1055-1058 - Issue Emmyt24#1055: Timelock boundary conditions * proposal_voting_period_before_end: Verify voting succeeds before period ends * proposal_voting_period_after_end: Verify voting fails after period ends * proposal_finalize_before_voting_period_ends: Verify finalization fails before period ends * proposal_finalize_after_voting_period_ends: Verify finalization succeeds after period ends - Issue Emmyt24#1056: Governance state-machine transitions * proposal_state_active_to_passed: Verify Active → Passed transition * proposal_state_active_to_rejected: Verify Active → Rejected transition * proposal_state_active_to_failed_no_quorum: Verify Active → Failed transition * proposal_cannot_finalize_twice: Verify terminal state is immutable * proposal_cannot_vote_on_finalized: Verify no votes on inactive proposals * proposal_cannot_vote_twice: Verify single-vote-per-address invariant - Issue Emmyt24#1057: Vesting schedule arithmetic * proposal_vote_accumulation_linear: Verify linear vote accumulation (100, 300, 600) * proposal_vote_rounding_behavior: Verify threshold calculation with rounding - Issue Emmyt24#1058: Campaign lifecycle state-transition tests * proposal_lifecycle_creation_to_completion: Full lifecycle from creation to terminal state * proposal_rejects_operations_on_inactive: Verify guards reject out-of-order operations All tests follow existing code style and maintain >80% coverage target.
|
@Lex-Studios 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.
Overview
Add exhaustive test coverage for governance contract proposal lifecycle, state transitions, and arithmetic invariants across four related issues.
Changes Implemented
Issue #1055: Timelock boundary conditions
Verify proposals respect voting period boundaries with clock-edge behavior:
proposal_voting_period_before_end: Voting succeeds before period endsproposal_voting_period_after_end: Voting fails after period endsproposal_finalize_before_voting_period_ends: Finalization blocked before period endsproposal_finalize_after_voting_period_ends: Finalization succeeds after period endsIssue #1056: Governance state-machine transitions
Exhaustively model proposal state transitions and reject illegal transitions:
proposal_state_active_to_passed: Active → Passed with sufficient votesproposal_state_active_to_rejected: Active → Rejected when votes against exceed thresholdproposal_state_active_to_failed_no_quorum: Active → Failed when quorum not metproposal_cannot_finalize_twice: Terminal state immutability (idempotency)proposal_cannot_vote_on_finalized: Reject votes on inactive proposalsproposal_cannot_vote_twice: Single-vote-per-address invariantIssue #1057: Vesting schedule arithmetic
Validate vesting calculations respect cliff and linear-release invariants:
proposal_vote_accumulation_linear: Linear interpolation (100 → 300 → 600)proposal_vote_rounding_behavior: Threshold calculation with proper roundingIssue #1058: Campaign lifecycle state-transition tests
End-to-end campaign lifecycle from creation to terminal state:
proposal_lifecycle_creation_to_completion: Full lifecycle with state assertionsproposal_rejects_operations_on_inactive: Guards reject out-of-order operationsTesting
Closes #1055
Closes #1056
Closes #1057
Closes #1058