Documentation ¶
Index ¶
- func CollectionNode(t *testing.T, hub *stub.Hub, identity *flow.Identity, ...) testmock.CollectionNode
- func CollectionNodes(t *testing.T, hub *stub.Hub, nNodes int, chainID flow.ChainID, ...) []testmock.CollectionNode
- func CompleteStateFixture(t testing.TB, metric *metrics.NoopCollector, tracer module.Tracer, ...) *testmock.StateFixture
- func ConsensusNode(t *testing.T, hub *stub.Hub, identity *flow.Identity, ...) testmock.ConsensusNode
- func ConsensusNodes(t *testing.T, hub *stub.Hub, nNodes int, chainID flow.ChainID) []testmock.ConsensusNode
- func ExecutionNode(t *testing.T, hub *stub.Hub, identity *flow.Identity, ...) testmock.ExecutionNode
- func GenericNode(t testing.TB, hub *stub.Hub, identity *flow.Identity, ...) testmock.GenericNode
- func GenericNodeWithStateFixture(t testing.TB, stateFixture *testmock.StateFixture, hub *stub.Hub, ...) testmock.GenericNode
- func LocalFixture(t testing.TB, identity *flow.Identity) module.Local
- func NewVerificationNode(t testing.TB, hub *stub.Hub, verIdentity *flow.Identity, ...) testmock.VerificationNode
- func VerificationNode(t testing.TB, hub *stub.Hub, identity *flow.Identity, ...) testmock.VerificationNode
- type CheckerMock
- type RoundRobinLeaderSelection
- func (s *RoundRobinLeaderSelection) DKG(blockID flow.Identifier) (hotstuff.DKG, error)
- func (s *RoundRobinLeaderSelection) Identities(blockID flow.Identifier, selector flow.IdentityFilter) (flow.IdentityList, error)
- func (s *RoundRobinLeaderSelection) Identity(blockID flow.Identifier, participantID flow.Identifier) (*flow.Identity, error)
- func (s *RoundRobinLeaderSelection) LeaderForView(view uint64) (flow.Identifier, error)
- func (s *RoundRobinLeaderSelection) Self() flow.Identifier
- type VerificationOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectionNode ¶
func CollectionNode(t *testing.T, hub *stub.Hub, identity *flow.Identity, identities []*flow.Identity, chainID flow.ChainID, options ...func(protocol.State)) testmock.CollectionNode
CollectionNode returns a mock collection node.
func CollectionNodes ¶
func CollectionNodes(t *testing.T, hub *stub.Hub, nNodes int, chainID flow.ChainID, options ...func(protocol.State)) []testmock.CollectionNode
CollectionNodes returns n collection nodes connected to the given hub.
func CompleteStateFixture ¶ added in v0.14.0
func CompleteStateFixture(t testing.TB, metric *metrics.NoopCollector, tracer module.Tracer, participants flow.IdentityList) *testmock.StateFixture
CompleteStateFixture is a test helper that creates, bootstraps, and returns a StateFixture for sake of unit testing.
func ConsensusNode ¶
func ConsensusNodes ¶
func ExecutionNode ¶
func GenericNode ¶
func GenericNode(t testing.TB, hub *stub.Hub, identity *flow.Identity, participants []*flow.Identity, chainID flow.ChainID, options ...func(protocol.State)) testmock.GenericNode
GenericNode is a test helper that creates and returns a generic node. The generic node is used as the core data structure to create other types of flow nodes.
func GenericNodeWithStateFixture ¶ added in v0.14.0
func GenericNodeWithStateFixture(t testing.TB, stateFixture *testmock.StateFixture, hub *stub.Hub, identity *flow.Identity, log zerolog.Logger, metrics *metrics.NoopCollector, tracer module.Tracer, chainID flow.ChainID) testmock.GenericNode
GenericNodeWithStateFixture is a test helper that creates a generic node with specified state fixture.
func LocalFixture ¶ added in v0.15.4
LocalFixture creates and returns a Local module for given identity.
func NewVerificationNode ¶ added in v0.17.0
func NewVerificationNode(t testing.TB, hub *stub.Hub, verIdentity *flow.Identity, participants flow.IdentityList, assigner module.ChunkAssigner, chunksLimit uint, chainID flow.ChainID, collector module.VerificationMetrics, mempoolCollector module.MempoolMetrics, opts ...VerificationOpt) testmock.VerificationNode
NewVerificationNode creates a verification node with all functional engines and actual modules for purpose of (integration) testing.
TODO: refactor to VerificationNode once the old constructor is dropped.
func VerificationNode ¶
func VerificationNode(t testing.TB, hub *stub.Hub, identity *flow.Identity, identities []*flow.Identity, assigner module.ChunkAssigner, requestInterval time.Duration, processInterval time.Duration, receiptsLimit uint, chunksLimit uint, failureThreshold uint, chainID flow.ChainID, collector module.VerificationMetrics, mempoolCollector module.MempoolMetrics, opts ...VerificationOpt) testmock.VerificationNode
TODO: this is fixture for old verification node (i.e., the one currently in place) remove it once we have the new verification node rolled-in.
Types ¶
type CheckerMock ¶ added in v0.14.4
type CheckerMock struct {
notifications.NoopConsumer // satisfy the FinalizationConsumer interface
}
type RoundRobinLeaderSelection ¶ added in v0.10.0
type RoundRobinLeaderSelection struct {
// contains filtered or unexported fields
}
func (*RoundRobinLeaderSelection) DKG ¶ added in v0.10.0
func (s *RoundRobinLeaderSelection) DKG(blockID flow.Identifier) (hotstuff.DKG, error)
func (*RoundRobinLeaderSelection) Identities ¶ added in v0.10.0
func (s *RoundRobinLeaderSelection) Identities(blockID flow.Identifier, selector flow.IdentityFilter) (flow.IdentityList, error)
func (*RoundRobinLeaderSelection) Identity ¶ added in v0.10.0
func (s *RoundRobinLeaderSelection) Identity(blockID flow.Identifier, participantID flow.Identifier) (*flow.Identity, error)
func (*RoundRobinLeaderSelection) LeaderForView ¶ added in v0.10.0
func (s *RoundRobinLeaderSelection) LeaderForView(view uint64) (flow.Identifier, error)
func (*RoundRobinLeaderSelection) Self ¶ added in v0.10.0
func (s *RoundRobinLeaderSelection) Self() flow.Identifier
type VerificationOpt ¶
type VerificationOpt func(*testmock.VerificationNode)
func WithChunkConsumer ¶ added in v0.17.0
func WithChunkConsumer(chunkConsumer *chunkconsumer.ChunkConsumer) VerificationOpt
func WithGenericNode ¶ added in v0.14.0
func WithGenericNode(genericNode *testmock.GenericNode) VerificationOpt
func WithMatchEngine ¶
func WithMatchEngine(eng network.Engine) VerificationOpt