Skip to content

Commit

Permalink
Merge pull request #9737 from vegaprotocol/tranfer-acs
Browse files Browse the repository at this point in the history
fix: add integration test for AC 0013-ACCT-028
  • Loading branch information
ValentinTrinque authored Oct 11, 2023
2 parents 8302997 + 2069055 commit 08fb257
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Scenario: payout time in the past - should be executed immediately
Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9985000" for asset "VEGA"
Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "2500" for asset "VEGA"

Scenario: Transfer from general account to reward account (0057-TRAN-002, 0057-TRAN-007)
Scenario: Transfer from general account to reward account (0057-TRAN-002, 0057-TRAN-007, 0013-ACCT-028)
Given the parties submit the following one off transfers:
| id | from | from_account_type | to | to_account_type | asset | amount | delivery_time |
| 1 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_GLOBAL_REWARD | VEGA | 10000 | 2021-08-25T00:00:00Z |
Expand Down
20 changes: 20 additions & 0 deletions core/integration/features/transfers/recurring_transfers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,23 @@ Scenario: A user's recurring transfer is cancelled if any transfer fails due to
When the parties submit the following transfer cancellations:
| party | transfer_id | error |
| a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | 1 | recurring transfer does not exists |


Scenario: As a user I can make a recurring transfer to Global Rewards account by specifying the "0" address and the account type (0013-ACCT-028)
Given the parties deposit on asset's general account the following amount:
| party | asset | amount |
| a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | VEGA | 4000 |

Given the parties submit the following recurring transfers:
| id | from | from_account_type | to | to_account_type | asset | amount | start_epoch | end_epoch | factor |
| 1 | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_GLOBAL_REWARD | VEGA | 1000 | 1 | 2 | 1 |

# end of epoch 0
When the network moves ahead "7" blocks
Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "4000" for asset "VEGA"

# end of epoch 1
# transferring 1k from a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 to 0000000000000000000000000000000000000000000000000000000000000000
When the network moves ahead "1" epochs
Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "2500" for asset "VEGA"
And the reward account of type "ACCOUNT_TYPE_GLOBAL_REWARD" should have balance of "1000" for asset "VEGA"

0 comments on commit 08fb257

Please sign in to comment.