genericMocks

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionHandlerStub

type ActionHandlerStub struct {
	EpochStartActionCalled  func(hdr data.HeaderHandler)
	EpochStartPrepareCalled func(metaHdr data.HeaderHandler, body data.BodyHandler)
	NotifyOrderCalled       func() uint32
}

ActionHandlerStub -

func (*ActionHandlerStub) EpochStartAction

func (ahs *ActionHandlerStub) EpochStartAction(hdr data.HeaderHandler)

EpochStartAction -

func (*ActionHandlerStub) EpochStartPrepare

func (ahs *ActionHandlerStub) EpochStartPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)

EpochStartPrepare -

func (*ActionHandlerStub) NotifyOrder

func (ahs *ActionHandlerStub) NotifyOrder() uint32

NotifyOrder -

type ChainStorerMock

type ChainStorerMock struct {
	BlockHeaders  *StorerMock
	Metablocks    *StorerMock
	Miniblocks    *StorerMock
	Transactions  *StorerMock
	Rewards       *StorerMock
	Unsigned      *StorerMock
	Logs          *StorerMock
	MetaHdrNonce  *StorerMock
	ShardHdrNonce *StorerMock
	Receipts      *StorerMock
	ScheduledSCRs *StorerMock
	Others        *StorerMock
}

ChainStorerMock -

func NewChainStorerMock

func NewChainStorerMock(epoch uint32) *ChainStorerMock

NewChainStorerMock -

func (*ChainStorerMock) AddStorer

func (sm *ChainStorerMock) AddStorer(_ dataRetriever.UnitType, _ storage.Storer)

AddStorer -

func (*ChainStorerMock) CloseAll

func (sm *ChainStorerMock) CloseAll() error

CloseAll -

func (*ChainStorerMock) Destroy

func (sm *ChainStorerMock) Destroy() error

Destroy -

func (*ChainStorerMock) Get

func (sm *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)

Get -

func (*ChainStorerMock) GetAll

func (sm *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)

GetAll -

func (*ChainStorerMock) GetAllStorers

func (sm *ChainStorerMock) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

func (*ChainStorerMock) GetStorer

func (sm *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) (storage.Storer, error)

GetStorer -

func (*ChainStorerMock) Has

Has -

func (*ChainStorerMock) IsInterfaceNil

func (sm *ChainStorerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*ChainStorerMock) Put

func (sm *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error

Put -

func (*ChainStorerMock) SetEpochForPutOperation

func (sm *ChainStorerMock) SetEpochForPutOperation(_ uint32)

SetEpochForPutOperation -

type StorerMock

type StorerMock struct {
	Name        string
	DataByEpoch map[uint32]*container.MutexMap
	// contains filtered or unexported fields
}

StorerMock -

func NewStorerMock

func NewStorerMock() *StorerMock

NewStorerMock -

func NewStorerMockWithEpoch

func NewStorerMockWithEpoch(currentEpoch uint32) *StorerMock

NewStorerMockWithEpoch -

func NewStorerMockWithErrKeyNotFound

func NewStorerMockWithErrKeyNotFound(currentEpoch uint32) *StorerMock

NewStorerMockWithErrKeyNotFound -

func (*StorerMock) ClearAll

func (sm *StorerMock) ClearAll()

ClearAll removes all data from the mock (useful in unit tests)

func (*StorerMock) ClearCache

func (sm *StorerMock) ClearCache()

ClearCache -

func (*StorerMock) Close

func (sm *StorerMock) Close() error

Close -

func (*StorerMock) DestroyUnit

func (sm *StorerMock) DestroyUnit() error

DestroyUnit -

func (*StorerMock) Get

func (sm *StorerMock) Get(key []byte) ([]byte, error)

Get -

func (*StorerMock) GetBulkFromEpoch

func (sm *StorerMock) GetBulkFromEpoch(keys [][]byte, epoch uint32) ([]storageCore.KeyValuePair, error)

GetBulkFromEpoch -

func (*StorerMock) GetCurrentEpochData

func (sm *StorerMock) GetCurrentEpochData() *container.MutexMap

GetCurrentEpochData -

func (*StorerMock) GetEpochData

func (sm *StorerMock) GetEpochData(epoch uint32) *container.MutexMap

GetEpochData -

func (*StorerMock) GetFromEpoch

func (sm *StorerMock) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)

GetFromEpoch -

func (*StorerMock) GetFromEpochWithMarshalizer

func (sm *StorerMock) GetFromEpochWithMarshalizer(key []byte, epoch uint32, obj interface{}, marshalizer marshal.Marshalizer) error

GetFromEpochWithMarshalizer -

func (*StorerMock) GetOldestEpoch

func (sm *StorerMock) GetOldestEpoch() (uint32, error)

GetOldestEpoch -

func (*StorerMock) Has

func (sm *StorerMock) Has(key []byte) error

Has -

func (*StorerMock) IsInterfaceNil

func (sm *StorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerMock) Put

func (sm *StorerMock) Put(key, value []byte) error

Put -

func (*StorerMock) PutInEpoch

func (sm *StorerMock) PutInEpoch(key, value []byte, epoch uint32) error

PutInEpoch -

func (*StorerMock) PutWithMarshalizer

func (sm *StorerMock) PutWithMarshalizer(key []byte, obj interface{}, marshalizer marshal.Marshalizer) error

PutWithMarshalizer -

func (*StorerMock) RangeKeys

func (sm *StorerMock) RangeKeys(handler func(key []byte, value []byte) bool)

RangeKeys -

func (*StorerMock) Remove

func (sm *StorerMock) Remove(_ []byte) error

Remove -

func (*StorerMock) RemoveFromCurrentEpoch

func (sm *StorerMock) RemoveFromCurrentEpoch(_ []byte) error

RemoveFromCurrentEpoch -

func (*StorerMock) SearchFirst

func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)

SearchFirst -

func (*StorerMock) SetCurrentEpoch

func (sm *StorerMock) SetCurrentEpoch(epoch uint32)

SetCurrentEpoch -

Jump to

Keyboard shortcuts

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