mock

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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 MockCanonicalChecker

type MockCanonicalChecker struct {
	Is  bool
	Err error
}

func (*MockCanonicalChecker) IsCanonical

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

type MockCurrentSlotter

type MockCurrentSlotter struct {
	Slot primitives.Slot
}

func (*MockCurrentSlotter) CurrentSlot

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

type MockReplayer

type MockReplayer struct {
	State state.BeaconState
	Err   error
}

func (*MockReplayer) ReplayBlocks

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

func (*MockReplayer) ReplayToSlot

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

type MockReplayerBuilder

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

func NewMockReplayerBuilder

func NewMockReplayerBuilder(opt ...MockReplayerBuilderOption) *MockReplayerBuilder

func (*MockReplayerBuilder) ReplayerForSlot

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

func (*MockReplayerBuilder) SetMockSlotError

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

func (*MockReplayerBuilder) SetMockState

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

func (*MockReplayerBuilder) SetMockStateForSlot

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

type MockReplayerBuilderOption

type MockReplayerBuilderOption func(*MockReplayerBuilder)

type MockStateManager

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

MockStateManager is a fake implementation of StateManager.

func NewMockService

func NewMockService() *MockStateManager

NewMockService --

func (*MockStateManager) ActiveNonSlashedBalancesByRoot

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

BalancesByRoot --

func (*MockStateManager) AddStateForRoot

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

AddStateForRoot --

func (*MockStateManager) AddStateForSlot

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

AddStateForSlot --

func (*MockStateManager) DeleteStateFromCaches

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

DeleteStateFromCaches --

func (*MockStateManager) DisableSaveHotStateToDB

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

DisableSaveHotStateToDB --

func (*MockStateManager) EnableSaveHotStateToDB

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

EnableSaveHotStateToDB --

func (*MockStateManager) ForceCheckpoint

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

ForceCheckpoint --

func (*MockStateManager) HasState

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

HasState --

func (*MockStateManager) MigrateToCold

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

MigrateToCold --

func (*MockStateManager) Resume

Resume --

func (*MockStateManager) SaveFinalizedState

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

SaveFinalizedState --

func (*MockStateManager) SaveState

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

SaveState --

func (*MockStateManager) StateByRoot

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

StateByRoot --

func (*MockStateManager) StateByRootIfCachedNoCopy

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

StateByRootIfCachedNoCopy --

func (*MockStateManager) StateByRootInitialSync

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

StateByRootInitialSync --

func (*MockStateManager) StateBySlot

StateBySlot --

Jump to

Keyboard shortcuts

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