testing

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: GPL-3.0 Imports: 14 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 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