Documentation ¶
Index ¶
- type ActionHandlerStub
- type ChainStorerMock
- func (sm *ChainStorerMock) AddStorer(_ dataRetriever.UnitType, _ storage.Storer)
- func (sm *ChainStorerMock) CloseAll() error
- func (sm *ChainStorerMock) Destroy() error
- func (sm *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (sm *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (sm *ChainStorerMock) GetAllStorers() map[dataRetriever.UnitType]storage.Storer
- func (sm *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (sm *ChainStorerMock) Has(_ dataRetriever.UnitType, _ []byte) error
- func (sm *ChainStorerMock) IsInterfaceNil() bool
- func (sm *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- func (sm *ChainStorerMock) SetEpochForPutOperation(_ uint32)
- type StorerMock
- func (sm *StorerMock) ClearAll()
- func (sm *StorerMock) ClearCache()
- func (sm *StorerMock) Close() error
- func (sm *StorerMock) DestroyUnit() error
- func (sm *StorerMock) Get(key []byte) ([]byte, error)
- func (sm *StorerMock) GetBulkFromEpoch(keys [][]byte, epoch uint32) ([]storageCore.KeyValuePair, error)
- func (sm *StorerMock) GetCurrentEpochData() *container.MutexMap
- func (sm *StorerMock) GetEpochData(epoch uint32) *container.MutexMap
- func (sm *StorerMock) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
- func (sm *StorerMock) GetFromEpochWithMarshalizer(key []byte, epoch uint32, obj interface{}, marshalizer marshal.Marshalizer) error
- func (sm *StorerMock) GetOldestEpoch() (uint32, error)
- func (sm *StorerMock) Has(key []byte) error
- func (sm *StorerMock) IsInterfaceNil() bool
- func (sm *StorerMock) Put(key, value []byte) error
- func (sm *StorerMock) PutInEpoch(key, value []byte, epoch uint32) error
- func (sm *StorerMock) PutWithMarshalizer(key []byte, obj interface{}, marshalizer marshal.Marshalizer) error
- func (sm *StorerMock) RangeKeys(handler func(key []byte, value []byte) bool)
- func (sm *StorerMock) Remove(_ []byte) error
- func (sm *StorerMock) RemoveFromCurrentEpoch(_ []byte) error
- func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
- func (sm *StorerMock) SetCurrentEpoch(epoch uint32)
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) 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
GetStorer -
func (*ChainStorerMock) Has ¶
func (sm *ChainStorerMock) Has(_ dataRetriever.UnitType, _ []byte) error
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 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) 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) IsInterfaceNil ¶
func (sm *StorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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) 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 -