-
Notifications
You must be signed in to change notification settings - Fork 21
/
old_round.go
36 lines (31 loc) · 1.29 KB
/
old_round.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
package prepare
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"
)
// OldRound tests prepare for signedProposal.Message.Round < state.Round
func OldRound() tests.SpecTest {
ks := testingutils.Testing4SharesSet()
pre := testingutils.BaseInstance()
pre.State.Round = 10
rcMsgs := []*qbft.SignedMessage{
testingutils.TestingRoundChangeMessageWithRound(ks.Shares[1], types.OperatorID(1), 10),
testingutils.TestingRoundChangeMessageWithRound(ks.Shares[2], types.OperatorID(2), 10),
testingutils.TestingRoundChangeMessageWithRound(ks.Shares[3], types.OperatorID(3), 10),
}
pre.State.ProposalAcceptedForCurrentRound = testingutils.TestingProposalMessageWithParams(
ks.Shares[1], types.OperatorID(1), 10, qbft.FirstHeight, testingutils.TestingQBFTRootData,
testingutils.MarshalJustifications(rcMsgs), nil)
msgs := []*qbft.SignedMessage{
testingutils.TestingPrepareMessageWithRound(ks.Shares[1], 1, 9),
}
return &tests.MsgProcessingSpecTest{
Name: "prepare prev round",
Pre: pre,
PostRoot: "aeb7b4349c38d35cf5a16d25ca6019282e1ff24e3b230ed92463bddd55f6059f",
InputMessages: msgs,
ExpectedError: "invalid signed message: past round",
}
}