builder

package
v1.11.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEndOfTime       = errors.New("program time is suspiciously far in the future")
	ErrNoPendingBlocks = errors.New("no pending blocks")
)

Functions

func NewRewardValidatorTx

func NewRewardValidatorTx(ctx *snow.Context, txID ids.ID) (*txs.Tx, error)

Types

type Builder

type Builder interface {
	mempool.Mempool

	// StartBlockTimer starts to issue block creation requests to advance the
	// chain timestamp.
	StartBlockTimer()

	// ResetBlockTimer forces the block timer to recalculate when it should
	// advance the chain timestamp.
	ResetBlockTimer()

	// ShutdownBlockTimer stops block creation requests to advance the chain
	// timestamp.
	//
	// Invariant: Assumes the context lock is held when calling.
	ShutdownBlockTimer()

	// BuildBlock can be called to attempt to create a new block
	BuildBlock(context.Context) (snowman.Block, error)

	// PackBlockTxs returns an array of txs that can fit into a valid block of
	// size [targetBlockSize]. The returned txs are all verified against the
	// preferred state.
	//
	// Note: This function does not call the consensus engine.
	PackBlockTxs(targetBlockSize int) ([]*txs.Tx, error)
}

func New

func New(
	mempool mempool.Mempool,
	txExecutorBackend *txexecutor.Backend,
	blkManager blockexecutor.Manager,
) Builder

Jump to

Keyboard shortcuts

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