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 ¶
- func TestActionStoreCompliance(t *testing.T, f ActionStoreFactory, fxf FixtureFactory)
- func TestCommittedHeaderStoreCompliance(t *testing.T, f CommittedHeaderStoreFactory, fxf FixtureFactory)
- func TestFinalizationStoreCompliance(t *testing.T, f FinalizationStoreFactory, fxf FixtureFactory)
- func TestMirrorStoreCompliance(t *testing.T, f MirrorStoreFactory)
- func TestMultiStoreCompliance[S any](t *testing.T, f MultiStoreFactory[S], fxf FixtureFactory)
- func TestRoundStoreCompliance(t *testing.T, f RoundStoreFactory, fxf FixtureFactory)
- func TestStateMachineStoreCompliance(t *testing.T, f StateMachineStoreFactory)
- func TestValidatorStoreCompliance(t *testing.T, f ValidatorStoreFactory, fxf FixtureFactory)
- type ActionStoreFactory
- type CommittedHeaderStoreFactory
- type FinalizationStoreFactory
- type FixtureFactory
- type MirrorStoreFactory
- type MultiStoreFactory
- type RoundStoreFactory
- type StateMachineStoreFactory
- type ValidatorStoreFactory
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 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)