-
Notifications
You must be signed in to change notification settings - Fork 21
/
happy_flow.go
35 lines (30 loc) · 1.11 KB
/
happy_flow.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
package commit
import (
"github.com/bloxapp/ssv-spec/qbft"
"github.com/bloxapp/ssv-spec/qbft/spectest/tests"
"github.com/bloxapp/ssv-spec/types/testingutils"
)
// HappyFlow tests a quorum of commits received after prepare quorum
func HappyFlow() tests.SpecTest {
pre := testingutils.BaseInstance()
ks := testingutils.Testing4SharesSet()
msgs := []*qbft.SignedMessage{
testingutils.TestingProposalMessage(ks.Shares[1], 1),
testingutils.TestingPrepareMessage(ks.Shares[1], 1),
testingutils.TestingPrepareMessage(ks.Shares[2], 2),
testingutils.TestingPrepareMessage(ks.Shares[3], 3),
testingutils.TestingCommitMessage(ks.Shares[1], 1),
testingutils.TestingCommitMessage(ks.Shares[2], 2),
testingutils.TestingCommitMessage(ks.Shares[3], 3),
}
return &tests.MsgProcessingSpecTest{
Name: "commit happy flow",
Pre: pre,
PostRoot: "0435531b93a3c21862b48c2d18fb85e7ab7539f738fb15ced288ce15b6193974",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{
testingutils.TestingPrepareMessage(ks.Shares[1], 1),
testingutils.TestingCommitMessage(ks.Shares[1], 1),
},
}
}