forked from ssvlabs/ssv-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multi_signer.go
34 lines (30 loc) · 1.24 KB
/
multi_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/MatheusFranco99/ssv-spec-AleaBFT/qbft"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/qbft/spectest/tests"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/types"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/types/testingutils"
"github.com/herumi/bls-eth-go-binary/bls"
)
// MultiSigner tests a round change msg with multiple signers
func MultiSigner() *tests.MsgProcessingSpecTest {
pre := testingutils.BaseInstance()
pre.State.Round = 2
msgs := []*qbft.SignedMessage{
testingutils.MultiSignQBFTMsg([]*bls.SecretKey{testingutils.Testing4SharesSet().Shares[1], testingutils.Testing4SharesSet().Shares[2]}, []types.OperatorID{types.OperatorID(1), types.OperatorID(2)}, &qbft.Message{
MsgType: qbft.RoundChangeMsgType,
Height: qbft.FirstHeight,
Round: 2,
Identifier: []byte{1, 2, 3, 4},
Data: testingutils.RoundChangeDataBytes(nil, qbft.NoRound),
}),
}
return &tests.MsgProcessingSpecTest{
Name: "round change multi signers",
Pre: pre,
PostRoot: "f807a3d5343ca20e3b757fa63eae9b9dd70e09e03249048badebf54e62290103",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{},
ExpectedError: "invalid signed message: msg allows 1 signer",
}
}