Tests - operation in Hive - Transfer from savings
Operation: transfer_from_savings_operation, // 33
Configuration:
HIVE_SAVINGS_WITHDRAW_TIME, default mainnet value: 3 days
Test cases:
-
1. User transfers Hive from savings to own balance. -
2. User transfers HBD from savings to own balance. -
3. User transfers Hive from savings to the someone else account balance. -
4. User transfers HBD from savings to the someone else account balance.
Expected results - to be checked in all above test cases:
- After operation: {from} account balance is reduced by {amount}.
- After operation: RC is reduced.
- After
HIVE_SAVINGS_WITHDRAW_TIME
: {to} account balance is increased by {amount}. - After
HIVE_SAVINGS_WITHDRAW_TIME
: the virtual operation: fill_transfer_from_savings is generated.
Test cases:
-
5. User transfers Hive from savings every day during a few days. -
6. User transfers HBD from savings every day during a few days.
Preconditions:
- Amount1 != amount2 !=amount 3 != amount4 !=amount5
- X -
a few days
= afterHIVE_SAVINGS_WITHDRAW_TIME
(for example 4 days). - Y1 (for example 1 day) < Y2 (for example 2 days) <
HIVE_SAVINGS_WITHDRAW_TIME
(mainnet 3 days) < X (for example 4 days)
Steps:
Step 1: User transfers Hive from savings (transfer1).
Expected results:
- After operation: {from} account balance is reduced by {amount1}.
- After operation: RC is reduced.
Step 2: User transfers Hive from savings (transfer2) Y1 after transfer1.
Expected results:
- (transfer2) After Y1: After operation: {from} account balance is reduced by {amount2}.
- (transfer2) After Y1: After operation: RC is reduced.
Step 3: User transfers Hive from savings (transfer3) Y2 after transfer1.
Expected results:
- (transfer3) After Y2: After operation: {from} account balance is reduced by {amount3}.
- (transfer3) After Y2: After operation: RC is reduced.
HIVE_SAVINGS_WITHDRAW_TIME
after transfer1.
Step 4: User transfers Hive from savings (transfer4) Expected results:
- (transfer4) After
HIVE_SAVINGS_WITHDRAW_TIME
: After operation: {from} account balance is reduced by {amount4}. - (transfer4) After
HIVE_SAVINGS_WITHDRAW_TIME
: After operation: RC is reduced. - (transfer1) After
HIVE_SAVINGS_WITHDRAW_TIME
: {to} account balance is increased by {amount}. - (transfer1) After
HIVE_SAVINGS_WITHDRAW_TIME
: the virtual operation: fill_transfer_from_savings is generated.
Step 5: User transfers Hive from savings (transfer5) X after transfer1.
Expected results:
- (transfer5) After X: After operation: {from} account balance is reduced by {amount5}.
- (transfer5) After X: After operation: RC is reduced.
- (transfer2) After Y1 +
HIVE_SAVINGS_WITHDRAW_TIME
: {to} account balance is increased by {amount}. - (transfer2) After Y1 +
HIVE_SAVINGS_WITHDRAW_TIME
: the virtual operation: fill_transfer_from_savings is generated. - (transfer3) After Y2 +
HIVE_SAVINGS_WITHDRAW_TIME
: {to} account balance is increased by {amount3}. - (transfer3) After Y2 +
HIVE_SAVINGS_WITHDRAW_TIME
: the virtual operation: fill_transfer_from_savings is generated. - (transfer4) After 2 *
HIVE_SAVINGS_WITHDRAW_TIME
: {to} account balance is increased by {amount4}. - (transfer4) After 2 *
HIVE_SAVINGS_WITHDRAW_TIME
: the virtual operation: fill_transfer_from_savings is generated. - (transfer5) After X +
HIVE_SAVINGS_WITHDRAW_TIME
: {to} account balance is increased by {amount5}. - (transfer5) After X +
HIVE_SAVINGS_WITHDRAW_TIME
: the virtual operation: fill_transfer_from_savings is generated.
Edited by Mateusz Kudela