Tests - operation in Hive - recurrent transfer
Operation: recurrent_transfer_operation, // 49
Configuration:
HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES, default mainnet value: 10
HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE, default mainnet value: 24
HIVE_MAX_RECURRENT_TRANSFER_END_DATE, default mainnet value: 2 years in days
Test case - The {extension} is not used.
It is the general rule for tests 1- 28 - the default value of {extension} should be used.
Tests with {extension} see #523 (closed)
Test cases (general):
-
1. User creates a recurrent transfer in HIVE to be sent once a day for three days -
2. User creates a recurrent transfer in HBD to be sent once a day for three days.
Preconditions (test 1 and 2):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 3 times
- There is enough funds for all recurrent transfers.
Steps (test 1 and 2):
Step 1: User defines a recurrent transfer with {recurrence} and {executions}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After 2 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: RC is not reduced.
- (transfer 3) After 2 *{recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 3 * {recurrence}: {from} account balance is not reduced.
- (no transfer) After 3 * {recurrence}: {to} account balance is not increased.
Test cases (remove recurrent transfer):
-
3. User removes a defined recurrent transfer in Hive. -
4. User removes a defined recurrent transfer in HBD.
Preconditions (test 3 and test 4):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 3 times
- X moment of time between 2 * {recurrence} and 3 * {recurrence}.
- There is enough funds for all recurrent transfers.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps (test 3 and test 4):
Step 1: User defines a recurrent transfer with {recurrence} and {executions}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with { amount } =0 in X moment.
Expected results:
- (no transfer) After X: {from} account balance is not reduced by transferred {amount}.
- (no transfer) After X: {to} account balance is not increased by transferred {amount}.
- (no transfer) After X: RC is reduced.
- (no transfer) After X: the virtual operation: fill_recurrent_transfer_operation is not generated.
- (no transfer) After 2 * {recurrence}: {from} account balance is not reduced.
- (no transfer) After 2 * {recurrence}: {to} account balance is not increased.
Test cases (update amount):
-
5. User increases an amount of defined recurrent transfer in Hive. -
6. User increases an amount of defined recurrent transfer in HBD.
Preconditions (test 5 and test 6):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 4 times
- X moment of time between 2 * {recurrence} and 3 * {recurrence}.
- There is enough funds for all recurrent transfers.
- Amount1 < amount2.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps (test 5 and test 6):
Step 1: User defines a recurrent transfer with {recurrence}, {executions} and {amount } = amount1.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with {amount} =amount2 in X moment and {executions} = 1 time. The other parameters are not changed.
Expected results:
- After operation: RC is reduced.
- (transfer 3) After 2 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After 3 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 3 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 3 * {recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 4 * {recurrence}: {from} account balance is not reduced.
- (no transfer) After 5 * {recurrence}: {to} account balance is not increased.
Test cases (update amount):
-
7. User decreases an amount of defined recurrent transfer in Hive. -
8. User decreases an amount of defined recurrent transfer in HBD.
Preconditions (test 7 and test 8):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 4 times
- X moment of time between 2 * {recurrence} and 3 * {recurrence}.
- There is enough funds for all recurrent transfers.
- amount1 > amount2.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps like for test 5 and test 6.
Test cases (update a number of defined transfer):
-
9. User increases a number of defined recurrent transfer in Hive. -
10. User increases a number of defined recurrent transfer in HBD.
Preconditions (test 9 and test 10):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- executions1 = 3 times, executions2 = 5 times,
- X moment - after second transfer and before third one.
- There is enough funds for all recurrent transfers.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps (test 9 and test 10):
Step 1: User defines a recurrent transfer with {recurrence}, {executions}=executions1 and {amount}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with {executions} =executions2 in X moment. The other parameters are not changed.
Expected results:
- (transfer 1) After 2 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After 2 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 1) After 2 * {recurrence}: After operation: RC is reduced.
- (transfer 1) After 2 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After 3 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After 3 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After 3 * {recurrence}: After operation: RC is not reduced.
- (transfer 2) After 3 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After 4 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 4 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 4 * {recurrence}: After operation: RC is not reduced.
- (transfer 3) After 4 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 4) After 5 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 4) After 5 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 4) After 5 * {recurrence}: After operation: RC is not reduced.
- (transfer 4) After 5 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 5) After 6 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 5) After 6 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 5) After 6 * {recurrence}: After operation: RC is not reduced.
- (transfer 5) After 6 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 7 * {recurrence}: {from} account balance is not reduced.
- (no transfer) After 7 * {recurrence}: {to} account balance is not increased.
Test cases (update a number of defined transfer):
-
11. User decreases a number of defined recurrent transfer in Hive. -
12. User decreases a number of defined recurrent transfer in HBD.
Preconditions (test 11 and test 12):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE.
- executions1 = 4 times, executions2 = 3 times,
- X moment - after second transfer and before third one.
- There is enough funds for all recurrent transfers.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps (test 11 and test 12):
Step 1: User defines a recurrent transfer with {recurrence}, {executions}=executions1 and {amount}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with {executions} =executions2 in X moment. The other parameters are not changed.
Expected results:
- (transfer 1) After 2 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After 2 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 1) After 2 * {recurrence}: After operation: RC is reduced.
- (transfer 1) After 2 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After 3 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After 3 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After 3 * {recurrence}: After operation: RC is not reduced.
- (transfer 2) After 3 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After 4 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 4 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 4 * {recurrence}: After operation: RC is not reduced.
- (transfer 3) After 4 * {recurrence}: The virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 5 * {recurrence}: {from} account balance is not reduced.
- (no transfer) After 5 * {recurrence}: {to} account balance is not increased.
Test cases (update a frequency):
-
13. User increases a frequency of defined recurrent transfer in Hive. -
14. User increases a frequency of defined recurrent transfer in HBD.
Preconditions (test 13 and test 14):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE.
- Y - "one day", so recurence1 = 7 * Y ("once a week"), recurence2 = 2*Y ("every two days").
- {executions} =4
- X moment - after second transfer and before third one.
- There is enough funds for all recurrent transfers.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps (test 13 and test 14):
Step 1: User defines a recurrent transfer with {recurrence} =recurrence1, {executions} and {amount}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After recurrence1: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After recurrence1: {to} account balance is increased by transferred {amount}.
- (transfer 2) After recurrence1: RC is not reduced.
- (transfer 2) After recurrence1: the virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with {recurrence} =recurrence2 in X moment. The other parameters are not changed.
Expected results:
- (transfer 1) After X + recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After X + recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 1) After X + recurrence2: After operation: RC is reduced.
- (transfer 1) After X + recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After X + 2 * recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After X + 2 * recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 2) After X + 2 * recurrence2: After operation: RC is not reduced.
- (transfer 2) After X + 2 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After X + 3 * recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After X + 3 * recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 3) After X + 3 * recurrence2: After operation: RC is not reduced.
- (transfer 3) After X + 3 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 4) After X + 4 * recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 4) After X + 4 * recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 4) After X + 4 * recurrence2: After operation: RC is not reduced.
- (transfer 4) After X + 4 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 3 * recurrence1: {from} account balance is not reduced.
- (no transfer) After 3 * recurrence1: {to} account balance is not increased.
- (no transfer) After X + 5 * recurrence2: {from} account balance is not reduced.
- (no transfer) After X + 5 * recurrence2: {to} account balance is not increased.
Test cases (update a frequency):
-
15. User increases a frequency of defined recurrent transfer in Hive. -
16. User increases a frequency of defined recurrent transfer in HBD.
Preconditions (test 15 and test 16):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE.
- Y - "one day", so recurence1 = 2 * Y ("every two days"), recurence2 = 3 * Y ("every three days").
- {executions} =3
- X moment - after second transfer and before third one.
- There is enough funds for all recurrent transfers.
- Recurrent transfer from step 1 have the same sender and receiver as the recurrent transfer from step 2.
Steps (test 15 and test 16):
Step 1: User defines a recurrent transfer with {recurrence} =recurrence1, {executions} and {amount}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After recurrence1: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After recurrence1: {to} account balance is increased by transferred {amount}.
- (transfer 2) After recurrence1: RC is not reduced.
- (transfer 2) After recurrence1: The virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with {recurrence} =recurrence2 in X moment. The other parameters are not changed.
Expected results:
- (transfer 1) After X + recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After X + recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 1) After X + recurrence2: After operation: RC is reduced.
- (transfer 1) After X + recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After X + 2 * recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After X + 2 * recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 2) After X + 2 * recurrence2: After operation: RC is not reduced.
- (transfer 2) After X + 2 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After X + 3 * recurrence2: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After X + 3 * recurrence2: {to} account balance is increased by transferred {amount}.
- (transfer 3) After X + 3 * recurrence2: After operation: RC is not reduced.
- (transfer 3) After X + 3 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 2 * recurrence1: {from} account balance is not reduced.
- (no transfer) After 2 * recurrence1: {to} account balance is not increased.
- (no transfer) After X + 4 * recurrence2: {from} account balance is not reduced.
- (no transfer) After X + 4 * recurrence2: {to} account balance is not increased.
Test cases (update three parameters):
-
17. User increases a frequency of defined recurrent transfer in Hive. -
18. User increases a frequency of defined recurrent transfer in HBD.
Preconditions (test 17 and test 18):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE.
- Y - "one day", so:
First recurrent transfer:
recurrence1 = 3 * Y (every three days)
executions1 = 3
{amount} = amount1
Second recurrent transfer:
recurrence2 = 2 * Y (every two days)
executions2 = 5
{amount} = amount2
Third recurrent transfer:
recurrence3 = 4 * Y (every two days)
executions3 = 2
{amount} = amount3
3. amount1 < amount2 < amount3
- X1 - moment when the recurrent transfer is updated first time ( 5 * Y - after "five days").
- X2 - moment when the recurrent transfer is updated second time (14*Y - after "fourteen days").
- There is enough funds for all recurrent transfers.
Steps (test 17 and test 18):
Step 1: User defines a recurrent transfer with {recurrence}=recurrence1, {executions}=executions1 and {amount} = amount1.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred amount1.
- (transfer 1) After operation: {to} account balance is increased by transferred amount1.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After recurrence1: {from} account balance is reduced by transferred amount1.
- (transfer 2) After recurrence1: {to} account balance is increased by transferred amount1.
- (transfer 2) After recurrence1: RC is not reduced.
- (transfer 2) After recurrence1: the virtual operation: fill_recurrent_transfer_operation is generated.
Step 2: User defines a recurrent transfer with {recurrence}=recurrence2, {executions}=executions2 and {amount}=amount2 after X1.
Expected results:
- (transfer 1) After X1 + recurrence2: {from} account balance is reduced by transferred amount2.
- (transfer 1) After X1 + recurrence2: {to} account balance is increased by transferred amount2.
- (transfer 1) After X1 + recurrence2: After operation: RC is reduced.
- (transfer 1) After X1 + recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After X1 + 2 * recurrence2: {from} account balance is reduced by transferred amount2.
- (transfer 2) After X1 + 2 * recurrence2: {to} account balance is increased by transferred amount2.
- (transfer 2) After X1 + 2 * recurrence2: After operation: RC is not reduced.
- (transfer 2) After X1 + 2 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After X1 + 3 * recurrence2: {from} account balance is reduced by transferred amount2.
- (transfer 3) After X1 + 3 * recurrence2: {to} account balance is increased by transferred amount2.
- (transfer 3) After X1 + 3 * recurrence2: After operation: RC is not reduced.
- (transfer 3) After X1 + 3 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 4) After X1 + 4 * recurrence2: {from} account balance is reduced by transferred amount2.
- (transfer 4) After X1 + 4 * recurrence2: {to} account balance is increased by transferred amount2.
- (transfer 4) After X1 + 4 * recurrence2: After operation: RC is not reduced.
- (transfer 4) After X1 + 4 * recurrence2: The virtual operation: fill_recurrent_transfer_operation is generated.
Step 3: User defines a recurrent transfer with {recurrence}=recurrence3, {executions}=executions3 and {amount}=amount3 after X2.
Expected results:
- (transfer 1) After X2 + recurrence3: {from} account balance is reduced by transferred amount3.
- (transfer 1) After X2 + recurrence3: {to} account balance is increased by transferred amount3.
- (transfer 1) After X2 + recurrence3: After operation: RC is reduced.
- (transfer 1) After X2 + recurrence3: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After X2 + 2 * recurrence3: {from} account balance is reduced by transferred amount3.
- (transfer 2) After X2 + 2 * recurrence3: {to} account balance is increased by transferred amount3.
- (transfer 2) After X2 + 2 * recurrence3: After operation: RC is not reduced.
- (transfer 2) After X2 + 2 * recurrence3: the virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After X2 + 3 * recurrence3: {from} account balance is not reduced.
- (no transfer) After X2 + 3 * recurrence3: {to} account balance is not increased.
Test cases (lack of funds - the first transfer):
-
19. User creates a recurrent transfer in HIVE, but the first transfer is not created because the lack of funds. -
20. User creates a recurrent transfer in HBD, but the first transfer is not created because the lack of funds.
Preconditions (test 19 and 20):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 3 times.
- User balance Hive/HBD < amount1+ amount2
Steps (test 1 and 2):
Step 1: User defines a recurrent transfer with {recurrence}, {executions} and {amount}=amount1 and creates the transfer with amount2. The recurrent transfer and the transfer have to be in the same transaction, the first should be the recurrent transfer, the second - the normal transfer.
Expected results:
- (normal transfer) After operation: {from} account balance is reduced by transferred amount2.
- (normal transfer) After operation: {to} account balance is increased by transferred amount2.
- (normal transfer) After operation: RC is reduced.
- (recurrent transfer) The operation is not executed.
- (recurrent transfer) The virtual operation: failed_recurrent_transfer_operation is generated.
- (recurrent transfer - no transfer) After {recurrence}: {from} account balance is not reduced.
- (recurrent transfer - no transfer) After {recurrence}: {to} account balance is not increased.
Test cases (lack of funds - the second transfer):
-
21. User creates a recurrent transfer in HIVE and the second recurrent transfer failed once because of the lack of funds. -
22. User creates a recurrent transfer in HBD and the second recurrent transfer failed once because of the lack of funds.
Preconditions (test 21 and 22):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 3 times.
- User {amount} < balance Hive/HBD < 2 *{amount}
Steps (test 21 and 22):
Step 1: User defines a recurrent transfer with {recurrence}, {executions} and {amount}.
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
There is a lack of funds for the second execution of the recurrent transfer
- (transfer 2) After {recurrence}: {from} account balance is not reduced.
- (transfer 2) After {recurrence}: {to} account balance is not increased.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: the virtual operation: failed_recurrent_transfer_operation is generated.
Step 2: User receives a transfer and there is enough funds for the next recurrent transfer.
- (transfer 3) After 2 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: RC is not reduced.
- (transfer 3) After 2 *{recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
- (no transfer) After 3 * {recurrence}: {from} account balance is not reduced.
- (no transfer) After 3 * {recurrence}: {to} account balance is not increased.
Test cases (lack of funds - ten failed transfers):
-
23. User creates a recurrent transfer in HIVE and the execution of the next recurrent transfer fails HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES
times, because of the lack of funds. -
24. User creates a recurrent transfer in HBD and the execution of the next recurrent transfer fails HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES
times, because of the lack of funds.
Preconditions (test 23 and 24):
- {recurrence} > HIVE_MIN_RECURRENT_TRANSFERS_RECURRENCE
- {executions} = 2 +
HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES
- User {amount} < balance Hive/HBD < 2 *{amount}
Steps (test 23 and 24):
Step 1: User defines a recurrent transfer with {recurrence}, {executions} and {amount}.
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
There is a lack of funds from two till HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES execution of the recurrent transfer.
To be checked after each try:
- After trying to execution of the recurrent transfer: {from} account balance is not reduced.
- After trying to execution of the recurrent transfer: {to} account balance is not increased.
- After trying to execution of the recurrent transfer: RC is not reduced.
- After trying to execution of the recurrent transfer: the virtual operation: failed_recurrent_transfer_operation is generated.
After HIVE_MAX_CONSECUTIVE_RECURRENT_TRANSFER_FAILURES tries, there should be no more tries, so:
- After {execution} * {recurrence}: the virtual operation: failed_recurrent_transfer_operation is not generated.
Test cases (The execution date of the last transfer should be no more than HIVE_MAX_RECURRENT_TRANSFER_END_DATE (730) days in the future):
-
25. User creates a recurrent transfer in HIVE to be executed 3 times every year. -
26. User creates a recurrent transfer in HBD to be executed 3 times every year.
Preconditions (test 25 and 26):
- {recurrence} =1 year = HIVE_MAX_RECURRENT_TRANSFER_END_DATE /2
- {executions} = 3 times
- There is enough funds for all recurrent transfers.
Steps (test 1 and 2):
Step 1: User defines a recurrent transfer with {recurrence} and {executions}.
Expected results:
- (transfer 1) After operation: {from} account balance is reduced by transferred {amount}.
- (transfer 1) After operation: RC is reduced.
- (transfer 1) After operation: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 2) After {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 2) After {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 2) After {recurrence}: RC is not reduced.
- (transfer 2) After {recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
- (transfer 3) After 2 * {recurrence}: {from} account balance is reduced by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: {to} account balance is increased by transferred {amount}.
- (transfer 1) After operation: {to} account balance is increased by transferred {amount}.
- (transfer 3) After 2 * {recurrence}: RC is not reduced.
- (transfer 3) After 2 *{recurrence}: the virtual operation: fill_recurrent_transfer_operation is generated.
Test cases (The execution date of the last transfer should be no more than HIVE_MAX_RECURRENT_TRANSFER_END_DATE (730) days in the future):
-
27. User tries to create a recurrent transfer in HIVE to be executed 3 times every 366 days. -
28. User tries to create a recurrent transfer in HBD to be executed 3 times every 366 days.
Preconditions (test 27 and 28):
- {recurrence} = 366 days =
HIVE_MAX_RECURRENT_TRANSFER_END_DATE
+1 - {executions} = 3 times
- There is enough funds for all recurrent transfers.
Steps (test 27 and 28):
Step 1: User tries to define a recurrent transfer with {recurrence} and {executions}.
Expected results:
- The operation is not created - an error occurs.