comparable

package
v0.0.0-...-0b52aac Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareWithJson

func CompareWithJson(t *testing.T, test any, testName string, testType string)

CompareWithJson compares the given test with the expected state from the state comparison folder

func FixIssue178

func FixIssue178(input *types.ConsensusData, version spec2.DataVersion) *types.ConsensusData

FixIssue178 fixes consensus data fields which are nil instead of empty slice If we change the fields in ssv_msgs.go it will break a lot of roots, we're slowly fixing them SHOULD BE REMOVED once all tests are fixes see https://github.com/ssvlabs/ssv-spec-pre-cc/issues/178

func GetExpectedStateFromScFile

func GetExpectedStateFromScFile(testName string, testType string) (map[string]interface{}, error)

func GetSCDir

func GetSCDir(basedir string, testType string) string

GetSCDir returns the path to the state comparison folder for the given test type

func InitContainers

func InitContainers(instance *qbft.Instance)

InitContainers initializes empty containers for Propose, Prepare, Commit and RoundChange messages

func NoErrorEncoding

func NoErrorEncoding(obj ssz.Marshaler) []byte

func PrintDiff

func PrintDiff(source, target interface{}) string

func SetMessages

func SetMessages(instance *qbft.Instance, messages []*types.SSVMessage)

func SetSignedMessages

func SetSignedMessages(instance *qbft.Instance, messages []*qbft.SignedMessage)

func UnmarshalStateComparison

func UnmarshalStateComparison[T types.Root](basedir string, testName string, testType string, targetState T) (T,
	error)

UnmarshalStateComparison reads a json derived from 'testName' and unmarshals it into 'targetState'

Types

type StateComparison

type StateComparison struct {
	ExpectedState types.Root
}

func (*StateComparison) Root

func (stateComp *StateComparison) Root() string

Root returns all runner roots as string

Jump to

Keyboard shortcuts

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