-
Notifications
You must be signed in to change notification settings - Fork 21
/
multi_signer_no_overlap.go
37 lines (32 loc) · 1.31 KB
/
multi_signer_no_overlap.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
package commit
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"
)
// MultiSignerNoOverlap tests a multi signer commit msg which doesn't overlap previous valid commits
func MultiSignerNoOverlap() 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.TestingCommitMultiSignerMessage([]*bls.SecretKey{ks.Shares[2], ks.Shares[3]}, []types.OperatorID{2, 3}),
}
return &tests.MsgProcessingSpecTest{
Name: "multi signer, no overlap",
Pre: pre,
PostRoot: "c72a82fa102b581273a5ba16dbadddee88fb850649fe7fb510986f126a07a04d",
InputMessages: msgs,
OutputMessages: []*qbft.SignedMessage{
testingutils.TestingPrepareMessage(ks.Shares[1], 1),
testingutils.TestingCommitMessage(ks.Shares[1], 1),
},
ExpectedError: "invalid signed message: msg allows 1 signer",
}
}