forkchoice

package
v0.0.0-...-bb812c9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0, MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, config string, fork int)

Run executes "forkchoice" and "sync" test.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(t testing.TB, initialState state.BeaconState, initialBlock interfaces.ReadOnlySignedBeaconBlock) *Builder

func (*Builder) Attestation

func (bb *Builder) Attestation(t testing.TB, a *ethpb.Attestation)

Attestation receives the attestation and updates forkchoice.

func (*Builder) AttesterSlashing

func (bb *Builder) AttesterSlashing(s *ethpb.AttesterSlashing)

AttesterSlashing receives an attester slashing and feeds it to forkchoice.

func (*Builder) Check

func (bb *Builder) Check(t testing.TB, c *Check)

Check evaluates the fork choice results and compares them to the expected values.

func (*Builder) InvalidBlock

func (bb *Builder) InvalidBlock(t testing.TB, b interfaces.ReadOnlySignedBeaconBlock)

InvalidBlock receives the invalid block and notifies forkchoice.

func (*Builder) PoWBlock

func (bb *Builder) PoWBlock(pb *ethpb.PowBlock)

PoWBlock receives the block and notifies a mocked execution engine.

func (*Builder) SetPayloadStatus

func (bb *Builder) SetPayloadStatus(resp *MockEngineResp) error

SetPayloadStatus sets the payload status that the engine will return

func (*Builder) Tick

func (bb *Builder) Tick(t testing.TB, tick int64)

Tick resets the genesis time to now()-tick and adjusts the slot to the appropriate value.

func (*Builder) ValidBlock

func (bb *Builder) ValidBlock(t testing.TB, b interfaces.ReadOnlySignedBeaconBlock)

ValidBlock receives the valid block and notifies forkchoice.

Jump to

Keyboard shortcuts

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