mock

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 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 added in v4.2.0

type CanonicalChecker struct {
	Is  bool
	Err error
}

func (*CanonicalChecker) IsCanonical added in v4.2.0

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

type CurrentSlotter added in v4.2.0

type CurrentSlotter struct {
	Slot primitives.Slot
}

func (*CurrentSlotter) CurrentSlot added in v4.2.0

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

type Replayer added in v4.2.0

type Replayer struct {
	State state.BeaconState
	Err   error
}

func (*Replayer) ReplayBlocks added in v4.2.0

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

func (*Replayer) ReplayToSlot added in v4.2.0

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

type ReplayerBuilder added in v4.2.0

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

func NewReplayerBuilder added in v4.2.0

func NewReplayerBuilder(opt ...ReplayerBuilderOption) *ReplayerBuilder

func (*ReplayerBuilder) ReplayerForSlot added in v4.2.0

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

func (*ReplayerBuilder) SetMockSlotError added in v4.2.0

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

func (*ReplayerBuilder) SetMockState added in v4.2.0

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

func (*ReplayerBuilder) SetMockStateForSlot added in v4.2.0

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

type ReplayerBuilderOption added in v4.2.0

type ReplayerBuilderOption func(*ReplayerBuilder)

type StateManager added in v4.2.0

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

StateManager is a fake implementation of StateManager.

func NewService added in v4.2.0

func NewService() *StateManager

NewService --

func (*StateManager) ActiveNonSlashedBalancesByRoot added in v4.2.0

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

ActiveNonSlashedBalancesByRoot --

func (*StateManager) AddStateForRoot added in v4.2.0

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

AddStateForRoot --

func (*StateManager) AddStateForSlot added in v4.2.0

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

AddStateForSlot --

func (*StateManager) DeleteStateFromCaches added in v4.2.0

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

DeleteStateFromCaches --

func (*StateManager) DisableSaveHotStateToDB added in v4.2.0

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

DisableSaveHotStateToDB --

func (*StateManager) EnableSaveHotStateToDB added in v4.2.0

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

EnableSaveHotStateToDB --

func (*StateManager) ForceCheckpoint added in v4.2.0

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

ForceCheckpoint --

func (*StateManager) HasState added in v4.2.0

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

HasState --

func (*StateManager) MigrateToCold added in v4.2.0

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

MigrateToCold --

func (*StateManager) Resume added in v4.2.0

Resume --

func (*StateManager) SaveFinalizedState added in v4.2.0

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

SaveFinalizedState --

func (*StateManager) SaveState added in v4.2.0

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

SaveState --

func (*StateManager) StateByRoot added in v4.2.0

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

StateByRoot --

func (*StateManager) StateByRootIfCachedNoCopy added in v4.2.0

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

StateByRootIfCachedNoCopy --

func (*StateManager) StateByRootInitialSync added in v4.2.0

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

StateByRootInitialSync --

func (*StateManager) StateBySlot added in v4.2.0

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