blocktest

package
v1.11.14 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GenesisID        = ids.GenerateTestID()
	GenesisHeight    = uint64(0)
	GenesisTimestamp = time.Unix(0, 0)
	GenesisBytes     = []byte("genesis")

	Genesis = &Block{
		TestBlock: chain.TestBlock{
			IDV:        GenesisID,
			HeightV:    GenesisHeight,
			TimestampV: GenesisTimestamp,
			ParentV:    ids.Empty,
			BytesV:     GenesisBytes,
			StatusV:    chain.Accepted,
		},
	}
)

Functions

This section is empty.

Types

type Block

type Block struct {
	chain.TestBlock
	// contains filtered or unexported fields
}

Block is a test block that implements chain.Block

func BuildChild

func BuildChild(parent chain.Block) *Block

BuildChild creates a child block of the given parent

func (*Block) Accept

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

func (*Block) Bytes

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

func (*Block) Height

func (b *Block) Height() uint64

func (*Block) ID

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

func (*Block) Parent

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

func (*Block) Reject

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

func (*Block) State

func (b *Block) State() state.ReadOnlyChain

func (*Block) Status

func (b *Block) Status() chain.Status

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