Skip to content

[Test] Cover governance voting guards — double vote, voting after the deadline, unknown proposal #685

Description

@Calebux

Context

vote_admin_proposal enforces four conditions: the proposal exists, its status is Active, now <= end_time, and the voter has not already voted. None are tested.

Proposed change

Add negative tests for each guard.

Acceptance criteria

  • Voting on a non-existent id fails with ProposalNotFound.
  • Voting twice from the same address fails with ProposalAlreadyVoted.
  • Voting after end_time fails with ProposalVotingPeriodEnded.
  • Voting on a cancelled proposal fails with ProposalNotActive.
  • Voting without the voter's authorization fails.
  • get_admin_proposal_vote returns the recorded choice for a voter and None otherwise.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions