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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultipleShardsCoordinatorFake

func NewMultipleShardsCoordinatorFake(numOfShards uint32, currentShard uint32) *multipleShardsCoordinatorFake

NewMultipleShardsCoordinatorFake -

Types

type EpochHandlerMock

type EpochHandlerMock struct {
	EpochValue uint32
}

EpochHandlerMock -

func (*EpochHandlerMock) Epoch

func (ehm *EpochHandlerMock) Epoch() uint32

Epoch -

func (*EpochHandlerMock) IsInterfaceNil

func (ehm *EpochHandlerMock) IsInterfaceNil() bool

IsInterfaceNil -

type EpochHandlerStub

type EpochHandlerStub struct {
	EpochCalled func() uint32
}

EpochHandlerStub -

func (*EpochHandlerStub) Epoch

func (ehs *EpochHandlerStub) Epoch() uint32

Epoch -

func (*EpochHandlerStub) IsInterfaceNil

func (ehs *EpochHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type EpochStartNotifierStub

type EpochStartNotifierStub struct {
	RegisterHandlerCalled   func(handler epochStart.ActionHandler)
	UnregisterHandlerCalled func(handler epochStart.ActionHandler)
	NotifyAllPrepareCalled  func(hdr data.HeaderHandler, body data.BodyHandler)
	NotifyAllCalled         func(hdr data.HeaderHandler)
}

EpochStartNotifierStub -

func (*EpochStartNotifierStub) IsInterfaceNil

func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartNotifierStub) NotifyAll

func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)

NotifyAll -

func (*EpochStartNotifierStub) NotifyAllPrepare

func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)

NotifyAllPrepare -

func (*EpochStartNotifierStub) RegisterHandler

func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)

RegisterHandler -

func (*EpochStartNotifierStub) UnregisterHandler

func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)

UnregisterHandler -

type HasherStub

type HasherStub struct {
	ComputeCalled   func(s string) []byte
	EmptyHashCalled func() []byte
	SizeCalled      func() int
}

HasherStub -

func (*HasherStub) Compute

func (hs *HasherStub) Compute(s string) []byte

Compute will output the SHA's equivalent of the input string

func (*HasherStub) EmptyHash

func (hs *HasherStub) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (*HasherStub) IsInterfaceNil

func (hs *HasherStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HasherStub) Size

func (hs *HasherStub) Size() int

Size returns the required size in bytes

type ListIndexUpdaterStub

type ListIndexUpdaterStub struct {
	UpdateListAndIndexCalled func(pubKey string, shardID uint32, list string, index uint32) error
}

ListIndexUpdaterStub -

func (*ListIndexUpdaterStub) IsInterfaceNil

func (lius *ListIndexUpdaterStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ListIndexUpdaterStub) UpdateListAndIndex

func (lius *ListIndexUpdaterStub) UpdateListAndIndex(pubKey string, shardID uint32, list string, index uint32) error

UpdateListAndIndex -

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 NodesCoordinatorCacheMock

type NodesCoordinatorCacheMock struct {
	ClearCalled func()
	PutCalled   func(key []byte, value interface{}, sieInBytes int) (evicted bool)
	GetCalled   func(key []byte) (value interface{}, ok bool)
}

NodesCoordinatorCacheMock -

func (*NodesCoordinatorCacheMock) Clear

func (rm *NodesCoordinatorCacheMock) Clear()

Clear -

func (*NodesCoordinatorCacheMock) Get

func (rm *NodesCoordinatorCacheMock) Get(key []byte) (value interface{}, ok bool)

Get -

func (*NodesCoordinatorCacheMock) Put

func (rm *NodesCoordinatorCacheMock) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)

Put -

type PubkeyConverterMock

type PubkeyConverterMock struct {
	// contains filtered or unexported fields
}

PubkeyConverterMock -

func NewPubkeyConverterMock

func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock

NewPubkeyConverterMock -

func (*PubkeyConverterMock) Decode

func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterMock) Encode

func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterMock) IsInterfaceNil

func (pcm *PubkeyConverterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterMock) Len

func (pcm *PubkeyConverterMock) Len() int

Len -

type RaterMock

type RaterMock struct {
	ComputeRatingCalled  func(string, uint32) uint32
	GetRatingCalled      func(string) uint32
	GetStartRatingCalled func() uint32
	GetChancesCalled     func(uint32) uint32
}

RaterMock -

func (*RaterMock) ComputeRating

func (rm *RaterMock) ComputeRating(ratingOptionKey string, previousValue uint32) uint32

ComputeRating -

func (*RaterMock) GetChance

func (rm *RaterMock) GetChance(rating uint32) uint32

GetChance -

func (*RaterMock) GetRating

func (rm *RaterMock) GetRating(pk string) uint32

GetRating -

func (*RaterMock) GetStartRating

func (rm *RaterMock) GetStartRating() uint32

GetStartRating -

func (*RaterMock) IsInterfaceNil

func (rm *RaterMock) IsInterfaceNil() bool

IsInterfaceNil -

type ShuffledOutHandlerStub

type ShuffledOutHandlerStub struct {
	ProcessCalled         func(newShardID uint32) error
	RegisterHandlerCalled func(handler func(newShardID uint32))
	CurrentShardIDCalled  func() uint32
}

ShuffledOutHandlerStub -

func (*ShuffledOutHandlerStub) CurrentShardID

func (s *ShuffledOutHandlerStub) CurrentShardID() uint32

CurrentShardID -

func (*ShuffledOutHandlerStub) IsInterfaceNil

func (s *ShuffledOutHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ShuffledOutHandlerStub) Process

func (s *ShuffledOutHandlerStub) Process(newShardID uint32) error

Process -

func (*ShuffledOutHandlerStub) RegisterHandler

func (s *ShuffledOutHandlerStub) RegisterHandler(handler func(newShardID uint32))

RegisterHandler -

Jump to

Keyboard shortcuts

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