mock

package
v4.0.0-...-ae7b6de Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanonicalChecker

type CanonicalChecker struct {
	Is  bool
	Err error
}

func (*CanonicalChecker) IsCanonical

func (m *CanonicalChecker) IsCanonical(_ context.Context, _ [32]byte) (bool, error)

type CurrentSlotter

type CurrentSlotter struct {
	Slot primitives.Slot
}

func (*CurrentSlotter) CurrentSlot

func (c *CurrentSlotter) CurrentSlot() primitives.Slot

type Replayer

type Replayer struct {
	State state.BeaconState
	Err   error
}

func (*Replayer) ReplayBlocks

func (m *Replayer) ReplayBlocks(_ context.Context) (state.BeaconState, error)

func (*Replayer) ReplayToSlot

func (m *Replayer) ReplayToSlot(_ context.Context, _ primitives.Slot) (state.BeaconState, error)

type ReplayerBuilder

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

func NewReplayerBuilder

func NewReplayerBuilder(opt ...ReplayerBuilderOption) *ReplayerBuilder

func (*ReplayerBuilder) ReplayerForSlot

func (b *ReplayerBuilder) ReplayerForSlot(target primitives.Slot) stategen.Replayer

func (*ReplayerBuilder) SetMockSlotError

func (b *ReplayerBuilder) SetMockSlotError(s primitives.Slot, e error)

func (*ReplayerBuilder) SetMockState

func (b *ReplayerBuilder) SetMockState(s state.BeaconState)

func (*ReplayerBuilder) SetMockStateForSlot

func (b *ReplayerBuilder) SetMockStateForSlot(s state.BeaconState, slot primitives.Slot)

type ReplayerBuilderOption

type ReplayerBuilderOption func(*ReplayerBuilder)

type StateManager

type StateManager struct {
	StatesByRoot map[[32]byte]state.BeaconState
	StatesBySlot map[primitives.Slot]state.BeaconState
}

StateManager is a fake implementation of StateManager.

func NewService

func NewService() *StateManager

NewService --

func (*StateManager) ActiveNonSlashedBalancesByRoot

func (*StateManager) ActiveNonSlashedBalancesByRoot(_ context.Context, _ [32]byte) ([]uint64, error)

ActiveNonSlashedBalancesByRoot --

func (*StateManager) AddStateForRoot

func (m *StateManager) AddStateForRoot(state state.BeaconState, blockRoot [32]byte)

AddStateForRoot --

func (*StateManager) AddStateForSlot

func (m *StateManager) AddStateForSlot(state state.BeaconState, slot primitives.Slot)

AddStateForSlot --

func (*StateManager) DeleteStateFromCaches

func (m *StateManager) DeleteStateFromCaches(context.Context, [32]byte) error

DeleteStateFromCaches --

func (*StateManager) DisableSaveHotStateToDB

func (_ *StateManager) DisableSaveHotStateToDB(_ context.Context) error

DisableSaveHotStateToDB --

func (*StateManager) EnableSaveHotStateToDB

func (_ *StateManager) EnableSaveHotStateToDB(_ context.Context)

EnableSaveHotStateToDB --

func (*StateManager) ForceCheckpoint

func (_ *StateManager) ForceCheckpoint(_ context.Context, _ []byte) error

ForceCheckpoint --

func (*StateManager) HasState

func (_ *StateManager) HasState(_ context.Context, _ [32]byte) (bool, error)

HasState --

func (*StateManager) MigrateToCold

func (_ *StateManager) MigrateToCold(_ context.Context, _ [32]byte) error

MigrateToCold --

func (*StateManager) Resume

Resume --

func (*StateManager) SaveFinalizedState

func (_ *StateManager) SaveFinalizedState(_ primitives.Slot, _ [32]byte, _ state.BeaconState)

SaveFinalizedState --

func (*StateManager) SaveState

func (_ *StateManager) SaveState(_ context.Context, _ [32]byte, _ state.BeaconState) error

SaveState --

func (*StateManager) StateByRoot

func (m *StateManager) StateByRoot(_ context.Context, blockRoot [32]byte) (state.BeaconState, error)

StateByRoot --

func (*StateManager) StateByRootIfCachedNoCopy

func (_ *StateManager) StateByRootIfCachedNoCopy(_ [32]byte) state.BeaconState

StateByRootIfCachedNoCopy --

func (*StateManager) StateByRootInitialSync

func (_ *StateManager) StateByRootInitialSync(_ context.Context, _ [32]byte) (state.BeaconState, error)

StateByRootInitialSync --

func (*StateManager) StateBySlot

func (m *StateManager) StateBySlot(_ context.Context, slot primitives.Slot) (state.BeaconState, error)

StateBySlot --

Jump to

Keyboard shortcuts

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