FormatInputIntoSeed() returns the 'seed data' for the VRF function `seed = lastProposerAddresses + height + round`
(lastProposerAddresses [][]byte, rootHeight, height, round uint64)
| 831 | // FormatInputIntoSeed() returns the 'seed data' for the VRF function |
| 832 | // `seed = lastProposerAddresses + height + round` |
| 833 | func FormatInputIntoSeed(lastProposerAddresses [][]byte, rootHeight, height, round uint64) []byte { |
| 834 | // create a string to hold the vrf input |
| 835 | var input string |
| 836 | // for each proposer address |
| 837 | for _, address := range lastProposerAddresses { |
| 838 | // add to the string using hex representation with a delimiter |
| 839 | input += BytesToString(address) + "/" |
| 840 | } |
| 841 | // add the height and round to the end of the input |
| 842 | input += fmt.Sprintf("%d/%d/%d", rootHeight, height, round) |
| 843 | // hash the result |
| 844 | return crypto.Hash([]byte(input)) |
| 845 | } |