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

lineartest

package
v1.15.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GenesisHeight        uint64 = 0
	GenesisUnixTimestamp int64  = 1
)

Variables

View Source
var (
	GenesisID        = ids.Empty
	GenesisTimestamp = time.Unix(GenesisUnixTimestamp, 0)
	GenesisBytes     = GenesisID[:]
	Genesis          = BuildLinear(1)[0]
)

Functions

func MakeGetBlockIDAtHeightF

func MakeGetBlockIDAtHeightF(blks ...[]*Block) func(context.Context, uint64) (ids.ID, error)

func MakeLastAcceptedBlockF

func MakeLastAcceptedBlockF(blks ...[]*Block) func(context.Context) (ids.ID, error)

func RequireStatusIs

func RequireStatusIs(require *require.Assertions, status consensustest.Status, blks ...*Block)

Types

type Block

type Block struct {
	consensustest.Decidable

	ParentV    ids.ID
	HeightV    uint64
	TimestampV time.Time
	VerifyV    error
	BytesV     []byte
}

func BuildChild

func BuildChild(parent *Block) *Block

func BuildDescendants

func BuildDescendants(parent *Block, length int) []*Block

func BuildLinear added in v1.13.21

func BuildLinear(length int) []*Block

func (*Block) Bytes

func (b *Block) Bytes() []byte

func (*Block) Compare

func (b *Block) Compare(other *Block) int

func (*Block) Height

func (b *Block) Height() uint64

func (*Block) Parent

func (b *Block) Parent() ids.ID

func (*Block) Timestamp

func (b *Block) Timestamp() time.Time

func (*Block) Verify

func (b *Block) Verify(context.Context) error

Jump to

Keyboard shortcuts

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