-
Notifications
You must be signed in to change notification settings - Fork 22
/
wrong_sig.go
27 lines (25 loc) · 956 Bytes
/
wrong_sig.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
package decided
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"
)
// WrongSignature tests a single decided received with a wrong signature
func WrongSignature() tests.SpecTest {
ks := testingutils.Testing4SharesSet()
return &tests.ControllerSpecTest{
Name: "decide wrong sig",
RunInstanceData: []*tests.RunInstanceData{
{
InputValue: []byte{1, 2, 3, 4},
InputMessages: []*qbft.SignedMessage{
testingutils.TestingCommitMultiSignerMessage([]*bls.SecretKey{ks.Shares[1], ks.Shares[2], ks.Shares[4]}, []types.OperatorID{1, 2, 3}),
},
ControllerPostRoot: "47713c38fe74ce55959980781287886c603c2117a14dc8abce24dcb9be0093af",
},
},
ExpectedError: "invalid decided msg: invalid decided msg: msg signature invalid: failed to verify signature",
}
}