enginetest

package
v1.19.13 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package enginetest provides test utilities for consensus engines

Package enginetest provides test utilities for consensus engines

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender added in v1.19.13

type Sender struct {
	SendAppRequestF            func(context.Context, set.Set[ids.NodeID], uint32, []byte) error
	SendAppResponseF           func(context.Context, ids.NodeID, uint32, []byte) error
	SendAppErrorF              func(context.Context, ids.NodeID, uint32, int32, string) error
	SendAppGossipF             func(context.Context, core.SendConfig, []byte) error
	SendAppGossipSpecificF     func(context.Context, core.SendConfig, []byte) error
	SendCrossChainAppRequestF  func(context.Context, ids.ID, uint32, []byte) error
	SendCrossChainAppResponseF func(context.Context, ids.ID, uint32, []byte) error
	SendCrossChainAppErrorF    func(context.Context, ids.ID, uint32, int32, string) error
}

Sender is a test implementation of core.Sender for testing

func (*Sender) SendAppError added in v1.19.13

func (s *Sender) SendAppError(ctx context.Context, nodeID ids.NodeID, requestID uint32, errorCode int32, errorMessage string) error

func (*Sender) SendAppGossip added in v1.19.13

func (s *Sender) SendAppGossip(ctx context.Context, config core.SendConfig, gossip []byte) error

func (*Sender) SendAppGossipSpecific added in v1.19.13

func (s *Sender) SendAppGossipSpecific(ctx context.Context, config core.SendConfig, gossip []byte) error

func (*Sender) SendAppRequest added in v1.19.13

func (s *Sender) SendAppRequest(ctx context.Context, nodeIDs set.Set[ids.NodeID], requestID uint32, request []byte) error

func (*Sender) SendAppResponse added in v1.19.13

func (s *Sender) SendAppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error

func (*Sender) SendCrossChainAppError added in v1.19.13

func (s *Sender) SendCrossChainAppError(ctx context.Context, chainID ids.ID, requestID uint32, errorCode int32, errorMessage string) error

func (*Sender) SendCrossChainAppRequest added in v1.19.13

func (s *Sender) SendCrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, request []byte) error

func (*Sender) SendCrossChainAppResponse added in v1.19.13

func (s *Sender) SendCrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error

type TestEngine

type TestEngine struct {
	// contains filtered or unexported fields
}

TestEngine provides a test implementation for consensus engines

func NewTestEngine

func NewTestEngine() *TestEngine

NewTestEngine creates a new test engine

func (*TestEngine) Height

func (t *TestEngine) Height() uint64

Height returns the current height

func (*TestEngine) IsStarted

func (t *TestEngine) IsStarted() bool

IsStarted returns whether the engine is started

func (*TestEngine) SetHeight

func (t *TestEngine) SetHeight(height uint64)

SetHeight sets the engine height

func (*TestEngine) Start

func (t *TestEngine) Start(ctx context.Context) error

Start starts the test engine

func (*TestEngine) Stop

func (t *TestEngine) Stop(ctx context.Context) error

Stop stops the test engine

type VM added in v1.19.8

type VM struct {
	T *testing.T
}

VM is a test VM for engine testing

Jump to

Keyboard shortcuts

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