testing

package
v0.2.1-rc.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 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[message.OperatorID]*bls.SecretKey, consensusMessage *message.ConsensusMessage) *message.SignedMessage

AggregateInvalidSign sign message.ConsensusMessage and then change the signer id to mock invalid sig

func AggregateSign

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

AggregateSign sign message.ConsensusMessage and then aggregate

func CreateMultipleSignedMessages

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

CreateMultipleSignedMessages enables to create multiple decided messages

func GenerateBLSKeys

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

GenerateBLSKeys generates randomly nodes

func MultiSignMsg

MultiSignMsg signs a msg with multiple signers

func NewInMemDb

func NewInMemDb() basedb.IDb

NewInMemDb returns basedb.IDb with in-memory type

func PopulatedStorage

func PopulatedStorage(t *testing.T, sks map[message.OperatorID]*bls.SecretKey, round message.Round, highestHeight message.Height) qbftstorage.QBFTStore

PopulatedStorage create new QBFTStore instance, save the highest height and then populated from 0 to highestHeight

func SignMsg

SignMsg handle MultiSignMsg error and return just message.SignedMessage

Types

type MsgGenerator

type MsgGenerator func(height message.Height) ([]message.OperatorID, *message.ConsensusMessage)

MsgGenerator represents a message generator

Jump to

Keyboard shortcuts

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