-
Notifications
You must be signed in to change notification settings - Fork 20
/
root.go
33 lines (29 loc) · 929 Bytes
/
root.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
package messages
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"
)
// GetRoot tests GetRoot on SignedMessage
func GetRoot() tests.SpecTest {
ks := testingutils.Testing4SharesSet()
msg := testingutils.TestingProposalMessageWithParams(
ks.Shares[1], types.OperatorID(1), qbft.FirstRound, qbft.FirstHeight, testingutils.TestingQBFTRootData,
testingutils.MarshalJustifications([]*qbft.SignedMessage{
testingutils.TestingPrepareMessage(ks.Shares[1], types.OperatorID(1)),
}),
testingutils.MarshalJustifications([]*qbft.SignedMessage{
testingutils.TestingRoundChangeMessage(ks.Shares[1], types.OperatorID(1)),
}))
r, _ := msg.GetRoot()
return &tests.MsgSpecTest{
Name: "get root",
Messages: []*qbft.SignedMessage{
msg,
},
ExpectedRoots: [][32]byte{
r,
},
}
}