Tests - operation in Hive - set_withdraw_vesting_route_operation
Operation: set_withdraw_vesting_route_operation, // 20
Test suite - User sets the withdraw vesting route when the power down already exists.
Test cases:
-
1. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = false. -
2. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = true. -
3. User A sets the withdraw vesting routes to: - user B1 with percent 10% and auto_vest = false,
- user B2 with percent 20% and auto_vest = true,
- user B3 with percent 30% and auto_vest = false.
-
4. User A sets the withdraw vesting routes to users B1 - B10 with percent 10% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false. -
5. User A sets the withdraw vesting routes to users B1 - B10 with percent 5% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false.
Preconditions:
- There is the Power Down in progress created by user A. It is after the first withdrawal.
Steps
Step 1: User A creates operation set_withdraw_vesting_route_operation as defined in the test case.
After operation:
Expected results:
- RC is reduced.
After withdraw (2):
Expected results:
-
The HP balance is reduced by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 1 - 5. -
The {target} balance is increased:
Test 1:
User B's Hive balance is increased by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 2:
User B's HP balance is increased by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 3:
User B1's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B2's HP balance is increased by 20% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B3's Hive balance is increased by 30% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 40% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 4:
User B1's - B5's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B6's - B10's HP balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 5:
User B1's - B5's Hive balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B6's - B10's HP balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 50% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. -
The virtual operation: fill_vesting_withdraw are generated.
Test 1: For users A and B.
Test 2: For users A and B.
Test 3: For users A and B1 - B3.
Test 4: For users A and B1 - B10.
Test 5: For users A and B1 - B10.
After withdraw (3):
Expected results:
The same results as After withdraw (2)
.
Test suite - User sets the withdraw vesting route when the power down doesn't exist.
Test cases:
-
6. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = false. -
7. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = true. -
8. User A sets the withdraw vesting routes to: - user B1 with percent 10% and auto_vest = false,
- user B2 with percent 20% and auto_vest = true,
- user B3 with percent 30% and auto_vest = false.
-
9. User A sets the withdraw vesting routes to users B1 - B10 with percent 10% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false. -
10. User A sets the withdraw vesting routes to users B1 - B10 with percent 5% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false.
Preconditions:
- There is no Power Down in progress created by user A.
Steps:
Step 1: User A creates operation set_withdraw_vesting_route_operation as defined in the test case.
After operation:
Expected results:
- RC is reduced
Step 2: User A creates Power down.
Expected results:
The same results as for test 1 - 5.
-
The HP balance is reduced by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 6 - 10. -
The {target} balance is increased:
Test 6:
User B's Hive balance is increased by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 7:
User B's HP balance is increased by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 8:
User B1's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B2's HP balance is increased by 20% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B3's Hive balance is increased by 30% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 40% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 9:
User B1's - B5's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B6's - B10's HP balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 10:
User B1's - B5's Hive balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B6's - B10's HP balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 50% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. -
The virtual operation: fill_vesting_withdraw are generated.
Test 6: For users A and B.
Test 7: For users A and B.
Test 8: For users A and B1 - B3.
Test 9: For users A and B1 - B10.
Test 10: For users A and B1 - B10.
After withdraw (2):
Expected results:
The same results as After Step 2
.
Test suite - User updates settings of the withdraw vesting route after the second withdrawal.
Test cases:
-
11. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = false and after withdrawal removes it. -
12. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = true and after withdrawal modifies it - changes 100% to 50% and true to false. -
13. User A sets the withdraw vesting routes to: - user B1 with percent 10% and auto_vest = false,
- user B2 with percent 20% and auto_vest = true,
- user B3 with percent 30% and auto_vest = false and after withdrawal adds a new route: to User B4, 40% and auto_vest = true.
-
14. User A sets the withdraw vesting routes to users B1 - B10 with percent 10% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false after withdrawal modifies B1 from 10% to 5%. -
15. User A sets the withdraw vesting routes to users B1 - B10 with percent 5% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false and after withdrawal removes B1-B5.
Preconditions:
- There is the Power Down in progress created by user A. It is after the first withdrawal.
Steps:
Step 1: User A creates operation set_withdraw_vesting_route_operation as defined in the test case.
Results as for tests 1-5.
Step 2:
Test 11:
User A removes the vesting route to user B (sets 0%).
Test 12:
User A modifies the vesting route to user B, change to 50% and auto_vest = false.
Test 13:
User A adds a new vesting route to user B4, 40% and auto_vest = true.
Test 14:
User A modifies the vesting route to user B1, change to 5%.
Test 15:
User A removes the vesting routes to users B1-B5.
After operation:
Expected results:
- RC is reduced.
After withdraw (3):
Expected results:
-
The HP balance is reduced by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 11 - 15. -
The {target} balance is increased:
Test 11:
User A's Hive balance is increased by 100% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B's Hive balance is not increased.
Test 12:
User B's Hive balance is increased by 50% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. User A's Hive balance is increased by 50% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 13:
User B1's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B2's HP balance is increased by 20% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B3's Hive balance is increased by 30% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B4's HP balance is increased by 40% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 14:
User B1's Hive balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. User B2's - B5's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B6's - B10's HP balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. Test 15:
User B1's - B5's Hive balance is not increased.
User B6's - B10's HP balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 75% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. -
The virtual operation: fill_vesting_withdraw are generated.
Test 11: For user A.
Test 12: For users A and B.
Test 13: For users A and B1 - B4.
Test 14: For users A and B1 - B10.
Test 15: For users A and B6 - B10.
Test suite - User updates settings of the withdraw vesting route after the first withdrawal.
Test cases:
-
16. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = false and after withdrawal removes it. -
17. User A sets the withdraw vesting route to user B with percent 100% and auto_vest = true and after withdrawal modifies it - change 100% to 50% and true to false. -
18. User A sets the withdraw vesting routes to: - user B1 with percent 10% and auto_vest = false,
- user B2 with percent 20% and auto_vest = true,
- user B3 with percent 30% and auto_vest = false
and after withdrawal adds a new route: to User B4, 40% and auto_vest = true. -
19. User A sets the withdraw vesting routes to users B1 - B10 with percent 10% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false after withdrawal modifies B1 from 10% to 5%. -
20. User A sets the withdraw vesting routes to users B1 - B10 with percent 5% and B1 - B5 auto_vest = true and B6 -B10 - auto_vest = false and after withdrawal removes B1-B5.
Preconditions:
- There is no the Power Down in progress created by user A.
Steps:
Step 1: User A creates operation set_withdraw_vesting_route_operation as defined in the test case.
After operation:
Expected results:
- RC is reduced.
Step 2: User A creates Power down.
Expected results:
Results as for test 6-10.
Step 3:
Test 16:
User A removes the vesting route to user B (sets 0%).
Test 17:
User A modifies the vesting route to user B, change to 50% and auto_vest = false.
Test 18:
User A adds a new vesting route to user B4, 40% and auto_vest = true.
Test 19:
User A modifies the vesting route to user B1, change to 5%.
Test 20:
User A removes the vesting routes to users B1-B5.
After operation:
Expected results:
- RC is reduced.
After withdraw (2):
Expected results:
Results as for test 11-15.
-
The HP balance is reduced by {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 16 - 20. -
The {target} balance is increased:
Test 16:
User A's Hive balance is increased by 100% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B's Hive balance is not increased.
Test 17:
User B's Hive balance is increased by 50% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. User A's Hive balance is increased by 50% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 18:
User B1's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B2's HP balance is increased by 20% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B3's Hive balance is increased by 30% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B4's HP balance is increased by 40% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
Test 19:
User B1's Hive balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. User B2's - B5's Hive balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User B6's - B10's HP balance is increased by 10% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. Test 20:
User B1's - B5's Hive balance is not increased.
User B6's - B10's HP balance is increased by 5% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS.
User A's Hive balance is increased by 75% of {amount}/HIVE_VESTING_WITHDRAW_INTERVALS. -
The virtual operation: fill_vesting_withdraw are generated.
Test 16: For user A. Test 17: For users A and B. Test 18: For users A and B1 - B4. Test 19: For users A and B1 - B10. Test 20: For users A and B6 - B10.