collection

package
v0.10.3-stop-broadcast... Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is the builder for collection block payloads. Upon providing a payload hash, it also memorizes the payload contents.

NOTE: Builder is NOT safe for use with multiple goroutines. Since the HotStuff event loop is the only consumer of this interface and is single threaded, this is OK.

func NewBuilder

func NewBuilder(
	db *badger.DB,
	tracer module.Tracer,
	mainHeaders storage.Headers,
	clusterHeaders storage.Headers,
	payloads storage.ClusterPayloads,
	transactions mempool.Transactions,
	opts ...Opt,
) *Builder

func (*Builder) BuildOn

func (b *Builder) BuildOn(parentID flow.Identifier, setter func(*flow.Header) error) (*flow.Header, error)

BuildOn creates a new block built on the given parent. It produces a payload that is valid with respect to the un-finalized chain it extends.

type Opt

type Opt func(*Builder)

func WithExpiryBuffer

func WithExpiryBuffer(buf uint) Opt

func WithMaxCollectionSize

func WithMaxCollectionSize(size uint) Opt

Jump to

Keyboard shortcuts

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