Tests - operation in Hive - decline voting rights operation
Operation: decline_voting_rights_operation, // 36
Configuration:
based on: https://gitlab.syncad.com/hive/hive/-/blob/develop/libraries/protocol/include/hive/protocol/config.hpp
HIVE_OWNER_AUTH_RECOVERY_PERIOD - default mainnet value: 30 days
Test suite - General
Test cases:
-
1. User executes an operation decline_voting_rights_operation.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_decline_voting_rights.py#L13
test: decline_voting_rights
Steps:
Step 1:
User A declines voting rights using the operation decline_voting_rights_operation.
After operation:
Expected results:
- RC is reduced.
- There is a request for decline_voting_rights_operation.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
Test cases:
-
2. User cancels the decline_voting_rights_operation.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_decline_voting_rights.py#L58
test: test_remove_decline_voting_rights_request
Steps:
Step 1:
User A declines voting rights using the operation decline_voting_rights_operation.
After operation:
Expected results:
- RC is reduced.
- There is a request for decline_voting_rights_operation.
Steps:
Step 2:
User A cancels the decline_voting_rights_operation (decline_voting_rights_operation = false) before HIVE_OWNER_AUTH_RECOVERY_PERIOD.
After operation:
Expected results:
- RC is reduced.
- There is no request for decline_voting_rights_operation.
- User A has a voting rights (flag can_vote == true).
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A has a voting rights (flag can_vote == true).
- The virtual operation declined_voting_rights_operation is not generated
Test cases:
-
3. User tries to cancel the decline_voting_rights_operation, but the operation doesn't exist.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_decline_voting_rights.py#L47
test: test_remove_non_existent_decline_voting_rights_request
Steps:
Step 1:
User tries to tries to execute decline_voting_rights_operation with decline = false.
Expected results:
- The error occurs.
Test suite - User tries to execute an operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends.
Preconditions (tests 4- 9):
- User A created decline_voting_rights_operation and the HIVE_OWNER_AUTH_RECOVERY_PERIOD already passed.
Test cases:
-
4. User tries to execute decline_voting_rights_operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_decline_voting_rights.py#L22
test: test_decline_voting_rights_more_than_once
Steps:
Step 1:
User tries to tries to execute decline_voting_rights_operation.
Expected results:
- The error occurs.
Test cases:
-
5. User tries to execute vote_operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_voting_for_comment_behavior_after_declining_voting_rights.py#L10
test: test_vote_for_comment_from_account_that_has_declined_its_voting_rights
Preconditions:
- There is a comment (added after HIVE_OWNER_AUTH_RECOVERY_PERIOD, so user could add an effective vote if its rights have not been declined).
Steps:
Step 1:
User tries to vote for comment.
Expected results:
- The error occurs.
Test cases:
-
6. User tries to execute account_witness_vote_operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_witness_voting_behavior_after_declining_voting_rights.py#L22
Test: test_vote_with_declined_voting_rights
Preconditions:
- There is a witness.
Steps:
Step 1:
User tries to vote for the witness.
Expected results:
- The error occurs.
Test cases:
-
7. User tries to execute account_witness_proxy_operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_proxy_behavior_after_declining_voting_rights.py#L25 Test: test_set_proxy_after_waiving_voting_rights
Preconditions:
- There is an account that may be set as a proxy.
Steps:
Step 1:
User tries to set a proxy.
Expected results:
- The error occurs.
Test cases:
-
8. User tries to execute update_proposal_votes_operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_remove_proposal_votes_by_declining_voting_rights.py#L24
Test: test_vote_for_proposal_from_account_that_has_declined_its_voting_rights
Preconditions:
- There is a proposal to be voted.
Steps:
Step 1:
User tries to vote for a proposal.
Expected results:
- The error occurs.
Test cases:
-
9. User tries to execute delegate_vesting_shares_operation after the HIVE_OWNER_AUTH_RECOVERY_PERIOD ends. Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_vote_for_comment_using_delegate_vesting_shares.py#L8
Test: test_delegate_vesting_shares_without_voting_rights
Preconditions:
- There is an another account - user B.
Steps:
Step 1:
User A tries to delegate the vesting shares to user B.
Expected results:
- The error occurs (#463 (closed)).
Test suite - User executes an operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD.
Preconditions:
- User A created decline_voting_rights_operation and the HIVE_OWNER_AUTH_RECOVERY_PERIOD is in progress, but it is less than
HIVE_CASHOUT_WINDOW_SECONDS
before the end of HIVE_OWNER_AUTH_RECOVERY_PERIOD (so the comment reward will be calculated when the voting rights have been already declined).
Test cases:
-
10. User tries to execute the second decline_voting_rights_operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_decline_voting_rights.py#L34
test: test_create_two_decline_voting_rights_requests
Steps:
Step 1:
User tries to tries to execute decline_voting_rights_operation.
After operation:
Expected results:
- The error occurs.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
Test cases:
-
11. User executes an operation vote_operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_voting_for_comment_behavior_after_declining_voting_rights.py#L43
test: test_vote_for_comment_when_decline_voting_rights_is_being_executed
Preconditions:
- There is a comment to be voted.
Steps:
Step 1:
User votes for comment.
After operation
Expected results:
- The vote is added.
- RC is reduced.
- The voting power is reduced.
- The virtual operation: effective_comment_vote_operation is generated.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is still active.
After HIVE_CASHOUT_WINDOW_SECONDS:
Expected results:
- The comment reward is calculated for the voting user.
Test cases:
-
12. User executes an operation account_witness_vote_operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_witness_voting_behavior_after_declining_voting_rights.py#L37
Test: test_vote_for_witness_when_decline_voting_rights_is_in_progress
Preconditions:
- There is a witness to be voted.
Steps:
Step 1:
User votes for the witness.
After operation
Expected results:
- The vote is added.
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is removed.
Test cases:
-
13. User executes an operation account_witness_proxy_operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_proxy_behavior_after_declining_voting_rights.py#L39
Test: test_set_proxy_when_decline_voting_rights_is_in_progress
Preconditions:
- There is an account that may be set as a proxy.
Steps:
Step 1:
User sets a proxy.
After operation:
Expected results:
- The proxy is set.
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The proxy is removed.
- The virtual operation proxy_cleared_operation is generated.
-
proxied_vsf_votes
are correct (the check is already in the test).
Test cases:
-
14. User executes an operation update_proposal_votes_operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_remove_proposal_votes_by_declining_voting_rights.py#L37
Test: test_vote_for_proposal_when_decline_voting_rights_request_is_being_executed
Preconditions:
- There is a proposal to to be voted.
Steps:
Step 1:
User votes for a proposal.
After operation:
Expected results:
- The vote is added.
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is removed.
Test cases:
-
15. User executes an operation delegate_vesting_shares_operation in the HIVE_OWNER_AUTH_RECOVERY_PERIOD. Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_vote_for_comment_using_delegate_vesting_shares.py#L52
Test: test_vote_for_comment_with_vests_from_delegation_when_decline_voting_rights_is_being_executed
Preconditions:
- There is an comment, there is a user B.
Steps:
Step 1:
User A delegates vesting shares to user B and user B votes for the comment.
After operation:
Expected results:
- The vote is added.
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is still active.
After HIVE_CASHOUT_WINDOW_SECONDS:
Expected results:
- The comment reward is calculated (should be checked for user B, not for comment creator).
Test suite - User executes an operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts.
[ ] 16. User executes an operation vote_operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_voting_for_comment_behavior_after_declining_voting_rights.py#L27
test: test_if_vote_for_comment_made_before_declining_voting_rights_has_remained_active
Preconditions:
- There is a comment to be voted.
Steps:
Step 1:
User votes for a comment.
After operation
Expected results:
- The vote is added.
- RC is reduced.
- The voting power is reduced.
- The virtual operation: effective_comment_vote_operation is generated.
Steps:
Step 2:
User delines the voting rights.
After operation:
Expected results:
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is still active.
- The curator reward is calculated.
[ ] 17. User executes an operation vote_operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_witness_voting_behavior_after_declining_voting_rights.py#L10
test: test_decline_voting_rights_after_voting_for_witness
Preconditions:
- There is a witness.
Steps:
Step 1:
User votes for a witness.
After operation
Expected results:
- The vote is added.
- RC is reduced.
Steps:
Step 2:
User declines the voting rights.
After operation:
Expected results:
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is removed.
[ ] 18. User executes an operation account_witness_proxy_operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts.
https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_proxy_behavior_after_declining_voting_rights.py#L53
test: test_proxied_vsf_votes_when_principal_account_declined_its_voting_rights (see also test_proxy_before_waiving_voting_rights)
Preconditions:
- There is an account that may be set as a proxy.
Steps:
Step 1:
User sets a proxy.
After operation
Expected results:
- The proxy is set.
- RC is reduced
Steps:
Step 2:
User declines the voting rights.
After operation:
Expected results:
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The proxy is removed.
- The virtual operation proxy_cleared_operation is generated.
-
proxied_vsf_votes
are correct (the check is already in the test).
Test cases:
-
19. User executes an operation update_proposal_votes_operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts.
Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_remove_proposal_votes_by_declining_voting_rights.py#L11
Test: test_if_proposal_votes_were_removed_after_declining_voting_rights
Preconditions:
- There is an proposal.
Steps:
Step 1:
User votes for a proposal.
After operation:
Expected results:
- The vote is added.
- RC is reduced.
Steps:
Step 2:
User declines the voting rights.
After operation:
Expected results:
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is removed.
Test cases:
-
20. User executes an operation delegate_vesting_shares_operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts. Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_vote_for_comment_using_delegate_vesting_shares.py#L30
Test: test_vote_for_comment_with_vests_from_delegation_before_decline_voting_rights
Preconditions:
- There are users A and B.
- There is a comment.
Steps:
Step 1:
User A delegates vesting shares to user B and user B votes for the comment.
After operation:
Expected results:
- The vote is added.
- RC is reduced.
Steps:
Step 2:
User declines the voting rights.
After operation:
Expected results:
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is still active.
- The comment reward is calculated (should be checked for user B, not for comment creator).
Test suite - Others.
[ ] 21. User executes an operation account_witness_proxy_operation just before before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts.
https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_proxy_behavior_after_declining_voting_rights.py#L10
test: test_proxy_before_waiving_voting_rights (see also test_proxied_vsf_votes_when_principal_account_declined_its_voting_rights)
Preconditions:
- There is an account that may be set as a proxy.
Steps:
Step 1:
User sets a proxy.
After operation
Expected results:
- The proxy is set.
- RC is reduced
Steps:
Step 2:
User declines the voting rights.
After operation:
Expected results:
- RC is reduced.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The proxy is removed.
- The virtual operation proxy_cleared_operation is generated.
-
proxied_vsf_votes
are correct (the check is already in the test).
-
22. User executes an operation delegate_vesting_shares_operation before the HIVE_OWNER_AUTH_RECOVERY_PERIOD starts, but voter votes in the HIVE_OWNER_AUTH_RECOVERY_PERIOD. Implemented: https://gitlab.syncad.com/hive/hive/-/blob/develop/tests/functional/python_tests/hf28_tests/test_vote_for_comment_using_delegate_vesting_shares.py#L73
Test: test_vote_for_comment_with_vests_from_delegation_after_creating_a_decline_voting_rights_request
Preconditions:
- Thera are users A and B.
- There is a comment.
Steps:
Step 1:
User A delegates vesting shares to user B.
After operation:
Expected results:
- RC is reduced.
- Vesting shares are delegated.
Steps:
Step 2:
User declines the voting rights.
After operation:
Expected results:
- RC is reduced.
Steps:
Step 3:
User B votes for a comment.
After HIVE_OWNER_AUTH_RECOVERY_PERIOD:
Expected results:
- There is no request for decline_voting_rights_operation.
- User A doesn't have a voting rights (flag can_vote == False).
- The virtual operation declined_voting_rights_operation is generated.
- The vote is still active.
- The comment reward is calculated (should be checked for user B, not for comment creator).