-
Notifications
You must be signed in to change notification settings - Fork 21
/
justification_multi_signers.go
38 lines (34 loc) · 1.33 KB
/
justification_multi_signers.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
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"
"github.com/herumi/bls-eth-go-binary/bls"
)
// JustificationMultiSigners tests a single prepare justification msg with multiple signers
func JustificationMultiSigners() tests.SpecTest {
pre := testingutils.BaseInstance()
pre.State.Round = 2
ks := testingutils.Testing4SharesSet()
prepareMsgs := []*qbft.SignedMessage{
testingutils.TestingPrepareMessage(ks.Shares[1], types.OperatorID(1)),
testingutils.TestingPrepareMessage(ks.Shares[2], types.OperatorID(2)),
testingutils.TestingPrepareMultiSignerMessage(
[]*bls.SecretKey{ks.Shares[2], ks.Shares[3]},
[]types.OperatorID{2, 3},
),
}
msgs := []*qbft.SignedMessage{
testingutils.TestingRoundChangeMessageWithRoundAndRC(ks.Shares[1], types.OperatorID(1), 2,
testingutils.MarshalJustifications(prepareMsgs)),
}
return &tests.MsgProcessingSpecTest{
Name: "justification multi signer",
Pre: pre,
PostRoot: "96e6d7bdbb98a2d9937f3d97d6aa096bd3a58f923b61012048ac70ad52765919",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{},
ExpectedError: "invalid signed message: round change justification invalid: msg allows 1 signer",
}
}