spectesting

package
Version: v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeRoundMsg

func ChangeRoundMsg(t *testing.T, sk *bls.SecretKey, lambda []byte, round, id uint64) *proto.SignedMessage

ChangeRoundMsg constructs and signs a change round msg

func ChangeRoundMsgWithPrepared

func ChangeRoundMsgWithPrepared(t *testing.T, sk *bls.SecretKey, lambda, preparedValue []byte, signers map[uint64]*bls.SecretKey, round, preparedRound, id uint64) *proto.SignedMessage

ChangeRoundMsgWithPrepared constructs and signs a change round msg

func CommitMsg

func CommitMsg(t *testing.T, sk *bls.SecretKey, lambda, inputValue []byte, round, id uint64) *proto.SignedMessage

CommitMsg constructs and signs a commit msg

func InvalidTestInputValue

func InvalidTestInputValue() []byte

InvalidTestInputValue a const input invalid test value

func PrePrepareMsg

func PrePrepareMsg(t *testing.T, sk *bls.SecretKey, lambda, inputValue []byte, round, id uint64) *proto.SignedMessage

PrePrepareMsg constructs and signs a pre-prepare msg

func PrepareMsg

func PrepareMsg(t *testing.T, sk *bls.SecretKey, lambda, inputValue []byte, round, id uint64) *proto.SignedMessage

PrepareMsg constructs and signs a prepare msg

func RequireReturnedFalseNoError

func RequireReturnedFalseNoError(t *testing.T, f func() (bool, error))

RequireReturnedFalseNoError will call ProcessMessage and verifies it returns false and nil for execution

func RequireReturnedTrueNoError

func RequireReturnedTrueNoError(t *testing.T, f func() (bool, error))

RequireReturnedTrueNoError will call ProcessMessage and verifies it returns true and nil for execution

func RequireReturnedTrueWithError

func RequireReturnedTrueWithError(t *testing.T, f func() (bool, error), errStr string)

RequireReturnedTrueWithError will call ProcessMessage and verifies it returns true and error for execution

func SignMsg

func SignMsg(t *testing.T, id uint64, sk *bls.SecretKey, msg *proto.Message) *proto.SignedMessage

SignMsg signs the given message by the given private key

func SimulateTimeout

func SimulateTimeout(instance *ibft2.Instance, toRound uint64)

SimulateTimeout simulates instance timeout

func TestIBFTInstance

func TestIBFTInstance(t *testing.T, lambda []byte) *ibft2.Instance

TestIBFTInstance returns a test iBFT instance

func TestInputValue

func TestInputValue() []byte

TestInputValue a const input test value

func TestNodes

func TestNodes() map[uint64]*proto.Node

TestNodes generates test nodes for SSV

func TestPKs

func TestPKs() [][]byte

TestPKs PKS for TestSKs

func TestSKs

func TestSKs() []*bls.SecretKey

TestSKs returns reference test shares for SSV

func TestSharesAndSigner added in v0.1.4

func TestSharesAndSigner() (map[uint64]*storage.Share, beacon.KeyManager)

TestSharesAndSigner generates test nodes for SSV

func TestValidatorPK

func TestValidatorPK() *bls.PublicKey

TestValidatorPK returns ref validator pk

Types

This section is empty.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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