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

chaintest

package
v1.13.11 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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.GenerateTestID()
	GenesisTimestamp = time.Unix(GenesisUnixTimestamp, 0)
	GenesisBytes     = GenesisID[:]
	Genesis          = BuildChain(1)[0]
)

Functions

func MakeGetBlockIDAtHeightF added in v0.15.6

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 added in v0.15.6

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

Types

type Block

type Block struct {
	snowtest.Decidable

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

func BuildChain added in v0.15.6

func BuildChain(length int) []*Block

func BuildChild

func BuildChild(parent *Block) *Block

func BuildDescendants added in v0.15.6

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

func (*Block) Bytes

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

func (*Block) Compare added in v0.15.6

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 added in v0.15.6

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