Documentation
¶
Index ¶
- func RequireGenericNodesDoneBefore(t testing.TB, duration time.Duration, nodes ...*GenericNode)
- type CollectionNode
- type ConsensusNode
- type ExecutionNode
- func (en ExecutionNode) AssertBlockIsExecuted(t *testing.T, header *flow.Header)
- func (en ExecutionNode) AssertBlockNotExecuted(t *testing.T, header *flow.Header)
- func (en ExecutionNode) AssertHighestExecutedBlock(t *testing.T, header *flow.Header)
- func (en ExecutionNode) Done(cancelFunc context.CancelFunc)
- func (en ExecutionNode) Ready(t *testing.T, ctx context.Context)
- type GenericNode
- type StateFixture
- type VerificationNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireGenericNodesDoneBefore ¶ added in v0.17.0
func RequireGenericNodesDoneBefore(t testing.TB, duration time.Duration, nodes ...*GenericNode)
RequireGenericNodesDoneBefore invokes the done method of all input generic nodes concurrently, and fails the test if any generic node's shutdown takes longer than the specified duration.
Types ¶
type CollectionNode ¶
type CollectionNode struct { GenericNode Collections storage.Collections Transactions storage.Transactions ClusterPayloads storage.ClusterPayloads TxPools *epochpool.TransactionPools Voter module.ClusterRootQCVoter IngestionEngine *collectioningest.Engine PusherEngine *pusher.Engine ProviderEngine *provider.Engine EpochManagerEngine *epochmgr.Engine }
CollectionNode implements an in-process collection node for tests.
func (CollectionNode) Done ¶ added in v0.20.0
func (n CollectionNode) Done() <-chan struct{}
func (CollectionNode) Ready ¶ added in v0.20.0
func (n CollectionNode) Ready() <-chan struct{}
func (CollectionNode) Start ¶ added in v0.29.0
func (n CollectionNode) Start(t *testing.T)
type ConsensusNode ¶
type ConsensusNode struct { GenericNode Guarantees mempool.Guarantees Receipts mempool.ExecutionTree Seals mempool.IncorporatedResultSeals IngestionEngine *consensusingest.Engine SealingEngine *sealing.Engine MatchingEngine *matching.Engine }
ConsensusNode implements an in-process consensus node for tests.
func (ConsensusNode) Done ¶ added in v0.10.0
func (cn ConsensusNode) Done() <-chan struct{}
func (ConsensusNode) Ready ¶ added in v0.10.0
func (cn ConsensusNode) Ready() <-chan struct{}
func (ConsensusNode) Start ¶ added in v0.39.0
func (cn ConsensusNode) Start(t *testing.T)
type ExecutionNode ¶
type ExecutionNode struct { GenericNode FollowerState protocol.FollowerState IngestionEngine *executionIngest.Core ExecutionEngine *computation.Manager RequestEngine *requester.Engine ReceiptsEngine *executionprovider.Engine FollowerCore module.HotStuffFollower FollowerEngine *followereng.ComplianceEngine SyncEngine *synchronization.Engine Compactor *complete.Compactor ProtocolDB storage.DB VM fvm.VM ExecutionState state.ExecutionState Ledger ledger.Ledger LevelDbDir string Collections storage.Collections Finalizer *consensus.Finalizer MyExecutionReceipts storage.MyExecutionReceipts StorehouseEnabled bool }
ExecutionNode implements a mocked execution node for tests.
func (ExecutionNode) AssertBlockIsExecuted ¶ added in v0.33.1
func (en ExecutionNode) AssertBlockIsExecuted(t *testing.T, header *flow.Header)
func (ExecutionNode) AssertBlockNotExecuted ¶ added in v0.33.1
func (en ExecutionNode) AssertBlockNotExecuted(t *testing.T, header *flow.Header)
func (ExecutionNode) AssertHighestExecutedBlock ¶
func (en ExecutionNode) AssertHighestExecutedBlock(t *testing.T, header *flow.Header)
func (ExecutionNode) Done ¶
func (en ExecutionNode) Done(cancelFunc context.CancelFunc)
type GenericNode ¶
type GenericNode struct { // context and cancel function used to start/stop components Ctx irrecoverable.SignalerContext Cancel context.CancelFunc Errs <-chan error Log zerolog.Logger Metrics *metrics.NoopCollector Tracer module.Tracer PublicDB storage.DB SecretsDB *badger.DB LockManager lockctx.Manager Headers storage.Headers Guarantees storage.Guarantees Seals storage.Seals Payloads storage.Payloads Blocks storage.Blocks QuorumCertificates storage.QuorumCertificates Results storage.ExecutionResults Setups storage.EpochSetups EpochCommits storage.EpochCommits EpochProtocolState storage.EpochProtocolStateEntries ProtocolKVStore storage.ProtocolKVStore State protocol.ParticipantState Index storage.Index Me module.Local Net *stub.Network DBDir string ChainID flow.ChainID ProtocolEvents *events.Distributor }
GenericNode implements a generic in-process node for tests.
func (*GenericNode) CloseDB ¶
func (g *GenericNode) CloseDB() error
CloseDB closes the badger database of the node
func (*GenericNode) Done ¶
func (g *GenericNode) Done()
type StateFixture ¶ added in v0.14.0
type StateFixture struct { DBDir string PublicDB storage.DB SecretsDB *badger.DB Storage *store.All ProtocolEvents *events.Distributor State protocol.ParticipantState LockManager lockctx.Manager }
StateFixture is a test helper struct that encapsulates a flow protocol state as well as all of its backend dependencies.
type VerificationNode ¶
type VerificationNode struct { *GenericNode ChunkStatuses mempool.ChunkStatuses ChunkRequests mempool.ChunkRequests Results storage.ExecutionResults Receipts storage.ExecutionReceipts // chunk consumer and processor for fetcher engine ProcessedChunkIndex storage.ConsumerProgressInitializer ChunksQueue storage.ChunksQueue ChunkConsumer *chunkconsumer.ChunkConsumer // block consumer for chunk consumer ProcessedBlockHeight storage.ConsumerProgressInitializer BlockConsumer *blockconsumer.BlockConsumer VerifierEngine *verifier.Engine AssignerEngine *assigner.Engine FetcherEngine *fetcher.Engine RequesterEngine *verificationrequester.Engine }
VerificationNode implements an in-process verification node for tests.