qbft

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandling

func ErrorHandling(t *testing.T, expectedError string, lastErr error)

ErrorHandling by spec with error mapping

func GetControllerRoot

func GetControllerRoot(t *testing.T, c *controller.Controller, storedInstances []instance.Instancer) ([]byte, error)

GetControllerRoot return controller root by spec

func MapToSpecInstance

func MapToSpecInstance(t *testing.T, identifier []byte, qbftInstance instance.Instancer, instanceShare *beacon.Share) *qbft2.Instance

MapToSpecInstance mapping instance to spec instance struct

func NewController

func NewController(ctx context.Context, t *testing.T, logger *zap.Logger, identifier types.MessageID, s qbftstorage.QBFTStore, share *beacon.Share, net protcolp2p.MockNetwork, beacon *validator.TestBeacon, version forksprotocol.ForkVersion) *controller.Controller

NewController returns new qbft controller

func NewQBFTStorage

func NewQBFTStorage(ctx context.Context, t *testing.T, logger *zap.Logger, role string) (basedb.IDb, qbftstorage.QBFTStore)

NewQBFTStorage returns qbft storage and db

func NewQbftInstance

func NewQbftInstance(logger *zap.Logger, qbftStorage qbftstorage.QBFTStore, net protcolp2p.MockNetwork, beacon *validator.TestBeacon, share *beacon.Share, identifier []byte, forkVersion forksprotocol.ForkVersion) instance.Instancer

NewQbftInstance returns new qbft instance

func RunControllerSpecTest

func RunControllerSpecTest(t *testing.T, test *spectests.ControllerSpecTest)

RunControllerSpecTest runs spec test type ControllerSpecTest

func RunCreateMessageSpecTest

func RunCreateMessageSpecTest(t *testing.T, test *spectests.CreateMsgSpecTest)

RunCreateMessageSpecTest runs spec test type CreateMsgSpecTest

func RunMsgProcessingSpecTest

func RunMsgProcessingSpecTest(t *testing.T, test *spectests.MsgProcessingSpecTest)

RunMsgProcessingSpecTest for spec test type MsgProcessingSpecTest

func RunMsgSpecTest

func RunMsgSpecTest(t *testing.T, test *spectests.MsgSpecTest)

RunMsgSpecTest runs spec test type MsgSpecTest

func ToMappedShare

func ToMappedShare(t *testing.T, share *types.Share) (*beacon.Share, *testingutils.TestKeySet)

ToMappedShare convert spec share to ssv share

Types

type BroadcastMessagesGetter

type BroadcastMessagesGetter interface {
	GetBroadcastMessages() []types.SSVMessage
	CalledDecidedSyncCnt() int
	SetCalledDecidedSyncCnt(int) // temp solution to pass spec test
}

BroadcastMessagesGetter interface to support spec tests

Jump to

Keyboard shortcuts

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