testing

package
v0.3.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: GPL-3.0 Imports: 11 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 CommitDataToBytes added in v0.3.0

func CommitDataToBytes(t *testing.T, input *specqbft.CommitData) []byte

CommitDataToBytes encode commit data and handle error if exist

func CreateMultipleSignedMessages

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

CreateMultipleSignedMessages enables to create multiple decided messages

func GenerateBLSKeys

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

GenerateBLSKeys generates randomly nodes

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 NewInMemDb

func NewInMemDb() basedb.IDb

NewInMemDb returns basedb.IDb with in-memory type

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