Tests - operation in Hive - votes and rewards
Operations:
vote_operation, // 0, comment_operation, // 1 and comment_options_operation, // 19
Configuration:
based on: https://gitlab.syncad.com/hive/hive/-/blob/develop/libraries/protocol/include/hive/protocol/config.hpp
HIVE_CASHOUT_WINDOW_SECONDS, default mainnet value: 7 days
1. Test cases: A comment/post receives rewards after 7 days
General preconditions:
Preconditions:
- There are users A, B and C, they have the same amount of HP.
- User A creates post post1.
- User B creates post post2.
- User C creates post post3.
- User B comments on the user A's post - creates comment1.
- User A comments on the user B's comment - creates comment2.
- User C comments on the user B's comment - creates comment3.
General step:
Steps:
- User A votes for own post with weight 100% (post1).
- User A votes for the user B's post with weight 100% (post2).
- User A votes for the user B's comment with wight 100% (comment1).
- User A votes for the own comment with weight 100% (comment2).
- User B votes for the user A's post with weight 50% (post1).
- User B votes for the user A's comment with weight 50% (comment2).
- User C votes for the user B's post with weight 100% (post2).
- The HIVE_CASHOUT_WINDOW_SECONDS days passes.
1.1 Test cases: User receives the author/curation rewards for post/comment with default comment_options_operation after 7 days.
Preconditions:
- The posts and comments have the default settings of
comment_options_operation
. - Based on default settings, the author's reward is paid: 50% HP and 50% HBD.
Test case
-
1. User receives the author’s reward for the post.
Expected results:
- (post1) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post2) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post1, post2) The author's reward of user B is higher than the author reward of the user A.
Test case
-
2. User receives the author’s reward for the comment.
Expected results:
- (comment1) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User B: The virtual operation: author_reward_operation is generated.
- (comment2) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) User A: The virtual operation: author_reward_operation is generated.
- (comment1, comment2) The author's reward of user A is higher than the author reward of the user B.
Test case
-
3. User doesn't receive the author’s reward for the post if the post has no votes.
- (post3) User C doesn't receive the author’s reward - it is not calculated and balance is not changed.
- (post3) User C: The virtual operation: author_reward_operation is not generated.
Test case
-
4. User doesn't receive the author’s reward for the comment if the post has no votes.
- (post3) User C doesn't receive the author’s reward - it is not calculated and balance is not changed.
- (post3) User C: The virtual operation: author_reward_operation is not generated.
Test case
-
5. User receives the curation reward for own post.
Expected results:
- (post1) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post1) User A: The virtual operation: curation_reward_operation is generated.
Test case
-
6. User receives the curation reward for someone else's post.
Expected results:
- (post1) User B receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post1) User B: The virtual operation: curation_reward_operation is generated.
- (post2) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post2) User A: The virtual operation: curation_reward_operation is generated.
- (post2) User C receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post2) User C: The virtual operation: curation_reward_operation is generated.
- (post2) The curation reward of user C is higher than the curation reward of the user A.
Test case
-
7. User receives the curation reward for own comment.
Expected results:
- (comment2) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User A: The virtual operation: curation_reward_operation is generated.
Test case
-
8. User receives the curation reward for someone else's comment.
Expected results:
- (comment1) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment1) User A: The virtual operation: curation_reward_operation is generated.
- (comment2) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User A: The virtual operation: curation_reward_operation is generated.
- (comment2) User B receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User B: The virtual operation: curation_reward_operation is generated.
- (comment2) The curation reward of user A is higher than the curation reward of the user B.
1.2 Test cases: User receives the author/curation rewards for post/comment with {percent_hbd} = 50% after 7 days.
Preconditions:
- The posts and comments have the settings {percent_hbd} = 50% .
- Based on default settings, the author's reward is paid: 50% (50% HBD) = 25% HBD and 50% +25% HP.
Test case
-
9. User receives the author’s reward for the post.
Expected results:
- (post1) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 75% HP and 25% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post2) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 75% HP and 25% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post1, post2) The author's reward of user B is higher than the author reward of the user A.
Test case
-
10. User receives the author’s reward for the comment.
Expected results:
- (comment1) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 75% HP and 25% HBD.
- (comment1) User B: The virtual operation: author_reward_operation is generated.
- (comment2) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 75% HP and 25% HBD.
- (comment2) User A: The virtual operation: author_reward_operation is generated.
- (comment1, comment2) The author's reward of user A is higher than the author reward of the user B.
Test case
-
11. User doesn't receive the author’s reward for the post if the post has no votes.
- (post3) User C doesn't receive the author’s reward - it is not calculated and balance is not changed.
- (post3) User C: The virtual operation: author_reward_operation is not generated.
Test case
-
12. User doesn't receive the author’s reward for the comment if the post has no votes.
- (post3) User C doesn't receive the author’s reward - it is not calculated and balance is not changed.
- (post3) User C: The virtual operation: author_reward_operation is not generated.
1.3 Test cases: User receives the author/curation rewards for post/comment with {percent_hbd} = 0% after 7 days.
Preconditions:
- The posts and comments have the settings {percent_hbd} = 0% .
- Based on default settings, the author's reward is paid: 0% (50% HBD) = 0% HBD and 100% HP.
Test case
-
13. User receives the author’s reward for the post.
Expected results:
- (post1) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 100% HP and 0% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post2) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 100% HP and 0% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post1, post2) The author's reward of user B is higher than the author reward of the user A.
Test case
-
14. User receives the author’s reward for the comment.
Expected results:
- (comment1) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 100% HP and 0% HBD.
- (comment1) User B: The virtual operation: author_reward_operation is generated.
- (comment2) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 100% HP and 0% HBD.
- (comment2) User A: The virtual operation: author_reward_operation is generated.
- (comment1, comment2) The author's reward of user A is higher than the author reward of the user B.
Test case
-
15. User doesn't receive the author’s reward for the post if the post has no votes.
- (post3) User C doesn't receive the author’s reward - it is not calculated and balance is not changed.
- (post3) User C: The virtual operation: author_reward_operation is not generated.
Test case
-
16. User doesn't receive the author’s reward for the comment if the post has no votes.
- (post3) User C doesn't receive the author’s reward - it is not calculated and balance is not changed.
- (post3) User C: The virtual operation: author_reward_operation is not generated.
1.4 Test cases: User receives the author/curation rewards for post/comment with {max_accepted_payout} = X after 7 days.
Preconditions:
- The posts and comments have the settings {max_accepted_payout} = X.
Based on the test cases 1- 8, the value of the X should be set as half of the payment. If there is any reason why it is impossible please let's discuss.
Test case
-
17. User receives the author’s reward for the post.
Expected results:
- (post1) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post2) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post1, post2) The author's reward of user B is higher than the author reward of the user A.
- User A receives less than in the test 1.
- User B receives less than in the test 1.
Test case
-
18. User receives the author’s reward for the comment.
Expected results:
- (comment1) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User B: The virtual operation: author_reward_operation is generated.
- (comment2) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) User A: The virtual operation: author_reward_operation is generated.
- (comment1, comment2) The author's reward of user A is higher than the author reward of the user B.
- User A receives less than in the test 2.
- User B receives less than in the test 2.
Test case
-
19. User receives the curation reward for own post.
Expected results:
- (post1) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post1) User A: The virtual operation: curation_reward_operation is generated.
- User A receives less than in the test 5.
Test case
-
20. User receives the curation reward for someone else's post.
Expected results:
- (post1) User B receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post1) User B: The virtual operation: curation_reward_operation is generated.
- (post2) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post2) User A: The virtual operation: curation_reward_operation is generated.
- (post2) User C receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post2) User C: The virtual operation: curation_reward_operation is generated.
- (post2) The curation reward of user C is higher than the curation reward of the user A.
- User A receives less than in the test 6.
- User B receives less than in the test 6.
- User C receives less than in the test 6.
Test case
-
21. User receives the curation reward for own comment.
Expected results:
- (comment2) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User A: The virtual operation: curation_reward_operation is generated.
- User A receives less than in the test 7.
Test case
-
22. User receives the curation reward for someone else's comment.
Expected results:
- (comment1) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment1) User A: The virtual operation: curation_reward_operation is generated.
- (comment2) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User A: The virtual operation: curation_reward_operation is generated.
- (comment2) User B receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User B: The virtual operation: curation_reward_operation is generated.
- (comment2) The curation reward of user A is higher than the curation reward of the user B.
- User A receives less than in the test 8.
- User B receives less than in the test 8.
1.5 Test cases: User receives the author/curation rewards for post/comment with {max_accepted_payout} = 0 after 7 days.
Preconditions:
- The posts and comments have the settings {max_accepted_payout} = 0.
Test case
-
23. User receives the author’s reward for the post.
Expected results:
- (post1) User A doesn't receive the author’s reward - user's sub balance for rewards in not changed.
- (post1) User A: The virtual operation: author_reward_operation is not generated.
- (post2) User B doesn't receive the author’s reward - user's sub balance for rewards in not changed..
- (post2) User B: The virtual operation: author_reward_operation is not generated.
Test case
-
24. User receives the author’s reward for the comment.
Expected results:
- (comment1) User B doesn't receive the author’s reward - user's sub balance for rewards in not changed.
- (comment1) User B: The virtual operation: author_reward_operation is not generated.
- (comment2) User A doesn't receive the author’s reward - user's sub balance for rewards in not changed.
- (comment2) User A: The virtual operation: author_reward_operation is not generated.
Test case
-
25. User receives the curation reward for own post.
Expected results:
- (post1) User A doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (post1) User A: The virtual operation: curation_reward_operation is not generated.
Test case
-
26. User receives the curation reward for someone else's post.
Expected results:
- (post1) User B doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (post1) User B: The virtual operation: curation_reward_operation is not generated.
- (post2) User A doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (post2) User A: The virtual operation: curation_reward_operation is not generated.
- (post2) User C doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (post2) User C: The virtual operation: curation_reward_operation is not generated.
Test case
-
27. User receives the curation reward for own comment.
Expected results:
- (comment2) User A doesn't receive the curation reward - user's sub balance for rewards in not changed..
- (comment2) User A: The virtual operation: curation_reward_operation is not generated.
Test case
-
28. User receives the curation reward for someone else's comment.
Expected results:
- (comment1) User A doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (comment1) User A: The virtual operation: curation_reward_operation is not generated.
- (comment2) User A doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (comment2) User A: The virtual operation: curation_reward_operation is not generated.
- (comment2) User B doesn't receive the curation reward - user's sub balance for rewards in not changed.
- (comment2) User B: The virtual operation: curation_reward_operation is not generated.
1.6 Test cases: User receives (or not) the author/curation rewards for post/comment with {allow_curation_rewards} = false after 7 days.
Preconditions:
- The posts and comments have the settings {allow_curation_rewards} = false.
Test case
-
29. User receives the author’s reward for the post.
Expected results:
- (post1) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post2) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post1, post2) The author's reward of user B is higher than the author reward of the user A.
Test case
-
30. User receives the author’s reward for the comment.
Expected results:
- (comment1) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User B: The virtual operation: author_reward_operation is generated.
- (comment2) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) User A: The virtual operation: author_reward_operation is generated.
- (comment1, comment2) The author's reward of user A is higher than the author reward of the user B.
Test case
-
31. User receives the curation reward for own post.
Expected results:
- (post1) User A doesn't receive the curation reward - user's sub balance is not changed.
- (post1) User A: The virtual operation: curation_reward_operation is not generated.
Test case
-
32. User receives the curation reward for someone else's post.
Expected results:
- (post1) User B doesn't receive the curation reward - user's sub balance is not changed.
- (post1) User B: The virtual operation: curation_reward_operation is not generated.
- (post2) User A doesn't receive the curation reward - user's sub balance is not changed.
- (post2) User A: The virtual operation: curation_reward_operation is not generated.
- (post2) User C doesn't receive the curation reward - user's sub balance is not changed.
- (post2) User C: The virtual operation: curation_reward_operation is not generated.
Test case
-
33. User receives the curation reward for own comment.
Expected results:
- (comment2) User A doesn't receive the curation reward - user's sub balance is not changed.
- (comment2) User A: The virtual operation: curation_reward_operation is not generated.
Test case
-
34. User receives the curation reward for someone else's comment.
Expected results:
- (comment1) User A doesn't receive the curation reward - user's sub balance is not changed.
- (comment1) User A: The virtual operation: curation_reward_operation is not generated.
- (comment2) User A doesn't receive the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User A: The virtual operation: curation_reward_operation is not generated.
- (comment2) User B doesn't receive the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment2) User B: The virtual operation: curation_reward_operation is not generated.
1.7 Test cases: The beneficiary receives the author's reward after 7 days.
Preconditions:
- The posts and comments have the defined beneficiary - weight =100%.
Test case
-
35. Beneficiary receives the author’s reward for the post.
Expected results:
- (post1) User A doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (post1) Beneficiary receives the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post1) Beneficiary The virtual operation:comment_benefactor_reward_operation is generated.
- (post2) User B doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (post2) Beneficiary receives the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post2) Beneficiary The virtual operation:comment_benefactor_reward_operation is generated.
Test case
-
36. Beneficiary receives the author’s reward for the comment.
Expected results:
- (comment1) User A doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (comment1) Beneficiary receives the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User A: The virtual operation: author_reward_operation is generated.
- (comment1) Beneficiary The virtual operation:comment_benefactor_reward_operation is generated.
- (comment2) User B doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (comment2) Beneficiary receives the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) User B: The virtual operation: author_reward_operation is generated.
- (comment2) Beneficiary The virtual operation:comment_benefactor_reward_operation is generated.
Test case
-
37. Beneficiaries don't receive the curation reward.
Expected results:
- The beneficiaries don't receive the curation reward.
1.8 Test cases: Two beneficiaries receive the author's reward after 7 days.
Preconditions:
- The posts and comments have the defined two beneficiaries: beneficiary1- weight =30% and beneficiary2- weight =70%
Test case
-
38. Two beneficiaries receives the author’s reward for the post.
Expected results:
- (post1) User A doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (post1) Beneficiaty1 receives the 30% of author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post1) Beneficiaty2 receives the 70% of author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post1) Beneficiaty1: The virtual operation:comment_benefactor_reward_operation is generated.
- (post1) Beneficiaty2: The virtual operation:comment_benefactor_reward_operation is generated.
- (post2) User B doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (post2) Beneficiaty1 receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post2) Beneficiaty2 receives the 70% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post2) Beneficiaty1: The virtual operation:comment_benefactor_reward_operation is generated.
- (post2) Beneficiaty2: The virtual operation:comment_benefactor_reward_operation is generated.
Test case
-
39. Two beneficiaries receives the author’s reward for the comment.
Expected results:
- (comment1) User A doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (comment1) Beneficiaty1 receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) Beneficiaty2 receives the 70% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User A: The virtual operation: author_reward_operation is generated.
- (comment1) Beneficiaty1: The virtual operation:comment_benefactor_reward_operation is generated.
- (comment1) Beneficiaty2: The virtual operation:comment_benefactor_reward_operation is generated.
- (comment2) User B doesn't receive the author’s reward - user's sub balance for rewards is not changed.
- (comment2) Beneficiary receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) Beneficiary receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) User B: The virtual operation: author_reward_operation is generated.
- (comment2) Beneficiaty1 The virtual operation:comment_benefactor_reward_operation is generated.
- (comment2) Beneficiaty2 The virtual operation:comment_benefactor_reward_operation is generated.
1.9 Test cases: User shares the author's reward with two beneficiaries after 7 days.
Preconditions:
- The posts and comments have the defined two beneficiaries: beneficiary1- weight =20% and beneficiary2- weight =30%, so the rest is for author.
Test case
-
40. User shares with two beneficiaries the author's reward for the post.
Expected results:
- (post1) User A receives the 50 % of author’s reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post1) Beneficiaty1 receives the 20% of author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post1) Beneficiaty2 receives the 30% of author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
- (post1) Beneficiaty1: The virtual operation:comment_benefactor_reward_operation is generated.
- (post1) Beneficiaty2: The virtual operation:comment_benefactor_reward_operation is generated.
- (post2) User B receives the 50% of the author’s reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post2) Beneficiaty1 receives the 20% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post2) Beneficiaty2 receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (post2) User B: The virtual operation: author_reward_operation is generated.
- (post2) Beneficiaty1: The virtual operation:comment_benefactor_reward_operation is generated.
- (post2) Beneficiaty2: The virtual operation:comment_benefactor_reward_operation is generated.
Test case
-
41. User shares with two beneficiaries the author's reward for the post.
Expected results:
- (comment1) User A receives the 50% of author’s reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) Beneficiaty1 receives the 20% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) Beneficiaty2 receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User A: The virtual operation: author_reward_operation is generated.
- (comment1) Beneficiaty1: The virtual operation:comment_benefactor_reward_operation is generated.
- (comment1) Beneficiaty2: The virtual operation:comment_benefactor_reward_operation is generated.
- (comment2) User B receives the 50% of the author’s reward - user's sub balance for rewards is not changed.
- (comment2) Beneficiary receives the 20% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) Beneficiary receives the 30% of the author's reward - it is calculated and transfer to beneficiary's sub balance for rewards - 50% HP and 50% HBD.
- (comment2) User B: The virtual operation: author_reward_operation is generated.
- (comment2) Beneficiaty1 The virtual operation:comment_benefactor_reward_operation is generated.
- (comment2) Beneficiaty2 The virtual operation:comment_benefactor_reward_operation is generated.
2. Test cases: A comment/post receives dwonvotes.
2.1 Test cases: A comment/post receives only dwonvotes
General preconditions:
Preconditions:
- There are users A, B and C, they have the same amount of HP.
- User A creates post post1.
- User B comments on the user A's post - creates comment1.
General step:
Steps:
- User B downvotes the user A's post with weight 50% (post1).
- User C downvotes the user A's post with weight 100% (post1).
- User A downvotes the user B's comment with wight 50% (comment1).
- User C downvotes the user B's comment with wight 100% (comment1).
- The HIVE_CASHOUT_WINDOW_SECONDS days passes.
Test case
-
42. User doesn't receive the author reward for the post.
Expected results:
- (post1) User A doesn't receive the author’s reward - it is not calculated and user balance is not changed.
- (post1) User A: The virtual operation: author_reward_operation is not generated.
Test case
-
43. User doesn't receive the curation reward for the post.
Expected results:
- (post1) User B doesn't receive the curation reward - it is not calculated and user balance is not changed.
- (post1) User B: The virtual operation: curation_reward_operation is not generated.
- (post1) User C doesn't receive the curation reward - it is not calculated and user balance is not changed.
- (post1) User C: The virtual operation: curation_reward_operation is not generated.
Test case
-
44. User doesn't receive the author reward for the comment.
Expected results:
- (comment1) User B doesn't receive the author’s reward - it is not calculated and user balance is not changed.
- (comment1) User B: The virtual operation: author_reward_operation is not generated.
Test case
-
45. User doesn't receive the curation reward for the comment.
Expected results:
- (comment1) User A doesn't receive the curation reward - it is not calculated and user balance is not changed.
- (comment1) User A: The virtual operation: curation_reward_operation is not generated.
- (comment1) User C doesn't receive the curation reward - it is not calculated and user balance is not changed.
- (comment1) User C: The virtual operation: curation_reward_operation is not generated.
2.2 Test cases: A comment/post receives dwonvotes and upvotes, but upvotes is more.
General preconditions:
Preconditions:
- There are users A, B, C, D and E - they have the same amount of HP.
- User A creates post post1.
- User B comments on the user A's post - creates comment1.
General step:
Steps:
- User B upvotes the user A's post with weight 100% (post1).
- User D upvotes the user A's post with weight 100% (post1).
- User C downvotes the user A's post with weight 100% (post1).
- User E downvotes the user A's post with weight 100% (post1).
- User A upvotes the user B's comment with wight 50% (comment1).
- User D upvotes the user B's comment with wight 50% (comment1).
- User C downvotes the user B's comment with wight 50% (comment1).
- User E downvotes the user B's comment with wight 50% (comment1).
- The HIVE_CASHOUT_WINDOW_SECONDS days passes.
Test case
-
46. User receives the author reward for the post.
Expected results:
- (post1) User A receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (post1) User A: The virtual operation: author_reward_operation is generated.
Test case
-
47. Users who upvote the post receive the curation reward.
Expected results:
- (post1) User B receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post1) User B: The virtual operation: curation_reward_operation is generated.
- (post1) User D receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (post1) User D: The virtual operation: curation_reward_operation is generated.
Test case
-
48. Users who downvote the post don't receive the curation reward.
Expected results:
- (post1) User C doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (post1) User C: The virtual operation: curation_reward_operation is not generated.
- (post1) User E doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (post1) User E: The virtual operation: curation_reward_operation is not generated.
Test case
-
49. User receives the author reward for the comment.
Expected results:
- (comment1) User B receives the author’s reward - it is calculated and transfer to user's sub balance for rewards - 50% HP and 50% HBD.
- (comment1) User B: The virtual operation: author_reward_operation is generated.
Test case
-
50. Users who upvote the comment receive the curation reward.
Expected results:
- (comment1) User A receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment1) User A: The virtual operation: curation_reward_operation is generated.
- (comment1) User D receives the curation reward - it is calculated and transfer to user's sub HP balance for rewards.
- (comment1) User D: The virtual operation: curation_reward_operation is generated.
Test case
-
51. Users who downvote the comment don't receive the curation reward.
Expected results:
- (comment1) User C doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (comment1) User C: The virtual operation: curation_reward_operation is not generated.
- (comment1) User E doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (comment1) User E: The virtual operation: curation_reward_operation is not generated.
2.3 Test cases: A comment/post receives dwonvotes and upvotes, but downvotes is more.
General preconditions:
Preconditions:
- There are users A, B, C, D and E - they have the same amount of HP.
- User A creates post post1.
- User B comments on the user A's post - creates comment1.
General step:
Steps:
- User B upvotes the user A's post with weight 10% (post1).
- User D upvotes the user A's post with weight 10% (post1).
- User C downvotes the user A's post with weight 100% (post1).
- User E downvotes the user A's post with weight 100% (post1).
- User A upvotes the user B's comment with wight 5% (comment1).
- User D upvotes the user B's comment with wight 5% (comment1).
- User C downvotes the user B's comment with wight 70% (comment1).
- User E downvotes the user B's comment with wight 70% (comment1).
- The HIVE_CASHOUT_WINDOW_SECONDS days passes.
Test case
-
52. User doen't receive the author reward for the post.
Expected results:
- (post1) User A doesn't receive the author’s reward - the user's sub balance for rewards is not updated.
- (post1) User A: The virtual operation: author_reward_operation is not generated.
Test case
-
53. Users who upvote the post doesn't receive the curation reward.
Expected results:
- (post1) User B doesn't receive the curation reward - the user's sub balance for rewards is not updated.
- (post1) User B: The virtual operation: curation_reward_operation is not generated.
- (post1) User D doesn't receive the curation reward - the user's sub balance for rewards is not updated.
- (post1) User D: The virtual operation: curation_reward_operation is not generated.
Test case
-
54. Users who downvote the post don't receive the curation reward.
Expected results:
- (post1) User C doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (post1) User C: The virtual operation: curation_reward_operation is not generated.
- (post1) User E doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (post1) User E: The virtual operation: curation_reward_operation is not generated.
Test case
-
55. User don't receive the author reward for the comment.
Expected results:
- (comment1) User B doesn't receive the author’s reward - the user's sub balance for rewards is not updated.
- (comment1) User B: The virtual operation: author_reward_operation is not generated.
Test case
-
56. Users who upvote the comment don't receive the curation reward.
Expected results:
- (comment1) User A doesn't receive the curation reward - the user's sub balance for rewards is not updated.
- (comment1) User A: The virtual operation: curation_reward_operation is not generated.
- (comment1) User D doesn't receive the curation reward - the user's sub balance for rewards is not updated.
- (comment1) User D: The virtual operation: curation_reward_operation is not generated.
Test case
-
57. Users who downvote the comment don't receive the curation reward.
Expected results:
- (comment1) User C doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (comment1) User C: The virtual operation: curation_reward_operation is not generated.
- (comment1) User E doesn't receive the curation reward - the user's sub balance for rewards is not changed.
- (comment1) User E: The virtual operation: curation_reward_operation is not generated.
Edited by Radosław Masłowski