forked from ssvlabs/ssv-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invalid_round_change_data.go
31 lines (28 loc) · 1.16 KB
/
invalid_round_change_data.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
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"
)
// InvalidRoundChangeData tests a round change msg data for which Validate() != nil
func InvalidRoundChangeData() *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: qbft.FirstRound,
Identifier: []byte{1, 2, 3, 4},
Data: testingutils.RoundChangeDataBytes(nil, qbft.FirstRound),
}),
}
return &tests.MsgProcessingSpecTest{
Name: "invalid round change data",
Pre: pre,
PostRoot: "e9a7c1b25a014f281d084637bdc50ec144f1262b5cc87eeb6b4493d27d10a69b",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{},
ExpectedError: "invalid signed message: roundChangeData invalid: round change prepared value invalid",
}
}