-
Notifications
You must be signed in to change notification settings - Fork 21
/
invalid_identifier.go
39 lines (35 loc) · 1.18 KB
/
invalid_identifier.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 processmsg
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"
)
// InvalidIdentifier tests a process msg with the wrong identifier
func InvalidIdentifier() tests.SpecTest {
ks := testingutils.Testing4SharesSet()
invalidPK := make([]byte, 32)
identifier := types.NewMsgID(testingutils.TestingSSVDomainType, invalidPK, types.BNRoleAttester)
return &tests.ControllerSpecTest{
Name: "invalid identifier",
RunInstanceData: []*tests.RunInstanceData{
{
InputValue: []byte{1, 2, 3, 4},
InputMessages: []*qbft.SignedMessage{
testingutils.SignQBFTMsg(ks.Shares[1], 1, &qbft.Message{
MsgType: qbft.ProposalMsgType,
Height: qbft.FirstHeight,
Round: qbft.FirstRound,
Identifier: identifier[:],
Root: testingutils.TestingQBFTRootData,
}),
},
ExpectedDecidedState: tests.DecidedState{
DecidedVal: nil,
},
ControllerPostRoot: "47713c38fe74ce55959980781287886c603c2117a14dc8abce24dcb9be0093af",
},
},
ExpectedError: "invalid msg: message doesn't belong to Identifier",
}
}