Documentation ¶
Overview ¶
Package tmintegration defines integration tests around consensus engines, using user-specified network and store definitions.
Index ¶
- func RunIntegrationTest(t *testing.T, nf NewFactoryFunc)
- type Env
- type Factory
- type InmemSchemeFactory
- func (f InmemSchemeFactory) CommonMessageSignatureProofScheme(ctx context.Context, idx int) (gcrypto.CommonMessageSignatureProofScheme, error)
- func (f InmemSchemeFactory) HashScheme(ctx context.Context, idx int) (tmconsensus.HashScheme, error)
- func (f InmemSchemeFactory) SignatureScheme(ctx context.Context, idx int) (tmconsensus.SignatureScheme, error)
- type InmemStoreFactory
- func (f InmemStoreFactory) NewActionStore(ctx context.Context, idx int) (tmstore.ActionStore, error)
- func (f InmemStoreFactory) NewCommittedHeaderStore(ctx context.Context, idx int) (tmstore.CommittedHeaderStore, error)
- func (f InmemStoreFactory) NewFinalizationStore(ctx context.Context, idx int) (tmstore.FinalizationStore, error)
- func (f InmemStoreFactory) NewMirrorStore(ctx context.Context, idx int) (tmstore.MirrorStore, error)
- func (f InmemStoreFactory) NewRoundStore(ctx context.Context, idx int) (tmstore.RoundStore, error)
- func (f InmemStoreFactory) NewStateMachineStore(ctx context.Context, idx int) (tmstore.StateMachineStore, error)
- func (f InmemStoreFactory) NewValidatorStore(ctx context.Context, idx int, hs tmconsensus.HashScheme) (tmstore.ValidatorStore, error)
- type NewFactoryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunIntegrationTest ¶
func RunIntegrationTest(t *testing.T, nf NewFactoryFunc)
Types ¶
type Env ¶
type Env struct { // The RootLogger can be reference when the Factory // needs a logger in a created value. RootLogger *slog.Logger // contains filtered or unexported fields }
Env contains some of the primitives of the current test environment, to inform the creation of a Factory.
type Factory ¶
type Factory interface { // NewNetwork will be called only once per test. // The implementer may assume that the context will be canceled // at or before the test's completion. NewNetwork(context.Context, *slog.Logger) (tmp2ptest.Network, error) NewActionStore(context.Context, int) (tmstore.ActionStore, error) NewCommittedHeaderStore(context.Context, int) (tmstore.CommittedHeaderStore, error) NewFinalizationStore(context.Context, int) (tmstore.FinalizationStore, error) NewMirrorStore(context.Context, int) (tmstore.MirrorStore, error) NewRoundStore(context.Context, int) (tmstore.RoundStore, error) NewStateMachineStore(context.Context, int) (tmstore.StateMachineStore, error) NewValidatorStore(context.Context, int, tmconsensus.HashScheme) (tmstore.ValidatorStore, error) HashScheme(context.Context, int) (tmconsensus.HashScheme, error) SignatureScheme(context.Context, int) (tmconsensus.SignatureScheme, error) CommonMessageSignatureProofScheme(context.Context, int) (gcrypto.CommonMessageSignatureProofScheme, error) NewGossipStrategy(context.Context, int, tmp2p.Connection) (tmgossip.Strategy, error) }
type InmemSchemeFactory ¶
type InmemSchemeFactory struct{}
func (InmemSchemeFactory) CommonMessageSignatureProofScheme ¶
func (f InmemSchemeFactory) CommonMessageSignatureProofScheme(ctx context.Context, idx int) (gcrypto.CommonMessageSignatureProofScheme, error)
func (InmemSchemeFactory) HashScheme ¶
func (f InmemSchemeFactory) HashScheme(ctx context.Context, idx int) (tmconsensus.HashScheme, error)
func (InmemSchemeFactory) SignatureScheme ¶
func (f InmemSchemeFactory) SignatureScheme(ctx context.Context, idx int) (tmconsensus.SignatureScheme, error)
type InmemStoreFactory ¶
type InmemStoreFactory struct{}
InmemStoreFactory is meant to be embedded in another tmintegration.Factory to provide in-memory implementations of stores.
func (InmemStoreFactory) NewActionStore ¶
func (f InmemStoreFactory) NewActionStore(ctx context.Context, idx int) (tmstore.ActionStore, error)
func (InmemStoreFactory) NewCommittedHeaderStore ¶
func (f InmemStoreFactory) NewCommittedHeaderStore(ctx context.Context, idx int) (tmstore.CommittedHeaderStore, error)
func (InmemStoreFactory) NewFinalizationStore ¶
func (f InmemStoreFactory) NewFinalizationStore(ctx context.Context, idx int) (tmstore.FinalizationStore, error)
func (InmemStoreFactory) NewMirrorStore ¶
func (f InmemStoreFactory) NewMirrorStore(ctx context.Context, idx int) (tmstore.MirrorStore, error)
func (InmemStoreFactory) NewRoundStore ¶
func (f InmemStoreFactory) NewRoundStore(ctx context.Context, idx int) (tmstore.RoundStore, error)
func (InmemStoreFactory) NewStateMachineStore ¶
func (f InmemStoreFactory) NewStateMachineStore(ctx context.Context, idx int) (tmstore.StateMachineStore, error)
func (InmemStoreFactory) NewValidatorStore ¶
func (f InmemStoreFactory) NewValidatorStore(ctx context.Context, idx int, hs tmconsensus.HashScheme) (tmstore.ValidatorStore, error)
type NewFactoryFunc ¶
Click to show internal directories.
Click to hide internal directories.