-
Notifications
You must be signed in to change notification settings - Fork 21
/
f1_duplicate_signer.go
34 lines (29 loc) · 1.17 KB
/
f1_duplicate_signer.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
package roundchange
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"
)
// F1DuplicateSigner tests not accepting f+1 speed for duplicate signer
func F1DuplicateSigner() tests.SpecTest {
pre := testingutils.BaseInstance()
ks := testingutils.Testing4SharesSet()
prepareMsgs := []*qbft.SignedMessage{
testingutils.TestingPrepareMessage(ks.Shares[1], types.OperatorID(1)),
testingutils.TestingPrepareMessage(ks.Shares[2], types.OperatorID(2)),
testingutils.TestingPrepareMessage(ks.Shares[3], types.OperatorID(3)),
}
msgs := []*qbft.SignedMessage{
testingutils.TestingRoundChangeMessageWithRound(ks.Shares[1], types.OperatorID(1), 2),
testingutils.TestingRoundChangeMessageWithRoundAndRC(ks.Shares[1], types.OperatorID(1), 10,
testingutils.MarshalJustifications(prepareMsgs)),
}
return &tests.MsgProcessingSpecTest{
Name: "round change f+1 duplicate",
Pre: pre,
PostRoot: "8ac2f8fb8167804d66a6919d46438ff66a5b69e45ff2330f7c96789e0e30ef67",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{},
}
}