enginetest

package
v1.22.25 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 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 {
	SendRequestF            func(context.Context, set.Set[ids.NodeID], uint32, []byte) error
	SendResponseF           func(context.Context, ids.NodeID, uint32, []byte) error
	SendErrorF              func(context.Context, ids.NodeID, uint32, int32, string) error
	SendGossipF             func(context.Context, warp.SendConfig, []byte) error
	SendCrossChainRequestF  func(context.Context, ids.ID, uint32, []byte) error
	SendCrossChainResponseF func(context.Context, ids.ID, uint32, []byte) error
	SendCrossChainErrorF    func(context.Context, ids.ID, uint32, int32, string) error
}

Sender is a test implementation of warp.Sender for testing

func (*Sender) SendCrossChainError added in v1.22.14

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

func (*Sender) SendCrossChainRequest added in v1.22.14

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

func (*Sender) SendCrossChainResponse added in v1.22.14

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

func (*Sender) SendError added in v1.22.14

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

func (*Sender) SendGossip added in v1.22.14

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

func (*Sender) SendRequest added in v1.22.14

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

func (*Sender) SendResponse added in v1.22.14

func (s *Sender) SendResponse(ctx context.Context, nodeID ids.NodeID, 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