Tests - operation in Hive - convert operation
Operation: convert_operation, // 8
Configuration:
HIVE_CONVERSION_DELAY, default mainnet value: 3.5 days
Test cases:
-
1. User converts HBD to HIVE.
Expected results
- After operation: {owner} account balance in HBD is reduced by {amount}.
- After operation: RC is reduced.
- After
HIVE_CONVERSION_DELAY
: {owner} account balance in Hive is increased ( by the operation amount exchanged on the median feed price from that moment. Median feed price is the median of the median prices provided by the witnesses during those 3.5 days). - After
HIVE_CONVERSION_DELAY
: the virtual operation: fill_convert_request_operation is generated.
Test cases:
-
2. User converts HBD to Hive every day during X days.
Preconditions:
- Amount1 != amount2 !=amount 3 != amount4 !=amount5
- Y1 (for example 1 day) < Y2 (for example 2 days) < Y3 (for example 3 days) <
HIVE_CONVERSION_DELAY
(mainnet 3.5 days) < X (for example 4 days)
Steps:
Step 1: User converts HBD (convert1).
Expected results
- (convert1) After operation: {owner} account balance in HBD is reduced by {amount1}.
- (convert1) After operation: RC is reduced.
Step 2: User converts HBD (convert2) after Y1.
Expected results
- (convert2) After Y1: {owner} account balance in HBD is reduced by {amount2}.
- (convert2) After Y1: RC is reduced.
#####Step 3: User converts HBD (convert3) after Y2.
Expected results:
- (convert3) After Y2: After operation: {owner} account balance in HBD is reduced by {amount3}.
- (convert3) After Y2: After operation: RC is reduced.
Step 4: User converts HBD (convert4) after Y3.
Expected results:
- (convert4) After Y3: After operation: {owner} account balance in HBD is reduced by {amount4}.
- (convert4) After Y3: After operation: RC is reduced.
- (convert1) After
HIVE_CONVERSION_DELAY
: {owner} account balance in Hive is increased. - (convert1) After
HIVE_CONVERSION_DELAY
: the virtual operation: fill_convert_request_operation is generated.
Step 5: User converts HBD (convert5) after X days.
Expected results:
- (convert5) After X: After operation: {owner} account balance in HBD is reduced by {amount5}.
- (convert5) After X: After operation: RC is reduced.
- (convert2) After Y1 + HIVE_CONVERSION_DELAY: {owner} account balance in Hive is increased.
- (convert2) After Y1 + HIVE_CONVERSION_DELAY: the virtual operation: fill_convert_request_operation is generated.
- (convert3) After Y2 + HIVE_CONVERSION_DELAY: {owner} account balance in Hive is increased.
- (convert3) After Y2 + HIVE_CONVERSION_DELAY: the virtual operation: fill_convert_request_operation is generated.
- (convert4) After Y3 + HIVE_CONVERSION_DELAY: {owner} account balance in Hive is increased.
- (convert4) After Y3 + HIVE_CONVERSION_DELAY: the virtual operation: fill_convert_request_operation is generated.
- (convert5) After X + HIVE_CONVERSION_DELAY: {owner} account balance in Hive is increased.
- (convert5) After X + HIVE_CONVERSION_DELAY: the virtual operation: fill_convert_request_operation is generated.
Edited by Mateusz Kudela