Documentation ¶
Index ¶
- Variables
- type AlarmSchedulerStub
- type ChainStorerMock
- func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerMock) CloseAll() error
- func (bc *ChainStorerMock) Destroy() error
- func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerMock) GetAllStorers() map[dataRetriever.UnitType]storage.Storer
- func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerMock) IsInterfaceNil() bool
- func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- func (bc *ChainStorerMock) SetEpochForPutOperation(_ uint32)
- type ConnectedAddressesMock
- type EpochSubscriberHandlerStub
- type GasScheduleSubscribeHandlerStub
- type IntRandomizerStub
- type MarshalizerMock
- type RoundSubscriberHandlerStub
- type StableTagProviderStub
Constants ¶
This section is empty.
Variables ¶
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")
ErrMockMarshalizer -
var ErrNilObjectToMarshal = errors.New("nil object to serialize from")
ErrNilObjectToMarshal -
Functions ¶
This section is empty.
Types ¶
type AlarmSchedulerStub ¶
type AlarmSchedulerStub struct { AddCalled func(func(alarmID string), time.Duration, string) CancelCalled func(string) CloseCalled func() ResetCalled func(string) }
AlarmSchedulerStub -
func (*AlarmSchedulerStub) Add ¶
func (a *AlarmSchedulerStub) Add(callback func(alarmID string), duration time.Duration, alarmID string)
Add -
func (*AlarmSchedulerStub) IsInterfaceNil ¶
func (a *AlarmSchedulerStub) IsInterfaceNil() bool
IsInterfaceNil -
type ChainStorerMock ¶
type ChainStorerMock 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 }
ChainStorerMock is a mock implementation of the ChainStorer interface
func (*ChainStorerMock) AddStorer ¶
func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
AddStorer will add a new storer to the chain map
func (*ChainStorerMock) Destroy ¶
func (bc *ChainStorerMock) Destroy() error
Destroy removes the underlying files/resources used by the storage service
func (*ChainStorerMock) Get ¶
func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
Get returns the value for the given key if found in the selected storage unit, nil otherwise. It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error
func (*ChainStorerMock) GetAll ¶
func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
GetAll gets all the elements with keys in the keys array, from the selected storage unit It can report an error if the provided unit type is not supported, if there is a missing key in the unit, or if the underlying implementation of the storage unit reports an error.
func (*ChainStorerMock) GetAllStorers ¶
func (bc *ChainStorerMock) GetAllStorers() map[dataRetriever.UnitType]storage.Storer
GetAllStorers -
func (*ChainStorerMock) GetStorer ¶
func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
GetStorer returns the storer from the chain map or nil if the storer was not found
func (*ChainStorerMock) Has ¶
func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
Has returns true if the key is found in the selected Unit or false otherwise It can return an error if the provided unit type is not supported or if the underlying implementation of the storage unit reports an error.
func (*ChainStorerMock) IsInterfaceNil ¶
func (bc *ChainStorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ChainStorerMock) Put ¶
func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
Put stores the key, value pair in the selected storage unit It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error
func (*ChainStorerMock) SetEpochForPutOperation ¶
func (bc *ChainStorerMock) SetEpochForPutOperation(_ uint32)
SetEpochForPutOperation won't do anything
type ConnectedAddressesMock ¶
type ConnectedAddressesMock struct { }
ConnectedAddressesMock represents a mock implementation of the ConnectedAddresses
func (*ConnectedAddressesMock) ConnectedAddresses ¶
func (cam *ConnectedAddressesMock) ConnectedAddresses() []string
ConnectedAddresses returns an empty slice of string
type EpochSubscriberHandlerStub ¶
type EpochSubscriberHandlerStub struct {
EpochConfirmedCalled func(epoch uint32, timestamp uint64)
}
EpochSubscriberHandlerStub -
func (*EpochSubscriberHandlerStub) EpochConfirmed ¶
func (eshs *EpochSubscriberHandlerStub) EpochConfirmed(epoch uint32, timestamp uint64)
EpochConfirmed -
func (*EpochSubscriberHandlerStub) IsInterfaceNil ¶
func (eshs *EpochSubscriberHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type GasScheduleSubscribeHandlerStub ¶
type GasScheduleSubscribeHandlerStub struct {
GasScheduleChangeCalled func(gasSchedule map[string]map[string]uint64)
}
GasScheduleSubscribeHandlerStub -
func (*GasScheduleSubscribeHandlerStub) GasScheduleChange ¶
func (g *GasScheduleSubscribeHandlerStub) GasScheduleChange(gasSchedule map[string]map[string]uint64)
GasScheduleChange -
func (*GasScheduleSubscribeHandlerStub) IsInterfaceNil ¶
func (g *GasScheduleSubscribeHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type IntRandomizerStub ¶
IntRandomizerStub -
func (*IntRandomizerStub) IsInterfaceNil ¶
func (irs *IntRandomizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type MarshalizerMock ¶
type MarshalizerMock struct {
Fail bool
}
MarshalizerMock that will be used for testing
func (*MarshalizerMock) IsInterfaceNil ¶
func (mm *MarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerMock) Marshal ¶
func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerMock) Unmarshal ¶
func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type RoundSubscriberHandlerStub ¶ added in v1.3.0
type RoundSubscriberHandlerStub struct {
RoundConfirmedCalled func(round uint64)
}
RoundSubscriberHandlerStub -
func (*RoundSubscriberHandlerStub) IsInterfaceNil ¶ added in v1.3.0
func (rsh *RoundSubscriberHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*RoundSubscriberHandlerStub) RoundConfirmed ¶ added in v1.3.0
func (rsh *RoundSubscriberHandlerStub) RoundConfirmed(round uint64)
RoundConfirmed -
type StableTagProviderStub ¶
StableTagProviderStub --
func (*StableTagProviderStub) FetchTagVersion ¶
func (s *StableTagProviderStub) FetchTagVersion() (string, error)
FetchTagVersion --
func (*StableTagProviderStub) IsInterfaceNil ¶
func (s *StableTagProviderStub) IsInterfaceNil() bool
IsInterfaceNil --