forked from ssvlabs/ssv-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
f1_different_future_rounds_not_prepared.go
46 lines (42 loc) · 1.65 KB
/
f1_different_future_rounds_not_prepared.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
40
41
42
43
44
45
46
package roundchange
import (
"github.com/MatheusFranco99/ssv-spec-AleaBFT/qbft"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/qbft/spectest/tests"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/types"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/types/testingutils"
)
// F1DifferentFutureRoundsNotPrepared tests f+1 speedup (not prev prepared)
func F1DifferentFutureRoundsNotPrepared() *tests.MsgProcessingSpecTest {
pre := testingutils.BaseInstance()
msgs := []*qbft.SignedMessage{
testingutils.SignQBFTMsg(testingutils.Testing4SharesSet().Shares[1], types.OperatorID(1), &qbft.Message{
MsgType: qbft.RoundChangeMsgType,
Height: qbft.FirstHeight,
Round: 5,
Identifier: []byte{1, 2, 3, 4},
Data: testingutils.RoundChangeDataBytes(nil, qbft.NoRound),
}),
testingutils.SignQBFTMsg(testingutils.Testing4SharesSet().Shares[2], types.OperatorID(2), &qbft.Message{
MsgType: qbft.RoundChangeMsgType,
Height: qbft.FirstHeight,
Round: 10,
Identifier: []byte{1, 2, 3, 4},
Data: testingutils.RoundChangeDataBytes(nil, qbft.NoRound),
}),
}
return &tests.MsgProcessingSpecTest{
Name: "round change f+1 not prepared",
Pre: pre,
PostRoot: "6fff8e31d81c7f0121d00a1b6d16c66f0e733eed38ade739cad139d8fd63592f",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{
testingutils.SignQBFTMsg(testingutils.Testing4SharesSet().Shares[1], types.OperatorID(1), &qbft.Message{
MsgType: qbft.RoundChangeMsgType,
Height: qbft.FirstHeight,
Round: 5,
Identifier: []byte{1, 2, 3, 4},
Data: testingutils.RoundChangeDataBytes(nil, qbft.NoRound),
}),
},
}
}