fctest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForkChoiceTestDef

type ForkChoiceTestDef struct {
	Init       ForkChoiceTestInit
	Operations []Operation
}

func LighthouseTestDef

func LighthouseTestDef() *ForkChoiceTestDef

func (*ForkChoiceTestDef) Run

type ForkChoiceTestInit

type ForkChoiceTestInit struct {
	Spec         *common.Spec
	Finalized    forkchoice.Checkpoint
	Justified    forkchoice.Checkpoint
	AnchorRoot   forkchoice.Root
	AnchorSlot   forkchoice.Slot
	AnchorParent forkchoice.Root
	Balances     []forkchoice.Gwei
}

type ForkChoiceTestTarget

type ForkChoiceTestTarget struct {
	// node -> canonical. Presence = pruneable node.
	// Test should fail if a node is pruned that is not in here.
	Pruneable map[forkchoice.NodeRef]bool
}

type OpCanonAtSlot

type OpCanonAtSlot struct {
	Anchor    forkchoice.Root
	Slot      forkchoice.Slot
	WithBlock bool
	At        forkchoice.NodeRef
	Ok        bool
}

func (*OpCanonAtSlot) Apply

type OpCanonicalChain

type OpCanonicalChain struct {
	AnchorRoot forkchoice.Root
	AnchorSlot forkchoice.Slot
	// TODO: simplify to []Root ?
	Expected []forkchoice.ExtendedNodeRef
	Ok       bool
}

func (*OpCanonicalChain) Apply

type OpClosestToSlot

type OpClosestToSlot struct {
	Anchor  forkchoice.Root
	Slot    forkchoice.Slot
	Closest forkchoice.NodeRef
	Ok      bool
}

func (*OpClosestToSlot) Apply

type OpFindHead

type OpFindHead struct {
	AnchorRoot   forkchoice.Root
	AnchorSlot   forkchoice.Slot
	ExpectedHead forkchoice.NodeRef
	Ok           bool
}

func (*OpFindHead) Apply

type OpGetSlot

type OpGetSlot struct {
	BlockRoot forkchoice.Root
	Slot      forkchoice.Slot
	Ok        bool
}

func (*OpGetSlot) Apply

type OpHead

type OpHead struct {
	ExpectedHead forkchoice.NodeRef
	Ok           bool
}

func (*OpHead) Apply

type OpIsAncestor

type OpIsAncestor struct {
	Anchor    forkchoice.Root
	Root      forkchoice.Root
	Unknown   bool
	InSubtree bool
}

func (*OpIsAncestor) Apply

type OpProcessAttestation

type OpProcessAttestation struct {
	ValidatorIndex forkchoice.ValidatorIndex
	BlockRoot      forkchoice.Root
	HeadSlot       forkchoice.Slot
	CanAdd         bool
}

func (*OpProcessAttestation) Apply

type OpProcessBlock

type OpProcessBlock struct {
	Parent         forkchoice.Root
	BlockRoot      forkchoice.Root
	BlockSlot      forkchoice.Slot
	JustifiedEpoch forkchoice.Epoch
	FinalizedEpoch forkchoice.Epoch
}

func (*OpProcessBlock) Apply

type OpProcessSlot

type OpProcessSlot struct {
	Parent         forkchoice.Root
	Slot           forkchoice.Slot
	JustifiedEpoch forkchoice.Epoch
	FinalizedEpoch forkchoice.Epoch
}

func (*OpProcessSlot) Apply

type OpPruneable

type OpPruneable struct {
	Pruneable forkchoice.NodeRef
	Canonical bool
}

func (*OpPruneable) Apply

type OpUpdateJustified

type OpUpdateJustified struct {
	Trigger                forkchoice.Root
	Justified              forkchoice.Checkpoint
	Finalized              forkchoice.Checkpoint
	JustifiedStateBalances func() ([]forkchoice.Gwei, error)
	Ok                     bool
}

func (*OpUpdateJustified) Apply

type Operation

type Operation interface {
	Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
}

Jump to

Keyboard shortcuts

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