forked from ssvlabs/ssv-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrong_sig.go
31 lines (28 loc) · 1.13 KB
/
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
28
29
30
31
package vcbcrequest
import (
"github.com/MatheusFranco99/ssv-spec-AleaBFT/alea"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/alea/spectest/tests"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/types"
"github.com/MatheusFranco99/ssv-spec-AleaBFT/types/testingutils"
)
// WrongSignature tests a single proposal received with a wrong signature
func WrongSignature() *tests.MsgProcessingSpecTest {
pre := testingutils.BaseInstanceAlea()
msgs := []*alea.SignedMessage{
testingutils.SignAleaMsg(testingutils.Testing4SharesSet().Shares[2], types.OperatorID(1), &alea.Message{
MsgType: alea.VCBCRequestMsgType,
Height: alea.FirstHeight,
Round: alea.FirstRound,
Identifier: []byte{1, 2, 3, 4},
Data: testingutils.VCBCRequestDataBytes(alea.FirstPriority, types.OperatorID(1)),
}),
}
return &tests.MsgProcessingSpecTest{
Name: "vcbcrequest wrong proposal sig",
Pre: pre,
PostRoot: "d0669999d2f4f17dd4888e9602362eb73a7c961e8090c5e5ea2e5e6d5608e9cd",
InputMessages: msgs,
ExpectedError: "invalid signed message: msg signature invalid: failed to verify signature",
DontRunAC: true,
}
}