mock

package
v1.999.10 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainStorerStub

type ChainStorerStub struct {
	AddStorerCalled     func(key dataRetriever.UnitType, s storage.Storer)
	GetStorerCalled     func(unitType dataRetriever.UnitType) storage.Storer
	HasCalled           func(unitType dataRetriever.UnitType, key []byte) error
	GetCalled           func(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
	PutCalled           func(unitType dataRetriever.UnitType, key []byte, value []byte) error
	GetAllCalled        func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
	GetAllStorersCalled func() map[dataRetriever.UnitType]storage.Storer
	DestroyCalled       func() error
	CloseAllCalled      func() error
}

ChainStorerStub -

func (*ChainStorerStub) AddStorer

func (css *ChainStorerStub) AddStorer(key dataRetriever.UnitType, s storage.Storer)

AddStorer -

func (*ChainStorerStub) CloseAll

func (css *ChainStorerStub) CloseAll() error

CloseAll -

func (*ChainStorerStub) Destroy

func (css *ChainStorerStub) Destroy() error

Destroy -

func (*ChainStorerStub) Get

func (css *ChainStorerStub) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)

Get -

func (*ChainStorerStub) GetAll

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

GetAll -

func (*ChainStorerStub) GetAllStorers

func (css *ChainStorerStub) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

func (*ChainStorerStub) GetStorer

func (css *ChainStorerStub) GetStorer(unitType dataRetriever.UnitType) storage.Storer

GetStorer -

func (*ChainStorerStub) Has

func (css *ChainStorerStub) Has(unitType dataRetriever.UnitType, key []byte) error

Has -

func (*ChainStorerStub) IsInterfaceNil

func (css *ChainStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ChainStorerStub) Put

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

Put -

func (*ChainStorerStub) SetEpochForPutOperation

func (css *ChainStorerStub) SetEpochForPutOperation(_ uint32)

SetEpochForPutOperation -

type HeadersCacherStub

type HeadersCacherStub struct {
	AddCalled                           func(headerHash []byte, header data.HeaderHandler)
	RemoveHeaderByHashCalled            func(headerHash []byte)
	RemoveHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32)
	GetHeaderByNonceAndShardIdCalled    func(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
	GetHeaderByHashCalled               func(hash []byte) (data.HeaderHandler, error)
	ClearCalled                         func()
	RegisterHandlerCalled               func(handler func(header data.HeaderHandler, shardHeaderHash []byte))
	NoncesCalled                        func(shardId uint32) []uint64
	LenCalled                           func() int
	MaxSizeCalled                       func() int
	GetNumHeadersCalled                 func(shardId uint32) int
}

HeadersCacherStub -

func (*HeadersCacherStub) AddHeader

func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)

AddHeader -

func (*HeadersCacherStub) Clear

func (hcs *HeadersCacherStub) Clear()

Clear -

func (*HeadersCacherStub) GetHeaderByHash

func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)

GetHeaderByHash -

func (*HeadersCacherStub) GetHeadersByNonceAndShardId

func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)

GetHeadersByNonceAndShardId -

func (*HeadersCacherStub) GetNumHeaders

func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int

GetNumHeaders -

func (*HeadersCacherStub) IsInterfaceNil

func (hcs *HeadersCacherStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeadersCacherStub) Len

func (hcs *HeadersCacherStub) Len() int

Len -

func (*HeadersCacherStub) MaxSize

func (hcs *HeadersCacherStub) MaxSize() int

MaxSize -

func (*HeadersCacherStub) Nonces

func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64

Nonces -

func (*HeadersCacherStub) RegisterHandler

func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))

RegisterHandler -

func (*HeadersCacherStub) RemoveHeaderByHash

func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)

RemoveHeaderByHash -

func (*HeadersCacherStub) RemoveHeaderByNonceAndShardId

func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)

RemoveHeaderByNonceAndShardId -

type MarshalizerStub

type MarshalizerStub struct {
	MarshalCalled   func(obj interface{}) ([]byte, error)
	UnmarshalCalled func(obj interface{}, buff []byte) error
}

MarshalizerStub -

func (*MarshalizerStub) IsInterfaceNil

func (ms *MarshalizerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MarshalizerStub) Marshal

func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error)

Marshal -

func (*MarshalizerStub) Unmarshal

func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error

Unmarshal -

Jump to

Keyboard shortcuts

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