Tests - operation in Hive - remove proposal
Operation: remove_proposal_operation, // 46
Configuration:
HIVE_PROPOSAL_FEE_INCREASE_DAYS, default mainnet value: 60 days
HIVE_TREASURY_FEE, default mainnet value: 10 HBD
HIVE_PROPOSAL_FEE_INCREASE_AMOUNT, default mainnet value: 1 HBD
start_date
.
Test cases (positive): User removes a proposal before -
1. User (proposal creator) removes proposal.
Preconditions:
- There are the following proposals:
- proposal 1 - User A creates a post, user A creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 2 - User A creates a post, user A creates a proposal with
receiver
= user B and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 3 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 4 - User A creates a post, user A creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 5 - User A creates a post, user A creates a proposal with
receiver
= user B and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 6 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days).
Steps:
Step 1: User (proposal creator) removes proposal.
Expected results
- RC is reduced.
- The proposal is removed (please let me know what it means).
- HBD balance is not changed - neither HIVE_TREASURY_FEE is deducted nor HIVE_PROPOSAL_FEE_INCREASE_AMOUNT is returned.
start_date
and before end_date
.
Test cases (positive): User removes a proposal after -
2. User (proposal creator) removes proposal.
Preconditions:
- There are the following proposals:
- proposal 1 - User A creates a post, user A creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 2 - User A creates a post, user A creates a proposal with
receiver
= user B and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 3 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 4 - User A creates a post, user A creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 5 - User A creates a post, user A creates a proposal with
receiver
= user B and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 6 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days).
Steps:
Step 1: User (proposal creator) removes proposal.
Expected results
- RC is reduced.
- The proposal is removed (please let me know what it means).
- HBD balance is not changed - neither HIVE_TREASURY_FEE is deducted nor HIVE_PROPOSAL_FEE_INCREASE_AMOUNT is returned.
end_date
.
Test cases (positive): User removes a proposal after -
3. User (proposal creator) removes proposal.
Preconditions:
- There are the following proposals:
- proposal 1 - User A creates a post, user A creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 2 - User A creates a post, user A creates a proposal with
receiver
= user B and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 3 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 4 - User A creates a post, user A creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 5 - User A creates a post, user A creates a proposal with
receiver
= user B and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 6 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days).
Steps:
Step 1: User (proposal creator) removes proposal.
Expected results
- RC is reduced.
- The proposal is removed (please let me know what it means).
- HBD balance is not changed - neither HIVE_TREASURY_FEE is deducted nor HIVE_PROPOSAL_FEE_INCREASE_AMOUNT is returned.
Test cases (negative): Unauthorized user tries to remove a proposal.
-
4. User A who hasn't created a proposal tries to remove it.
Preconditions:
There are the following proposals:
- proposal 3 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts less than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days). - proposal 6 - User A creates a post, user B creates a proposal with
receiver
= user A and the proposal lasts more than HIVE_PROPOSAL_FEE_INCREASE_DAYS (60 days).
Expected results
- The proposal is not removed - an error occurs.
Edited by Aleksandra Grabowska