code.vegaprotocol.io/vega@v0.79.0/core/integration/docs/transfers.md (about) 1 ## Validating transfers 2 3 To ensure the correct amounts are transferred to and from the correct accounts, we use the following step: 4 5 ```cucumber 6 Then the following transfers should happen: 7 | type | from | to | from account | to account | market id | amount | asset | 8 | TRANSFER_TYPE_PERPETUALS_FUNDING_LOSS | trader1 | market | ACCOUNT_TYPE_MARGIN | ACCOUNT_TYPE_SETTLEMENT | ETH/DEC19 | 700000000 | ETH | 9 | TRANSFER_TYPE_PERPETUALS_FUNDING_WIN | market | trader2 | ACCOUNT_TYPE_SETTLEMENT | ACCOUNT_TYPE_MARGIN | ETH/DEC19 | 700000000 | ETH | 10 | TRANSFER_TYPE_PERPETUALS_FUNDING_LOSS | trader3 | market | ACCOUNT_TYPE_MARGIN | ACCOUNT_TYPE_SETTLEMENT | ETH/DEC19 | 1400000000 | ETH | 11 | TRANSFER_TYPE_PERPETUALS_FUNDING_WIN | market | trader4 | ACCOUNT_TYPE_SETTLEMENT | ACCOUNT_TYPE_MARGIN | ETH/DEC19 | 1400000000 | ETH | 12 | TRANSFER_TYPE_INFRASTRUCTURE_FEE_DISTRIBUTE | party3 | | ACCOUNT_TYPE_GENERAL | ACCOUNT_TYPE_FEES_INFRASTRUCTURE | | 50 | ETH | 13 ``` 14 15 With the fields being defined as follows: 16 17 ``` 18 | field | required | type | 19 | from | yes | string (party or market ID, blank for system) | 20 | to | yes | string(party or market ID, blank for system) | 21 | from account | yes | ACCOUNT_TYPE | 22 | to account | yes | ACCOUNT_TYPE | 23 | market id | yes | string (blank for general/system account) | 24 | asset | yes | string (asset ID) | 25 | type | no | TRANSFER_TYPE | 26 | is amm | no | boolean (true if either from or to is an AMM subkey) | 27 ``` 28 29 Details for the [`ACCOUNT_TYPE` type](types.md#Account-type) 30 Details for the [`TRANSFER_TYPE` type](types.md#Transfer-type) 31 32 ## Debugging transfers 33 34 To diagnose a problem, it can be useful to dump all the transfers that happened up to that particular point in a given test. To do this, simply add the following: 35 36 ```cucumber 37 Then debug transfers 38 ``` 39 40 This will simply print out all transfer events using the following format: 41 42 ```go 43 fmt.Sprintf("\t|%38s |%85s |%85s |%19s |\n", v.Type, v.FromAccount, v.ToAccount, v.Amount) 44 ```