forked from ssvlabs/ssv-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
future_instance.go
41 lines (39 loc) · 1.5 KB
/
future_instance.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
39
40
41
package decided
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"
)
// FutureInstance tests decided msg received for future (not yet started) instance
func FutureInstance() *tests.ControllerSpecTest {
identifier := types.NewMsgID(testingutils.TestingValidatorPubKey[:], types.BNRoleAttester)
return &tests.ControllerSpecTest{
Name: "decide future instance",
RunInstanceData: []*tests.RunInstanceData{
{
InputValue: []byte{1, 2, 3, 4},
InputMessages: []*qbft.SignedMessage{
testingutils.MultiSignQBFTMsg(
[]*bls.SecretKey{testingutils.Testing4SharesSet().Shares[1], testingutils.Testing4SharesSet().Shares[2], testingutils.Testing4SharesSet().Shares[3]},
[]types.OperatorID{1, 2, 3},
&qbft.Message{
MsgType: qbft.CommitMsgType,
Height: 10,
Round: qbft.FirstRound,
Identifier: identifier[:],
Data: testingutils.CommitDataBytes([]byte{1, 2, 3, 4}),
}),
},
ExpectedDecidedState: tests.DecidedState{
DecidedCnt: 1,
DecidedVal: []byte{1, 2, 3, 4},
CalledSyncDecidedByRange: true,
DecidedByRangeValues: [2]qbft.Height{0, 10},
},
ControllerPostRoot: "6ec856c53c4febbeeb0d816b81a04425f5a7bdf107c7cf3d28a519c3fee6ce6e",
},
},
}
}