tmstoretest

package
v0.0.0-...-434d902 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tmstoretest contains the compliance tests for implementations of the tmstore interfaces.

Refer to github.com/gordian-engine/gordian/tm/tmmemstore for examples of calling the compliance tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestActionStoreCompliance

func TestActionStoreCompliance(t *testing.T, f ActionStoreFactory, fxf FixtureFactory)

func TestCommittedHeaderStoreCompliance

func TestCommittedHeaderStoreCompliance(t *testing.T, f CommittedHeaderStoreFactory, fxf FixtureFactory)

func TestFinalizationStoreCompliance

func TestFinalizationStoreCompliance(t *testing.T, f FinalizationStoreFactory, fxf FixtureFactory)

func TestMirrorStoreCompliance

func TestMirrorStoreCompliance(t *testing.T, f MirrorStoreFactory)

TestMirrorStoreCompliance does not require a FixtureFactory because there is no representation of validators or signatures in the mirror store.

func TestMultiStoreCompliance

func TestMultiStoreCompliance[S any](
	t *testing.T,
	f MultiStoreFactory[S],
	fxf FixtureFactory,
)

TestMultiStoreCompliance validates inter-store behavior, when a single type satisfies multiple store interfaces.

Most of these tests are covering actual discovered bugs with real store implementations.

func TestRoundStoreCompliance

func TestRoundStoreCompliance(t *testing.T, f RoundStoreFactory, fxf FixtureFactory)

func TestStateMachineStoreCompliance

func TestStateMachineStoreCompliance(t *testing.T, f StateMachineStoreFactory)

func TestValidatorStoreCompliance

func TestValidatorStoreCompliance(t *testing.T, f ValidatorStoreFactory, fxf FixtureFactory)

Types

type ActionStoreFactory

type ActionStoreFactory func(cleanup func(func())) (tmstore.ActionStore, error)

type CommittedHeaderStoreFactory

type CommittedHeaderStoreFactory func(cleanup func(func())) (tmstore.CommittedHeaderStore, error)

type FinalizationStoreFactory

type FinalizationStoreFactory func(cleanup func(func())) (tmstore.FinalizationStore, error)

type FixtureFactory

type FixtureFactory func(nVals int) *tmconsensustest.Fixture

FixtureFactory is used in every store compliance test, to produce validators and signatures.

tmconsensustest.NewEd25519Fixture should be used by default in the core Gordian code, but having this as part of compliance test signatures makes it possible to assert that various store types are compatible with other key schemes.

type MirrorStoreFactory

type MirrorStoreFactory func(cleanup func(func())) (tmstore.MirrorStore, error)

type MultiStoreFactory

type MultiStoreFactory[S any] func(cleanup func(func())) (S, error)

type RoundStoreFactory

type RoundStoreFactory func(cleanup func(func())) (tmstore.RoundStore, error)

type StateMachineStoreFactory

type StateMachineStoreFactory func(ctx context.Context, cleanup func(func())) (tmstore.StateMachineStore, error)

type ValidatorStoreFactory

type ValidatorStoreFactory func(cleanup func(func())) (tmstore.ValidatorStore, error)

Jump to

Keyboard shortcuts

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