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 EpochSubscriberHandlerStub
- type GasScheduleSubscribeHandlerStub
- type HasherMock
- type HasherStub
- type HeaderHandlerStub
- func (hhs *HeaderHandlerStub) Clone() data.HeaderHandler
- func (hhs *HeaderHandlerStub) GetAccumulatedFees() *big.Int
- func (hhs *HeaderHandlerStub) GetChainID() []byte
- func (hhs *HeaderHandlerStub) GetDeveloperFees() *big.Int
- func (hhs *HeaderHandlerStub) GetEpoch() uint32
- func (hhs *HeaderHandlerStub) GetEpochStartMetaHash() []byte
- func (hhs *HeaderHandlerStub) GetLeaderSignature() []byte
- func (hhs *HeaderHandlerStub) GetMiniBlockHeadersHashes() [][]byte
- func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32
- func (hhs *HeaderHandlerStub) GetNonce() uint64
- func (hhs *HeaderHandlerStub) GetOrderedCrossMiniblocksWithDst(destId uint32) []*data.MiniBlockInfo
- func (hhs *HeaderHandlerStub) GetPrevHash() []byte
- func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
- func (hhs *HeaderHandlerStub) GetRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetReceiptsHash() []byte
- func (hhs *HeaderHandlerStub) GetReserved() []byte
- func (hhs *HeaderHandlerStub) GetRootHash() []byte
- func (hhs *HeaderHandlerStub) GetRound() uint64
- func (hhs *HeaderHandlerStub) GetShardID() uint32
- func (hhs *HeaderHandlerStub) GetSignature() []byte
- func (hhs *HeaderHandlerStub) GetSoftwareVersion() []byte
- func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
- func (hhs *HeaderHandlerStub) GetTxCount() uint32
- func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
- func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
- func (hhs *HeaderHandlerStub) IsStartOfEpochBlock() bool
- func (hhs *HeaderHandlerStub) SetAccumulatedFees(_ *big.Int)
- func (hhs *HeaderHandlerStub) SetChainID(_ []byte)
- func (hhs *HeaderHandlerStub) SetDeveloperFees(_ *big.Int)
- func (hhs *HeaderHandlerStub) SetEpoch(_ uint32)
- func (hhs *HeaderHandlerStub) SetLeaderSignature(_ []byte)
- func (hhs *HeaderHandlerStub) SetNonce(_ uint64)
- func (hhs *HeaderHandlerStub) SetPrevHash(_ []byte)
- func (hhs *HeaderHandlerStub) SetPrevRandSeed(_ []byte)
- func (hhs *HeaderHandlerStub) SetPubKeysBitmap(_ []byte)
- func (hhs *HeaderHandlerStub) SetRandSeed(_ []byte)
- func (hhs *HeaderHandlerStub) SetRootHash(_ []byte)
- func (hhs *HeaderHandlerStub) SetRound(_ uint64)
- func (hhs *HeaderHandlerStub) SetShardID(_ uint32)
- func (hhs *HeaderHandlerStub) SetSignature(_ []byte)
- func (hhs *HeaderHandlerStub) SetSoftwareVersion(_ []byte)
- func (hhs *HeaderHandlerStub) SetTimeStamp(_ uint64)
- func (hhs *HeaderHandlerStub) SetTxCount(_ uint32)
- func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(_ []byte)
- 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 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 HeaderHandlerStub ¶
type HeaderHandlerStub struct { EpochField uint32 TimestampField uint64 GetMiniBlockHeadersWithDstCalled func(destId uint32) map[string]uint32 GetOrderedCrossMiniblocksWithDstCalled func(destId uint32) []*data.MiniBlockInfo GetPubKeysBitmapCalled func() []byte GetSignatureCalled func() []byte GetRootHashCalled func() []byte GetRandSeedCalled func() []byte GetPrevRandSeedCalled func() []byte GetPrevHashCalled func() []byte CloneCalled func() data.HeaderHandler GetChainIDCalled func() []byte CheckChainIDCalled func(reference []byte) error GetReservedCalled func() []byte IsStartOfEpochBlockCalled func() bool }
HeaderHandlerStub -
func (*HeaderHandlerStub) GetAccumulatedFees ¶
func (hhs *HeaderHandlerStub) GetAccumulatedFees() *big.Int
GetAccumulatedFees -
func (*HeaderHandlerStub) GetChainID ¶
func (hhs *HeaderHandlerStub) GetChainID() []byte
GetChainID -
func (*HeaderHandlerStub) GetDeveloperFees ¶
func (hhs *HeaderHandlerStub) GetDeveloperFees() *big.Int
GetDeveloperFees -
func (*HeaderHandlerStub) GetEpochStartMetaHash ¶
func (hhs *HeaderHandlerStub) GetEpochStartMetaHash() []byte
GetEpochStartMetaHash -
func (*HeaderHandlerStub) GetLeaderSignature ¶
func (hhs *HeaderHandlerStub) GetLeaderSignature() []byte
GetLeaderSignature -
func (*HeaderHandlerStub) GetMiniBlockHeadersHashes ¶
func (hhs *HeaderHandlerStub) GetMiniBlockHeadersHashes() [][]byte
GetMiniBlockHeadersHashes -
func (*HeaderHandlerStub) GetMiniBlockHeadersWithDst ¶
func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32
GetMiniBlockHeadersWithDst -
func (*HeaderHandlerStub) GetOrderedCrossMiniblocksWithDst ¶
func (hhs *HeaderHandlerStub) GetOrderedCrossMiniblocksWithDst(destId uint32) []*data.MiniBlockInfo
GetOrderedCrossMiniblocksWithDst -
func (*HeaderHandlerStub) GetPrevHash ¶
func (hhs *HeaderHandlerStub) GetPrevHash() []byte
GetPrevHash -
func (*HeaderHandlerStub) GetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
GetPrevRandSeed -
func (*HeaderHandlerStub) GetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
GetPubKeysBitmap -
func (*HeaderHandlerStub) GetRandSeed ¶
func (hhs *HeaderHandlerStub) GetRandSeed() []byte
GetRandSeed -
func (*HeaderHandlerStub) GetReceiptsHash ¶
func (hhs *HeaderHandlerStub) GetReceiptsHash() []byte
GetReceiptsHash -
func (*HeaderHandlerStub) GetReserved ¶
func (hhs *HeaderHandlerStub) GetReserved() []byte
GetReserved -
func (*HeaderHandlerStub) GetRootHash ¶
func (hhs *HeaderHandlerStub) GetRootHash() []byte
GetRootHash -
func (*HeaderHandlerStub) GetShardID ¶
func (hhs *HeaderHandlerStub) GetShardID() uint32
GetShardID -
func (*HeaderHandlerStub) GetSignature ¶
func (hhs *HeaderHandlerStub) GetSignature() []byte
GetSignature -
func (*HeaderHandlerStub) GetSoftwareVersion ¶
func (hhs *HeaderHandlerStub) GetSoftwareVersion() []byte
GetSoftwareVersion -
func (*HeaderHandlerStub) GetTimeStamp ¶
func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
GetTimeStamp -
func (*HeaderHandlerStub) GetTxCount ¶
func (hhs *HeaderHandlerStub) GetTxCount() uint32
GetTxCount -
func (*HeaderHandlerStub) GetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
GetValidatorStatsRootHash -
func (*HeaderHandlerStub) IsInterfaceNil ¶
func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderHandlerStub) IsStartOfEpochBlock ¶
func (hhs *HeaderHandlerStub) IsStartOfEpochBlock() bool
IsStartOfEpochBlock -
func (*HeaderHandlerStub) SetAccumulatedFees ¶
func (hhs *HeaderHandlerStub) SetAccumulatedFees(_ *big.Int)
SetAccumulatedFees -
func (*HeaderHandlerStub) SetChainID ¶
func (hhs *HeaderHandlerStub) SetChainID(_ []byte)
SetChainID -
func (*HeaderHandlerStub) SetDeveloperFees ¶
func (hhs *HeaderHandlerStub) SetDeveloperFees(_ *big.Int)
SetDeveloperFees -
func (*HeaderHandlerStub) SetLeaderSignature ¶
func (hhs *HeaderHandlerStub) SetLeaderSignature(_ []byte)
SetLeaderSignature -
func (*HeaderHandlerStub) SetPrevHash ¶
func (hhs *HeaderHandlerStub) SetPrevHash(_ []byte)
SetPrevHash -
func (*HeaderHandlerStub) SetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) SetPrevRandSeed(_ []byte)
SetPrevRandSeed -
func (*HeaderHandlerStub) SetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) SetPubKeysBitmap(_ []byte)
SetPubKeysBitmap -
func (*HeaderHandlerStub) SetRandSeed ¶
func (hhs *HeaderHandlerStub) SetRandSeed(_ []byte)
SetRandSeed -
func (*HeaderHandlerStub) SetRootHash ¶
func (hhs *HeaderHandlerStub) SetRootHash(_ []byte)
SetRootHash -
func (*HeaderHandlerStub) SetShardID ¶
func (hhs *HeaderHandlerStub) SetShardID(_ uint32)
SetShardID -
func (*HeaderHandlerStub) SetSignature ¶
func (hhs *HeaderHandlerStub) SetSignature(_ []byte)
SetSignature -
func (*HeaderHandlerStub) SetSoftwareVersion ¶
func (hhs *HeaderHandlerStub) SetSoftwareVersion(_ []byte)
SetSoftwareVersion -
func (*HeaderHandlerStub) SetTimeStamp ¶
func (hhs *HeaderHandlerStub) SetTimeStamp(_ uint64)
SetTimeStamp -
func (*HeaderHandlerStub) SetTxCount ¶
func (hhs *HeaderHandlerStub) SetTxCount(_ uint32)
SetTxCount -
func (*HeaderHandlerStub) SetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(_ []byte)
SetValidatorStatsRootHash -
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
- epochSubscriberHandlerStub.go
- gasScheduleSubscribeHandlerStub.go
- hasherMock.go
- hasherStub.go
- headerHandlerStub.go
- intRandomizerStub.go
- loggerMock.go
- marshalizerMock.go
- marshalizerStub.go
- pathManagerStub.go
- stableTagProviderStub.go
- statusHandlerMock.go