Documentation ¶
Index ¶
- Variables
- type AlarmSchedulerStub
- type AppStatusHandlerStub
- func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
- func (ashs *AppStatusHandlerStub) Close()
- func (ashs *AppStatusHandlerStub) Decrement(key string)
- func (ashs *AppStatusHandlerStub) Increment(key string)
- func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
- func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
- func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
- func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
- type ConnectedAddressesMock
- type EnableEpochsHandlerStub
- func (stub *EnableEpochsHandlerStub) GetActivationEpoch(flag core.EnableEpochFlag) uint32
- func (stub *EnableEpochsHandlerStub) IsFlagDefined(flag core.EnableEpochFlag) bool
- func (stub *EnableEpochsHandlerStub) IsFlagEnabled(flag core.EnableEpochFlag) bool
- func (stub *EnableEpochsHandlerStub) IsFlagEnabledInEpoch(flag core.EnableEpochFlag, epoch uint32) bool
- func (stub *EnableEpochsHandlerStub) IsInterfaceNil() bool
- type EpochSubscriberHandlerStub
- type GasScheduleSubscribeHandlerStub
- type HasherMock
- type HasherStub
- type IntRandomizerStub
- type LoggerMock
- func (c LoggerMock) Debug(message string, args ...interface{})
- func (c LoggerMock) Error(message string, args ...interface{})
- func (c LoggerMock) Info(message string, args ...interface{})
- func (c LoggerMock) IsInterfaceNil() bool
- func (c LoggerMock) LogIfError(err error, args ...interface{})
- func (c LoggerMock) Trace(message string, args ...interface{})
- func (c LoggerMock) Warn(message string, args ...interface{})
- type MarshalizerMock
- type MarshalizerStub
- type PathManagerStub
- type StableTagProviderStub
- type StatusHandlerMock
- func (s *StatusHandlerMock) AddUint64(_ string, _ uint64)
- func (s *StatusHandlerMock) Close()
- func (s *StatusHandlerMock) Decrement(_ string)
- func (s *StatusHandlerMock) Increment(_ string)
- func (s *StatusHandlerMock) IsInterfaceNil() bool
- func (s *StatusHandlerMock) SetInt64Value(_ string, _ int64)
- func (s *StatusHandlerMock) SetStringValue(_ string, _ string)
- func (s *StatusHandlerMock) SetUInt64Value(_ string, _ uint64)
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 AppStatusHandlerStub ¶
type AppStatusHandlerStub struct { AddUint64Handler func(key string, value uint64) IncrementHandler func(key string) DecrementHandler func(key string) SetUInt64ValueHandler func(key string, value uint64) SetInt64ValueHandler func(key string, value int64) SetStringValueHandler func(key string, value string) CloseHandler func() }
AppStatusHandlerStub is a stub implementation of AppStatusHandler
func (*AppStatusHandlerStub) AddUint64 ¶
func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
AddUint64 will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) Close ¶
func (ashs *AppStatusHandlerStub) Close()
Close will call the handler of the stub for closing
func (*AppStatusHandlerStub) Decrement ¶
func (ashs *AppStatusHandlerStub) Decrement(key string)
Decrement will call the handler of the stub for decrementing
func (*AppStatusHandlerStub) Increment ¶
func (ashs *AppStatusHandlerStub) Increment(key string)
Increment will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) IsInterfaceNil ¶
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AppStatusHandlerStub) SetInt64Value ¶
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
SetInt64Value will call the handler of the stub for setting an int64 value
func (*AppStatusHandlerStub) SetStringValue ¶
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
SetStringValue will call the handler of the stub for setting an string value
func (*AppStatusHandlerStub) SetUInt64Value ¶
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
SetUInt64Value will call the handler of the stub for setting an uint64 value
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 EnableEpochsHandlerStub ¶
type EnableEpochsHandlerStub struct { IsFlagDefinedCalled func(flag core.EnableEpochFlag) bool IsFlagEnabledCalled func(flag core.EnableEpochFlag) bool IsFlagEnabledInEpochCalled func(flag core.EnableEpochFlag, epoch uint32) bool GetActivationEpochCalled func(flag core.EnableEpochFlag) uint32 }
EnableEpochsHandlerStub -
func (*EnableEpochsHandlerStub) GetActivationEpoch ¶
func (stub *EnableEpochsHandlerStub) GetActivationEpoch(flag core.EnableEpochFlag) uint32
GetActivationEpoch -
func (*EnableEpochsHandlerStub) IsFlagDefined ¶
func (stub *EnableEpochsHandlerStub) IsFlagDefined(flag core.EnableEpochFlag) bool
IsFlagDefined -
func (*EnableEpochsHandlerStub) IsFlagEnabled ¶
func (stub *EnableEpochsHandlerStub) IsFlagEnabled(flag core.EnableEpochFlag) bool
IsFlagEnabled -
func (*EnableEpochsHandlerStub) IsFlagEnabledInEpoch ¶
func (stub *EnableEpochsHandlerStub) IsFlagEnabledInEpoch(flag core.EnableEpochFlag, epoch uint32) bool
IsFlagEnabledInEpoch -
func (*EnableEpochsHandlerStub) IsInterfaceNil ¶
func (stub *EnableEpochsHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
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 HasherMock ¶
type HasherMock struct { }
HasherMock that will be used for testing
func (HasherMock) Compute ¶
func (sha HasherMock) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (HasherMock) EmptyHash ¶
func (sha HasherMock) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
func (HasherMock) IsInterfaceNil ¶
func (sha HasherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type HasherStub ¶
type HasherStub struct { ComputeCalled func(s string) []byte EmptyHashCalled func() []byte SizeCalled func() int }
HasherStub -
func (*HasherStub) IsInterfaceNil ¶
func (hash *HasherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type IntRandomizerStub ¶
IntRandomizerStub -
func (*IntRandomizerStub) IsInterfaceNil ¶
func (irs *IntRandomizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type LoggerMock ¶
type LoggerMock struct { }
LoggerMock -
func (LoggerMock) Debug ¶
func (c LoggerMock) Debug(message string, args ...interface{})
Debug will print a debug log
func (LoggerMock) Error ¶
func (c LoggerMock) Error(message string, args ...interface{})
Error will print an error log
func (LoggerMock) Info ¶
func (c LoggerMock) Info(message string, args ...interface{})
Info will print an info log
func (LoggerMock) IsInterfaceNil ¶
func (c LoggerMock) IsInterfaceNil() bool
IsInterfaceNil returns false as the struct doesn't use pointer receivers
func (LoggerMock) LogIfError ¶
func (c LoggerMock) LogIfError(err error, args ...interface{})
LogIfError will print an error if it is not nil
func (LoggerMock) Trace ¶
func (c LoggerMock) Trace(message string, args ...interface{})
Trace will print a trace log
func (LoggerMock) Warn ¶
func (c LoggerMock) Warn(message string, args ...interface{})
Warn will print a warn log
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 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 -
type PathManagerStub ¶
type PathManagerStub struct { PathForEpochCalled func(shardId string, epoch uint32, identifier string) string PathForStaticCalled func(shardId string, identifier string) string DatabasePathCalled func() string }
PathManagerStub -
func (*PathManagerStub) DatabasePath ¶
func (p *PathManagerStub) DatabasePath() string
DatabasePath -
func (*PathManagerStub) IsInterfaceNil ¶
func (p *PathManagerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PathManagerStub) PathForEpoch ¶
func (p *PathManagerStub) PathForEpoch(shardId string, epoch uint32, identifier string) string
PathForEpoch -
func (*PathManagerStub) PathForStatic ¶
func (p *PathManagerStub) PathForStatic(shardId string, identifier string) string
PathForStatic -
type StableTagProviderStub ¶
StableTagProviderStub --
func (*StableTagProviderStub) FetchTagVersion ¶
func (s *StableTagProviderStub) FetchTagVersion() (string, error)
FetchTagVersion --
func (*StableTagProviderStub) IsInterfaceNil ¶
func (s *StableTagProviderStub) IsInterfaceNil() bool
IsInterfaceNil --
type StatusHandlerMock ¶
type StatusHandlerMock struct { }
StatusHandlerMock -
func (*StatusHandlerMock) AddUint64 ¶
func (s *StatusHandlerMock) AddUint64(_ string, _ uint64)
AddUint64 -
func (*StatusHandlerMock) IsInterfaceNil ¶
func (s *StatusHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*StatusHandlerMock) SetInt64Value ¶
func (s *StatusHandlerMock) SetInt64Value(_ string, _ int64)
SetInt64Value -
func (*StatusHandlerMock) SetStringValue ¶
func (s *StatusHandlerMock) SetStringValue(_ string, _ string)
SetStringValue -
func (*StatusHandlerMock) SetUInt64Value ¶
func (s *StatusHandlerMock) SetUInt64Value(_ string, _ uint64)
SetUInt64Value -
Source Files ¶
- alarmSchedulerStub.go
- appStatusHandlerStub.go
- connectedAddressesHandlerMock.go
- enableEpochsHandlerStub.go
- epochSubscriberHandlerStub.go
- gasScheduleSubscribeHandlerStub.go
- hasherMock.go
- hasherStub.go
- intRandomizerStub.go
- loggerMock.go
- marshalizerMock.go
- marshalizerStub.go
- pathManagerStub.go
- stableTagProviderStub.go
- statusHandlerMock.go