forked from ssvlabs/ssv-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invalid_val_check.go
40 lines (38 loc) · 1.42 KB
/
invalid_val_check.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
package decided
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"
"github.com/herumi/bls-eth-go-binary/bls"
)
// InvalidValCheckData tests a decided message with invalid decided data (but should pass as it's decided)
func InvalidValCheckData() *tests.ControllerSpecTest {
identifier := types.NewMsgID(testingutils.TestingValidatorPubKey[:], types.BNRoleAttester)
ks := testingutils.Testing4SharesSet()
return &tests.ControllerSpecTest{
Name: "decide invalid value (should pass)",
RunInstanceData: []*tests.RunInstanceData{
{
InputValue: []byte{1, 2, 3, 4},
InputMessages: []*qbft.SignedMessage{
testingutils.MultiSignQBFTMsg(
[]*bls.SecretKey{ks.Shares[1], ks.Shares[2], ks.Shares[3]},
[]types.OperatorID{1, 2, 3},
&qbft.Message{
MsgType: qbft.CommitMsgType,
Height: qbft.FirstHeight,
Round: qbft.FirstRound,
Identifier: identifier[:],
Data: testingutils.CommitDataBytes(testingutils.TestingInvalidValueCheck),
}),
},
ExpectedDecidedState: tests.DecidedState{
DecidedCnt: 1,
DecidedVal: testingutils.TestingInvalidValueCheck,
},
ControllerPostRoot: "befc8626cb71ca1b8493d41f54a709b22bbf530302177b8668fd77562ca3040e",
},
},
}
}