code.vegaprotocol.io/vega@v0.79.0/core/integration/docs/delegation_validator.md (about) 1 ## Integration test framework for delegation and validators. 2 3 ### Registering/setting up validators. 4 5 To create/register a validator, the following step should be used: 6 7 ```cucumber 8 Given the validators: 9 | id | staking account balance | pub_key | 10 | node1 | 10000 | n1pk | 11 | node 2 | 20000 | n2pk | 12 ``` 13 14 Where `id` and `staking account balance` are required, the `pub_key` is optional. The types are as follows: 15 16 ``` 17 | id | string | 18 | staking account balance | uint | 19 | pub_key | string | 20 ``` 21 22 The step _must_ match the pattern `^the validators:$`. 23 24 ### Verifying the delegation balances for a given epoch. 25 26 To validate what the delegation balance is given a party and epoch sequence number, use the following step: 27 28 ```cucumber 29 Then the parties should have the following delegation balances for epoch 3: 30 | party | node id | amount | 31 | node1 | node1 | 1000 | 32 | party1 | node1 | 123 | 33 | node2 | node2 | 2000 | 34 | party2 | node2 | 100 | 35 | party2 | node1 | 100 | 36 ``` 37 All fields in the table are required and are of the following types: 38 39 ``` 40 | party | string | 41 | node id | string | 42 | amount | uint | 43 ``` 44 The step _must_ match the pattern `^the parties should have the following delegation balances for epoch (\d+):$`. 45 46 ### Verifying the validator scores per epoch. 47 48 To check whether or not the validator scores are what we'd expect, use the following step: 49 50 ```cucumber 51 Then the validators should have the following val scores for epoch 1: 52 | node id | validator score | normalised score | 53 | node1 | 0.35 | 0.45 | 54 | node2 | 0.65 | 0.55 | 55 ``` 56 All fields are required, and have the following types: 57 58 ``` 59 | node id | string | 60 | validator score | decimal [up to 16 decimals] | 61 | normalised score | decimal [up to 16 decimals] | 62 ``` 63 The step _must_ match the pattern `^the validators should have the following val scores for epoch (\d+):$` 64 65 ### Verify the rewards received per epoch. 66 67 To validate whether the parties receive the expected rewards for a given epoch, use: 68 69 ```cucumber 70 Then the parties receive the following reward for epoch 5: 71 | party | asset | amount | 72 | party1 | TOKEN | 12 | 73 | party2 | TOKEN | 20 | 74 | node1 | TOKEN | 100 | 75 | node2 | TOKEN | 200 | 76 ``` 77 78 All fields are required and of the following types: 79 80 ``` 81 | party | string | 82 | asset | string | 83 | amount | uint | 84 ``` 85 The step _must_ match the pattern `^the parties receive the following reward for epoch (\d+):$` 86 87 ### Ensure we are in the expected epoch. 88 89 To make sure the scenario is indeed in the epoch we expect to be in: 90 91 ```cucumber 92 When the current epoch is "2" 93 ``` 94 95 The step _must_ match the pattern `^the current epoch is "([^"]+)"$`. 96 **NOTE**: the matched, quoted value should be a `uint`, otherwise the scenario will trigger a panic. 97