vertextest

package
v1.11.11-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: BSD-3-Clause Imports: 9 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) (avalanche.Vertex, error)
}

func (*Builder) BuildStopVtx

func (b *Builder) BuildStopVtx(ctx context.Context, parentIDs []ids.ID) (avalanche.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) (avalanche.Vertex, error)
}

func (*Parser) Default

func (p *Parser) Default(cant bool)

func (*Parser) ParseVtx

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

type Storage

type Storage struct {
	T                                            *testing.T
	CantGetVtx, CantEdge, CantStopVertexAccepted bool
	GetVtxF                                      func(context.Context, ids.ID) (avalanche.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) (avalanche.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) (snowstorm.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) (snowstorm.Tx, error)

Jump to

Keyboard shortcuts

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