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