snowmantest

package
v1.11.11-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 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

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 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

func BuildChain(length int) []*Block

func BuildChild

func BuildChild(parent *Block) *Block

func BuildDescendants

func BuildDescendants(parent *Block, 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