You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Context
vote_admin_proposalenforces four conditions: the proposal exists, its status isActive,now <= end_time, and the voter has not already voted. None are tested.Proposed change
Add negative tests for each guard.
Acceptance criteria
ProposalNotFound.ProposalAlreadyVoted.end_timefails withProposalVotingPeriodEnded.ProposalNotActive.get_admin_proposal_votereturns the recorded choice for a voter andNoneotherwise.