-
Notifications
You must be signed in to change notification settings - Fork 21
/
four_operators.go
39 lines (34 loc) · 996 Bytes
/
four_operators.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package proposer
import (
"github.com/bloxapp/ssv-spec/qbft"
"github.com/bloxapp/ssv-spec/qbft/spectest/tests"
"github.com/bloxapp/ssv-spec/types"
"github.com/bloxapp/ssv-spec/types/testingutils"
)
// FourOperators tests round-robin proposer selection for 4 member committee
func FourOperators() tests.SpecTest {
var p types.OperatorID
heights := make([]qbft.Height, 0)
rounds := make([]qbft.Round, 0)
proposers := make([]types.OperatorID, 0)
for h := qbft.FirstHeight; h < 100; h++ {
p = types.OperatorID(h%4) + 1
for r := qbft.FirstRound; r < 100; r++ {
heights = append(heights, h)
rounds = append(rounds, r)
proposers = append(proposers, p)
p++
if p == 5 {
p = 1
}
}
}
//fmt.Printf("h:%v\nr:%v\np:%v\n", heights, rounds, proposers)
return &tests.RoundRobinSpecTest{
Name: "4 member committee",
Share: testingutils.TestingShare(testingutils.Testing4SharesSet()),
Heights: heights,
Rounds: rounds,
Proposers: proposers,
}
}