Tests - operation in Hive - update proposal votes operation
Operation: update_proposal_votes_operation, // 45
Configuration:
HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD, default mainnet value: 365 days
Test case:
-
1. User votes for the proposal X and proposal Y.
Preconditions:
- The proposals X and Y exist.
- User hasn't voted for the proposal X.
- User hasn't voted for the proposal Y.
Steps:
Step 1: User votes for the proposal X.
Expected results:
- After operation: The proposal X receives the vote.
- After operation: RC is reduced.
Step 2: User votes for the proposal Y.
Expected results:
- After operation: The proposal Y receives the vote.
- After operation: RC is reduced.
- After operation: The proposal X still has the vote.
Test case:
-
2. User removes the vote.
Preconditions:
- The proposals X and Y exist.
- User hasn't voted for the proposal X.
- User hasn't voted for the proposal Y.
Steps:
Step 1: User votes for the proposal X.
Expected results:
- After operation: The proposal X receives the vote.
- After operation: RC is reduced.
Step 2: User votes for the proposal Y.
Expected results:
- After operation: The proposal Y receives the vote.
- After operation: RC is reduced.
- After operation: The proposal X still has the vote.
Step 3: User removes the vote for the proposal X.
Expected results:
- After operation: The proposal X doesn't have the vote.
- After operation: RC is reduced.
- After operation: The proposal X still has the vote.
Test case:
-
3. User hasn't vote for a HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD.
Preconditions:
- The proposals X and Y exist.
- User hasn't voted for the proposal X.
- User hasn't voted for the proposal Y.
- HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD, default mainnet value: 365 days
Steps:
Step 1: User votes for the proposal X.
Expected results:
- After operation: The proposal X receives the vote.
- After operation: RC is reduced.
Step 2: User votes for the proposal Y.
Expected results:
- After operation: The proposal Y receives the vote.
- After operation: RC is reduced.
- After operation: The proposal X still has the vote.
Step 3: One year (HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD) passes...
- After HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD: The proposal X doesn't have the vote.
- After HIVE_GOVERNANCE_VOTE_EXPIRATION_PERIOD: The proposal Y doesn't have the vote.
Edited by Michał Kudela