testing

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateInvalidSign

func AggregateInvalidSign(t *testing.T, sks map[spectypes.OperatorID]*bls.SecretKey, consensusMessage *specqbft.Message) *specqbft.SignedMessage

AggregateInvalidSign sign specqbft.Message and then change the signer id to mock invalid sig

func AggregateSign

func AggregateSign(t *testing.T, sks map[spectypes.OperatorID]*bls.SecretKey, signers []spectypes.OperatorID, consensusMessage *specqbft.Message) *specqbft.SignedMessage

AggregateSign sign specqbft.Message and then aggregate

func CreateMultipleStoredInstances

func CreateMultipleStoredInstances(
	sks map[spectypes.OperatorID]*bls.SecretKey,
	start specqbft.Height,
	end specqbft.Height,
	generator MsgGenerator,
) ([]*qbftstorage.StoredInstance, error)

CreateMultipleStoredInstances enables to create multiple stored instances (with decided messages).

func GenerateBLSKeys

func GenerateBLSKeys(oids ...spectypes.OperatorID) (map[spectypes.OperatorID]*bls.SecretKey, []*spectypes.Operator)

GenerateBLSKeys generates randomly nodes

func GetModulePath

func GetModulePath(name, version string) (string, error)

func GetSpecDir added in v1.1.0

func GetSpecDir(path, module string) (string, error)

GetSpecDir returns the path to the ssv-spec module.

func GetSpecTestJSON

func GetSpecTestJSON(path string, module string) ([]byte, error)

func MultiSignMsg

func MultiSignMsg(sks map[spectypes.OperatorID]*bls.SecretKey, signers []spectypes.OperatorID, msg *specqbft.Message) (*specqbft.SignedMessage, error)

MultiSignMsg signs a msg with multiple signers

func SignMsg

SignMsg handle MultiSignMsg error and return just specqbft.SignedMessage

Types

type MsgGenerator

type MsgGenerator func(height specqbft.Height) ([]spectypes.OperatorID, *specqbft.Message)

MsgGenerator represents a message generator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL