mock

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: AGPL-3.0 Imports: 36 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionNode

type CollectionNode struct {
	GenericNode
	Collections     storage.Collections
	Transactions    storage.Transactions
	IngestionEngine *collectioningest.Engine
	PusherEngine    *pusher.Engine
	ProviderEngine  *provider.Engine
}

CollectionNode implements an in-process collection node for tests.

type ComputerWrap added in v0.10.0

type ComputerWrap struct {
	*computation.Manager
	OnComputeBlock func(ctx context.Context, block *entity.ExecutableBlock, view *delta.View)
}

func (*ComputerWrap) ComputeBlock added in v0.10.0

func (c *ComputerWrap) ComputeBlock(
	ctx context.Context,
	block *entity.ExecutableBlock,
	view *delta.View,
) (*execution.ComputationResult, error)

type ConsensusNode

type ConsensusNode struct {
	GenericNode
	Guarantees      mempool.Guarantees
	Approvals       mempool.Approvals
	Receipts        mempool.ExecutionTree
	Seals           mempool.IncorporatedResultSeals
	IngestionEngine *consensusingest.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()

func (ConsensusNode) Ready added in v0.10.0

func (cn ConsensusNode) Ready()

type ExecutionNode

type ExecutionNode struct {
	GenericNode
	MutableState    protocol.MutableState
	IngestionEngine *ingestion.Engine
	ExecutionEngine *ComputerWrap
	RequestEngine   *requester.Engine
	ReceiptsEngine  *executionprovider.Engine
	FollowerEngine  *followereng.Engine
	SyncEngine      *synchronization.Engine
	BadgerDB        *badger.DB
	VM              *fvm.VirtualMachine
	ExecutionState  state.ExecutionState
	Ledger          ledger.Ledger
	LevelDbDir      string
	Collections     storage.Collections
	Finalizer       *consensus.Finalizer
}

ExecutionNode implements a mocked execution node for tests.

func (ExecutionNode) AssertHighestExecutedBlock

func (en ExecutionNode) AssertHighestExecutedBlock(t *testing.T, header *flow.Header)

func (ExecutionNode) Done

func (en ExecutionNode) Done()

func (ExecutionNode) Ready

func (en ExecutionNode) Ready()

type GenericNode

type GenericNode struct {
	Log            zerolog.Logger
	Metrics        *metrics.NoopCollector
	Tracer         module.Tracer
	DB             *badger.DB
	Headers        storage.Headers
	Identities     storage.Identities
	Guarantees     storage.Guarantees
	Seals          storage.Seals
	Payloads       storage.Payloads
	Blocks         storage.Blocks
	State          protocol.MutableState
	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

Closes closes the badger database of the node

func (*GenericNode) Done

func (g *GenericNode) Done()

type StateFixture added in v0.14.0

type StateFixture struct {
	DB             *badger.DB
	Storage        *storage.All
	DBDir          string
	ProtocolEvents *events.Distributor
	State          protocol.MutableState
}

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
	CachedReceipts           mempool.ReceiptDataPacks
	ReadyReceipts            mempool.ReceiptDataPacks
	PendingReceipts          mempool.ReceiptDataPacks
	PendingResults           mempool.ResultDataPacks
	ProcessedResultIDs       mempool.Identifiers
	DiscardedResultIDs       mempool.Identifiers
	BlockIDsCache            mempool.Identifiers
	PendingReceiptIDsByBlock mempool.IdentifierMap
	ReceiptIDsByResult       mempool.IdentifierMap
	ChunkIDsByResult         mempool.IdentifierMap
	PendingChunks            *match.Chunks
	VerifierEngine           network.Engine
	FinderEngine             *finder.Engine
	MatchEngine              network.Engine
}

VerificationNode implements an in-process verification node for tests.

Jump to

Keyboard shortcuts

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