code.vegaprotocol.io/vega@v0.79.0/core/integration/features/transfers/one_off_transfers.feature (about)

     1  Feature: Test one off transfers
     2  
     3  Background:
     4      Given time is updated to "2021-08-26T00:00:00Z"
     5      Given the following network parameters are set:
     6        | name                                    | value |
     7        | transfer.fee.factor                     |  0.5  |
     8        | transfer.fee.factor                     |  0.5  |
     9        | network.markPriceUpdateMaximumFrequency | 0s    |
    10        | transfer.fee.maxQuantumAmount           |  1    |
    11  
    12      Given the following assets are updated:
    13      | id    | decimal places | quantum |
    14      | VEGA  |       0        |   50000 |
    15  
    16      Given the parties deposit on asset's general account the following amount:
    17      | party    | asset | amount          |
    18      | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c   | VEGA  | 10000000        |
    19  
    20      And create the network treasury account for asset "VEGA"
    21  
    22  
    23  Scenario: simple successful transfers when (transfer amount * transfer.fee.factor <= transfer.fee.maxQuantumAmount * quantum) (0057-TRAN-001, 0057-TRAN-007, 0057-TRAN-008)
    24      Given the parties submit the following one off transfers:
    25      | id | from   |  from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |
    26      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL | VEGA  |  10000 | 2021-08-26T00:00:01Z  |
    27      | 2  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | 576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303 | ACCOUNT_TYPE_GENERAL | VEGA  |  20000 | 2021-08-26T00:00:02Z  |
    28      | 3  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | VEGA  |  30000 | 2021-08-26T00:00:03Z  |
    29  
    30      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    31  
    32      Given time is updated to "2021-08-26T00:00:01Z"
    33      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    34      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    35  
    36      Given time is updated to "2021-08-26T00:00:02Z"
    37      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    38      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    39      Then "576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303" should have general account balance of "20000" for asset "VEGA"
    40  
    41      Given time is updated to "2021-08-26T00:00:03Z"
    42      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    43      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    44      Then "576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303" should have general account balance of "20000" for asset "VEGA"
    45      Then "a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf" should have general account balance of "30000" for asset "VEGA"
    46  
    47  # Scenario: discount is applied for transaction fee (0057-TRAN-013)
    48  #     Given the parties submit the following one off transfers:
    49  #     | id | from   |  from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |
    50  #     | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL | VEGA  |  10000 | 2021-08-26T00:00:01Z  |
    51  #     | 2  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | 576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303 | ACCOUNT_TYPE_GENERAL | VEGA  |  20000 | 2021-08-26T00:00:02Z  |
    52  #     | 3  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | VEGA  |  30000 | 2021-08-26T00:00:03Z  |
    53  
    54  #     Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    55  
    56  #     Given time is updated to "2021-08-26T00:00:01Z"
    57  #     Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    58  #     Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    59  
    60  #     Given time is updated to "2021-08-26T00:00:02Z"
    61  #     Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    62  #     Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    63  #     Then "576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303" should have general account balance of "20000" for asset "VEGA"
    64  
    65  #     Given time is updated to "2021-08-26T00:00:03Z"
    66  #     Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9910000" for asset "VEGA"
    67  #     Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    68  #     Then "576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303" should have general account balance of "20000" for asset "VEGA"
    69  #     Then "a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf" should have general account balance of "30000" for asset "VEGA"
    70  
    71  Scenario: simple successful transfers when (transfer amount * transfer.fee.factor > transfer.fee.maxQuantumAmount * quantum) (0057-TRAN-011)
    72      Given the following network parameters are set:
    73        | name                                    | value |
    74        | transfer.fee.maxQuantumAmount           |  0.1  |
    75      
    76      Given the parties submit the following one off transfers:
    77      | id | from   |  from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |
    78      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL | VEGA  |  10000 | 2021-08-26T00:00:01Z  |
    79      | 2  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | 576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303 | ACCOUNT_TYPE_GENERAL | VEGA  |  20000 | 2021-08-26T00:00:02Z  |
    80      | 3  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | VEGA  |  30000 | 2021-08-26T00:00:03Z  |
    81  
    82      # original balance - all transactions + fee for each transaction = 10000000-(10000+20000+30000+3*5000)
    83      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9925000" for asset "VEGA"
    84  
    85      Given time is updated to "2021-08-26T00:00:01Z"
    86      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9925000" for asset "VEGA"
    87      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    88  
    89      Given time is updated to "2021-08-26T00:00:02Z"
    90      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9925000" for asset "VEGA"
    91      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    92      Then "576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303" should have general account balance of "20000" for asset "VEGA"
    93  
    94      Given time is updated to "2021-08-26T00:00:03Z"
    95      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9925000" for asset "VEGA"
    96      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "10000" for asset "VEGA"
    97      Then "576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303" should have general account balance of "20000" for asset "VEGA"
    98      Then "a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf" should have general account balance of "30000" for asset "VEGA"
    99  
   100  Scenario: invalid transfers (0057-TRAN-005, 0057-TRAN-006)
   101       Given the parties submit the following one off transfers:
   102      | id | from                                                             |              from_account_type           |   to                                                             |         to_account_type          | asset | amount | delivery_time         |               error            |
   103      | 1  |                                                                  |  ACCOUNT_TYPE_GENERAL                    | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:01Z  |  invalid from account          |
   104      | 2  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    |                                                                  | ACCOUNT_TYPE_GENERAL             | VEGA  |  20000 | 2021-08-26T00:00:02Z  |  invalid to account            |
   105      | 3  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  0     | 2021-08-26T00:00:03Z  |  cannot transfer zero funds    |
   106      | 4  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_UNSPECIFIED                | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   107      | 5  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_INSURANCE                  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   108      | 6  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_SETTLEMENT                 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   109      | 7  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_MARGIN                     | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   110      | 8  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_FEES_INFRASTRUCTURE        | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   111      | 9  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_FEES_LIQUIDITY             | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   112      | 10 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_FEES_MAKER                 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   113      | 11 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_LOCK_WITHDRAW              | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   114      | 12 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_BOND                       | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   115      | 13 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_EXTERNAL                   | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   116      | 14 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GLOBAL_INSURANCE           | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   117      | 15 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GLOBAL_REWARD              | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   118      | 16 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_PENDING_TRANSFERS          | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   119      | 17 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES     | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   120      | 18 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   121      | 19 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   122      | 20 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL             | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported from account type |
   123      | 21 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_UNSPECIFIED         | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   124      | 22 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_INSURANCE           | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   125      | 23 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_SETTLEMENT          | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   126      | 24 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_MARGIN              | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   127      | 25 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_FEES_INFRASTRUCTURE | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   128      | 26 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_FEES_LIQUIDITY      | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   129      | 27 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_FEES_MAKER          | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   130      | 28 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_LOCK_WITHDRAW       | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   131      | 29 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_BOND                | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   132      | 30 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_EXTERNAL            | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   133      | 31 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GLOBAL_INSURANCE    | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   134      | 32 | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL                    | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_PENDING_TRANSFERS   | VEGA  |  10000 | 2021-08-26T00:00:03Z  |  unsupported to account type   |
   135  
   136  Scenario: transfer to self succeeds
   137      Given the parties submit the following one off transfers:
   138      | id | from   |   from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |
   139      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c | ACCOUNT_TYPE_GENERAL | VEGA  |  10000 | 2021-08-26T00:00:01Z  |
   140  
   141      Given time is updated to "2021-08-26T00:00:05Z"
   142      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9995000" for asset "VEGA"
   143  
   144  Scenario: transfer from non existing account fails
   145      Given the parties submit the following one off transfers:
   146      | id | from   |   from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |                            error                                         |
   147      | 1  | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 |  ACCOUNT_TYPE_GENERAL  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c | ACCOUNT_TYPE_GENERAL | VEGA  |  10000 | 2021-08-26T00:00:01Z  | could not pay the fee for transfer: account does not exist: !a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4VEGA4 |
   148  
   149  
   150  Scenario: payout time in the past - should be executed immediately
   151      Given the parties submit the following one off transfers:
   152      | id | from   |   from_account_type    |   to   |   to_account_type          | asset | amount | delivery_time         |
   153      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL  | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL       | VEGA  |  10000 | 2021-08-25T00:00:01Z  |
   154      | 2  | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 |  ACCOUNT_TYPE_GENERAL  |   0000000000000000000000000000000000000000000000000000000000000000    | ACCOUNT_TYPE_GLOBAL_REWARD | VEGA  |  5000 | 2021-08-25T00:00:01Z   |
   155  
   156      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9985000" for asset "VEGA"
   157      Then "a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4" should have general account balance of "2500" for asset "VEGA"
   158  
   159  Scenario: Transfer from general account to reward account (0057-TRAN-002, 0057-TRAN-007, 0013-ACCT-028)
   160      Given the parties submit the following one off transfers:
   161      | id | from   |  from_account_type    |   to   |   to_account_type                       | asset | amount | delivery_time         |
   162      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL |    0000000000000000000000000000000000000000000000000000000000000000   | ACCOUNT_TYPE_GLOBAL_REWARD              | VEGA  |  10000 | 2021-08-25T00:00:00Z  |
   163      | 2  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL |    0000000000000000000000000000000000000000000000000000000000000000   | ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS    | VEGA  |  20000 | 2021-08-26T00:00:02Z  |
   164      | 3  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL |    0000000000000000000000000000000000000000000000000000000000000000   | ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES    | VEGA  |  30000 | 2021-08-26T00:00:03Z  |
   165      | 4  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL |    0000000000000000000000000000000000000000000000000000000000000000   | ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES | VEGA  |  40000 | 2021-08-26T00:00:03Z  |
   166      | 5  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL |    0000000000000000000000000000000000000000000000000000000000000000   | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES     | VEGA  |  50000 | 2021-08-26T00:00:03Z  |
   167  
   168      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9775000" for asset "VEGA"
   169  
   170      # first transfer's time is in the past so done immediately
   171      And the reward account of type "ACCOUNT_TYPE_GLOBAL_REWARD" should have balance of "10000" for asset "VEGA"
   172      And the reward account of type "ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS" should have balance of "0" for asset "VEGA"
   173      And the reward account of type "ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES" should have balance of "0" for asset "VEGA"
   174      And the reward account of type "ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES" should have balance of "0" for asset "VEGA"
   175      And the reward account of type "ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES" should have balance of "0" for asset "VEGA"
   176  
   177      #  advance to the payout to ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS
   178      Given time is updated to "2021-08-26T00:00:02Z"
   179      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9775000" for asset "VEGA"
   180      Then the reward account of type "ACCOUNT_TYPE_GLOBAL_REWARD" should have balance of "10000" for asset "VEGA"
   181      And the reward account of type "ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS" should have balance of "20000" for asset "VEGA"
   182      And the reward account of type "ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES" should have balance of "0" for asset "VEGA"
   183      And the reward account of type "ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES" should have balance of "0" for asset "VEGA"
   184      And the reward account of type "ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES" should have balance of "0" for asset "VEGA"
   185  
   186      # advance to the payout to all other rewards,
   187      Given time is updated to "2021-08-26T00:00:03Z"
   188      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9775000" for asset "VEGA"
   189      And the reward account of type "ACCOUNT_TYPE_GLOBAL_REWARD" should have balance of "10000" for asset "VEGA"
   190      And the reward account of type "ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS" should have balance of "20000" for asset "VEGA"
   191      And the reward account of type "ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES" should have balance of "30000" for asset "VEGA"
   192      And the reward account of type "ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES" should have balance of "40000" for asset "VEGA"
   193      And the reward account of type "ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES" should have balance of "50000" for asset "VEGA"
   194      And the reward account of type "ACCOUNT_TYPE_FEES_INFRASTRUCTURE" should have balance of "75000" for asset "VEGA"
   195  
   196  Scenario: Insufficient funds to cover transfer + fees (0057-TRAN-007)
   197      Given the parties submit the following one off transfers:
   198      | id | from   |  from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |                            error                                 |
   199      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL | VEGA  | 10000  | 2021-08-25T00:00:00Z  |                                                                  |
   200      | 2  | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 |  ACCOUNT_TYPE_GENERAL | 576380694832d9271682e86fffbbcebc09ca79c259baa5d4d0298e12ecdee303 | ACCOUNT_TYPE_GENERAL | VEGA  | 10000 | 2021-08-26T00:00:02Z   | could not pay the fee for transfer: not enough funds to transfer |
   201  
   202  
   203  Scenario: Cannot cancel scheduled one off transfer (0057-TRAN-010)
   204      Given the parties submit the following one off transfers:
   205      | id | from   |  from_account_type    |   to   |   to_account_type    | asset | amount | delivery_time         |
   206      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL | a7c4b181ef9bf5e9029a016f854e4ad471208020fd86187d07f0b420004f06a4 | ACCOUNT_TYPE_GENERAL | VEGA  | 10000  | 2021-08-28T00:00:00Z  |
   207  
   208     When the parties submit the following transfer cancellations:
   209      | party  | transfer_id |                error               |
   210      | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |      1      | recurring transfer does not exists |
   211  
   212  @networktreasury
   213  Scenario: Transfer from general account to Network Treasury Account by specifying "0" address and the account type (0013-ACCT-026)
   214      Given the parties submit the following one off transfers:
   215      | id | from   |  from_account_type    |   to   |   to_account_type                       | asset | amount | delivery_time         |
   216      | 1  | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c |  ACCOUNT_TYPE_GENERAL |    0000000000000000000000000000000000000000000000000000000000000000   | ACCOUNT_TYPE_NETWORK_TREASURY | VEGA  | 10000 | 2021-08-26T00:00:01Z  |
   217  
   218      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9985000" for asset "VEGA"
   219      # We check the system account receiving the balance because the treasury transfer is on-chain.
   220      And the reward account of type "ACCOUNT_TYPE_PENDING_TRANSFERS" should have balance of "10000" for asset "VEGA"
   221  
   222      When the network moves ahead "1" epochs
   223      Then "f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c" should have general account balance of "9985000" for asset "VEGA"
   224  
   225      # We check the system account receiving the balance because the treasury transfer is on-chain.
   226      And the reward account of type "ACCOUNT_TYPE_NETWORK_TREASURY" should have balance of "10000" for asset "VEGA"