Help us shape the future of Go! Take the 2026 Go Developer Survey

vertextest

package
v1.16.15 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	T             *testing.T
	CantBuildVtx  bool
	BuildStopVtxF func(ctx context.Context, parentIDs []ids.ID) (dag.Vertex, error)
}

func (*Builder) BuildStopVtx

func (b *Builder) BuildStopVtx(ctx context.Context, parentIDs []ids.ID) (dag.Vertex, error)

func (*Builder) Default

func (b *Builder) Default(cant bool)

type Manager

type Manager struct {
	Builder
	Parser
	Storage
}

func NewManager

func NewManager(t *testing.T) *Manager

func (*Manager) Default

func (m *Manager) Default(cant bool)

type Parser

type Parser struct {
	T            *testing.T
	CantParseVtx bool
	ParseVtxF    func(context.Context, []byte) (dag.Vertex, error)
}

func (*Parser) Default

func (p *Parser) Default(cant bool)

func (*Parser) ParseVtx

func (p *Parser) ParseVtx(ctx context.Context, b []byte) (dag.Vertex, error)

type Storage

type Storage struct {
	T                                            *testing.T
	CantGetVtx, CantEdge, CantStopVertexAccepted bool
	GetVtxF                                      func(context.Context, ids.ID) (dag.Vertex, error)
	EdgeF                                        func(context.Context) []ids.ID
	StopVertexAcceptedF                          func(context.Context) (bool, error)
}

func (*Storage) Default

func (s *Storage) Default(cant bool)

func (*Storage) Edge

func (s *Storage) Edge(ctx context.Context) []ids.ID

func (*Storage) GetVtx

func (s *Storage) GetVtx(ctx context.Context, vtxID ids.ID) (dag.Vertex, error)

func (*Storage) StopVertexAccepted

func (s *Storage) StopVertexAccepted(ctx context.Context) (bool, error)

type VM

type VM struct {
	blocktest.VM

	CantLinearize, CantParse bool

	LinearizeF func(context.Context, ids.ID) error
	ParseTxF   func(context.Context, []byte) (dag.Tx, error)
}

func (*VM) Default

func (vm *VM) Default(cant bool)

func (*VM) Linearize

func (vm *VM) Linearize(ctx context.Context, stopVertexID ids.ID) error

func (*VM) ParseTx

func (vm *VM) ParseTx(ctx context.Context, b []byte) (dag.Tx, error)

Jump to

Keyboard shortcuts

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