mock

package
v1.4.17 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterceptedMetaBlockMock

func NewInterceptedMetaBlockMock(hdr data.HeaderHandler, hash []byte) *interceptedMetaBlockMock

NewInterceptedMetaBlockMock -

func NewMultiShardsCoordinatorMock

func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock

NewMultiShardsCoordinatorMock -

func NewMultipleShardsCoordinatorMock

func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock

NewMultipleShardsCoordinatorMock -

Types

type AddressMock

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

AddressMock is the struct holding a mock address

func NewAddressMock

func NewAddressMock(adr []byte) *AddressMock

NewAddressMock creates a new Address with the same byte slice as the parameter received

func (*AddressMock) Bytes

func (adr *AddressMock) Bytes() []byte

Bytes returns the data corresponding to this address

func (*AddressMock) IsInterfaceNil

func (adr *AddressMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type ArgumentParserMock

type ArgumentParserMock struct {
	ParseCallDataCalled               func(data string) (string, [][]byte, error)
	ParseArgumentsCalled              func(data string) ([][]byte, error)
	ParseDeployDataCalled             func(data string) (*parsers.DeployArgs, error)
	CreateDataFromStorageUpdateCalled func(storageUpdates []*vmcommon.StorageUpdate) string
	GetStorageUpdatesCalled           func(data string) ([]*vmcommon.StorageUpdate, error)
}

ArgumentParserMock -

func (*ArgumentParserMock) CreateDataFromStorageUpdate

func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string

CreateDataFromStorageUpdate -

func (*ArgumentParserMock) GetStorageUpdates

func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)

GetStorageUpdates -

func (*ArgumentParserMock) IsInterfaceNil

func (ap *ArgumentParserMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ArgumentParserMock) ParseArguments

func (ap *ArgumentParserMock) ParseArguments(data string) ([][]byte, error)

ParseArguments -

func (*ArgumentParserMock) ParseCallData

func (ap *ArgumentParserMock) ParseCallData(data string) (string, [][]byte, error)

ParseCallData -

func (*ArgumentParserMock) ParseDeployData

func (ap *ArgumentParserMock) ParseDeployData(data string) (*parsers.DeployArgs, error)

ParseDeployData -

type BuiltInCostHandlerStub

type BuiltInCostHandlerStub struct {
}

BuiltInCostHandlerStub -

func (*BuiltInCostHandlerStub) ComputeBuiltInCost

ComputeBuiltInCost -

func (*BuiltInCostHandlerStub) IsBuiltInFuncCall

IsBuiltInFuncCall -

func (*BuiltInCostHandlerStub) IsInterfaceNil

func (b *BuiltInCostHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type ChanceComputerStub

type ChanceComputerStub struct {
	GetChanceCalled func(rating uint32) uint32
}

ChanceComputerStub -

func (*ChanceComputerStub) GetChance

func (c *ChanceComputerStub) GetChance(rating uint32) uint32

GetChance -

func (*ChanceComputerStub) IsInterfaceNil

func (c *ChanceComputerStub) IsInterfaceNil() bool

IsInterfaceNil -

type CoreComponentsMock

type CoreComponentsMock struct {
	IntMarsh                     marshal.Marshalizer
	Marsh                        marshal.Marshalizer
	Hash                         hashing.Hasher
	EpochNotifierField           process.EpochNotifier
	EnableEpochsHandlerField     common.EnableEpochsHandler
	TxSignHasherField            hashing.Hasher
	UInt64ByteSliceConv          typeConverters.Uint64ByteSliceConverter
	AddrPubKeyConv               core.PubkeyConverter
	ValPubKeyConv                core.PubkeyConverter
	PathHdl                      storage.PathManagerHandler
	ChainIdCalled                func() string
	MinTransactionVersionCalled  func() uint32
	GenesisNodesSetupCalled      func() sharding.GenesisNodesSetupHandler
	TxVersionCheckField          process.TxVersionCheckerHandler
	ChanStopNode                 chan endProcess.ArgEndProcess
	NodeTypeProviderField        core.NodeTypeProviderHandler
	ProcessStatusHandlerInstance common.ProcessStatusHandler
	HardforkTriggerPubKeyField   []byte
	// contains filtered or unexported fields
}

CoreComponentsMock -

func (*CoreComponentsMock) AddressPubKeyConverter

func (ccm *CoreComponentsMock) AddressPubKeyConverter() core.PubkeyConverter

AddressPubKeyConverter -

func (*CoreComponentsMock) ChainID

func (ccm *CoreComponentsMock) ChainID() string

ChainID -

func (*CoreComponentsMock) ChanStopNodeProcess

func (ccm *CoreComponentsMock) ChanStopNodeProcess() chan endProcess.ArgEndProcess

ChanStopNodeProcess -

func (*CoreComponentsMock) EnableEpochsHandler

func (ccm *CoreComponentsMock) EnableEpochsHandler() common.EnableEpochsHandler

EnableEpochsHandler -

func (*CoreComponentsMock) EpochNotifier

func (ccm *CoreComponentsMock) EpochNotifier() process.EpochNotifier

EpochNotifier -

func (*CoreComponentsMock) GenesisNodesSetup

func (ccm *CoreComponentsMock) GenesisNodesSetup() sharding.GenesisNodesSetupHandler

GenesisNodesSetup -

func (*CoreComponentsMock) HardforkTriggerPubKey

func (ccm *CoreComponentsMock) HardforkTriggerPubKey() []byte

HardforkTriggerPubKey -

func (*CoreComponentsMock) Hasher

func (ccm *CoreComponentsMock) Hasher() hashing.Hasher

Hasher -

func (*CoreComponentsMock) InternalMarshalizer

func (ccm *CoreComponentsMock) InternalMarshalizer() marshal.Marshalizer

InternalMarshalizer -

func (*CoreComponentsMock) IsInterfaceNil

func (ccm *CoreComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CoreComponentsMock) MinTransactionVersion

func (ccm *CoreComponentsMock) MinTransactionVersion() uint32

MinTransactionVersion -

func (*CoreComponentsMock) NodeTypeProvider

func (ccm *CoreComponentsMock) NodeTypeProvider() core.NodeTypeProviderHandler

NodeTypeProvider -

func (*CoreComponentsMock) PathHandler

func (ccm *CoreComponentsMock) PathHandler() storage.PathManagerHandler

PathHandler -

func (*CoreComponentsMock) ProcessStatusHandler

func (ccm *CoreComponentsMock) ProcessStatusHandler() common.ProcessStatusHandler

ProcessStatusHandler -

func (*CoreComponentsMock) SetInternalMarshalizer

func (ccm *CoreComponentsMock) SetInternalMarshalizer(m marshal.Marshalizer) error

SetInternalMarshalizer -

func (*CoreComponentsMock) TxMarshalizer

func (ccm *CoreComponentsMock) TxMarshalizer() marshal.Marshalizer

TxMarshalizer -

func (*CoreComponentsMock) TxSignHasher

func (ccm *CoreComponentsMock) TxSignHasher() hashing.Hasher

TxSignHasher -

func (*CoreComponentsMock) TxVersionChecker

func (ccm *CoreComponentsMock) TxVersionChecker() process.TxVersionCheckerHandler

TxVersionChecker -

func (*CoreComponentsMock) Uint64ByteSliceConverter

func (ccm *CoreComponentsMock) Uint64ByteSliceConverter() typeConverters.Uint64ByteSliceConverter

Uint64ByteSliceConverter -

func (*CoreComponentsMock) ValidatorPubKeyConverter

func (ccm *CoreComponentsMock) ValidatorPubKeyConverter() core.PubkeyConverter

ValidatorPubKeyConverter -

type CryptoComponentsMock

type CryptoComponentsMock struct {
	PrivKey           crypto.PrivateKey
	PubKey            crypto.PublicKey
	BlockSig          crypto.SingleSigner
	TxSig             crypto.SingleSigner
	MultiSigContainer cryptoCommon.MultiSignerContainer
	PeerSignHandler   crypto.PeerSignatureHandler
	BlKeyGen          crypto.KeyGenerator
	TxKeyGen          crypto.KeyGenerator
	// contains filtered or unexported fields
}

CryptoComponentsMock -

func (*CryptoComponentsMock) BlockSignKeyGen

func (ccm *CryptoComponentsMock) BlockSignKeyGen() crypto.KeyGenerator

BlockSignKeyGen -

func (*CryptoComponentsMock) BlockSigner

func (ccm *CryptoComponentsMock) BlockSigner() crypto.SingleSigner

BlockSigner -

func (*CryptoComponentsMock) Clone

func (ccm *CryptoComponentsMock) Clone() interface{}

Clone -

func (*CryptoComponentsMock) GetMultiSigner

func (ccm *CryptoComponentsMock) GetMultiSigner(epoch uint32) (crypto.MultiSigner, error)

GetMultiSigner -

func (*CryptoComponentsMock) IsInterfaceNil

func (ccm *CryptoComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CryptoComponentsMock) MultiSignerContainer

func (ccm *CryptoComponentsMock) MultiSignerContainer() cryptoCommon.MultiSignerContainer

MultiSignerContainer -

func (*CryptoComponentsMock) PeerSignatureHandler

func (ccm *CryptoComponentsMock) PeerSignatureHandler() crypto.PeerSignatureHandler

PeerSignatureHandler -

func (*CryptoComponentsMock) PrivateKey

func (ccm *CryptoComponentsMock) PrivateKey() crypto.PrivateKey

PrivateKey -

func (*CryptoComponentsMock) PublicKey

func (ccm *CryptoComponentsMock) PublicKey() crypto.PublicKey

PublicKey -

func (*CryptoComponentsMock) SetMultiSignerContainer

func (ccm *CryptoComponentsMock) SetMultiSignerContainer(msc cryptoCommon.MultiSignerContainer) error

SetMultiSignerContainer -

func (*CryptoComponentsMock) TxSignKeyGen

func (ccm *CryptoComponentsMock) TxSignKeyGen() crypto.KeyGenerator

TxSignKeyGen -

func (*CryptoComponentsMock) TxSingleSigner

func (ccm *CryptoComponentsMock) TxSingleSigner() crypto.SingleSigner

TxSingleSigner -

type EconomicsHandlerStub

type EconomicsHandlerStub struct {
	MaxGasLimitPerBlockCalled                      func() uint64
	MaxGasLimitPerMiniBlockCalled                  func() uint64
	MaxGasLimitPerBlockForSafeCrossShardCalled     func() uint64
	MaxGasLimitPerMiniBlockForSafeCrossShardCalled func() uint64
	MaxGasLimitPerTxCalled                         func() uint64
	SetMinGasPriceCalled                           func(minasPrice uint64)
	SetMinGasLimitCalled                           func(minGasLimit uint64)
	ComputeGasLimitCalled                          func(tx data.TransactionWithFeeHandler) uint64
	ComputeMoveBalanceFeeCalled                    func(tx data.TransactionWithFeeHandler) *big.Int
	ComputeTxFeeCalled                             func(tx data.TransactionWithFeeHandler) *big.Int
	CheckValidityTxValuesCalled                    func(tx data.TransactionWithFeeHandler) error
	DeveloperPercentageCalled                      func() float64
	MinGasPriceCalled                              func() uint64
	LeaderPercentageCalled                         func() float64
	ProtocolSustainabilityPercentageCalled         func() float64
	ProtocolSustainabilityAddressCalled            func() string
	MinInflationRateCalled                         func() float64
	MaxInflationRateCalled                         func(year uint32) float64
	ComputeFeeForProcessingCalled                  func(tx data.TransactionWithFeeHandler, gasToUse uint64) *big.Int
	GasPriceModifierCalled                         func() float64
	SplitTxGasInCategoriesCalled                   func(tx data.TransactionWithFeeHandler) (uint64, uint64)
	GasPriceForProcessingCalled                    func(tx data.TransactionWithFeeHandler) uint64
	GasPriceForMoveCalled                          func(tx data.TransactionWithFeeHandler) uint64
	MinGasPriceForProcessingCalled                 func() uint64
	ComputeGasUsedAndFeeBasedOnRefundValueCalled   func(tx data.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)
	ComputeTxFeeBasedOnGasUsedCalled               func(tx data.TransactionWithFeeHandler, gasUsed uint64) *big.Int
	RewardsTopUpGradientPointCalled                func() *big.Int
	RewardsTopUpFactorCalled                       func() float64
	ComputeGasLimitBasedOnBalanceCalled            func(tx data.TransactionWithFeeHandler, balance *big.Int) (uint64, error)
	SetStatusHandlerCalled                         func(statusHandler core.AppStatusHandler) error
}

EconomicsHandlerStub -

func (*EconomicsHandlerStub) CheckValidityTxValues

func (ehs *EconomicsHandlerStub) CheckValidityTxValues(tx data.TransactionWithFeeHandler) error

CheckValidityTxValues -

func (*EconomicsHandlerStub) ComputeFeeForProcessing

func (ehs *EconomicsHandlerStub) ComputeFeeForProcessing(tx data.TransactionWithFeeHandler, gasToUse uint64) *big.Int

ComputeFeeForProcessing -

func (*EconomicsHandlerStub) ComputeGasLimit

func (ehs *EconomicsHandlerStub) ComputeGasLimit(tx data.TransactionWithFeeHandler) uint64

ComputeGasLimit -

func (*EconomicsHandlerStub) ComputeGasLimitBasedOnBalance

func (ehs *EconomicsHandlerStub) ComputeGasLimitBasedOnBalance(tx data.TransactionWithFeeHandler, balance *big.Int) (uint64, error)

ComputeGasLimitBasedOnBalance -

func (*EconomicsHandlerStub) ComputeGasUsedAndFeeBasedOnRefundValue

func (ehs *EconomicsHandlerStub) ComputeGasUsedAndFeeBasedOnRefundValue(tx data.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)

ComputeGasUsedAndFeeBasedOnRefundValue -

func (*EconomicsHandlerStub) ComputeMoveBalanceFee

func (ehs *EconomicsHandlerStub) ComputeMoveBalanceFee(tx data.TransactionWithFeeHandler) *big.Int

ComputeMoveBalanceFee -

func (*EconomicsHandlerStub) ComputeTxFee

ComputeTxFee -

func (*EconomicsHandlerStub) ComputeTxFeeBasedOnGasUsed

func (ehs *EconomicsHandlerStub) ComputeTxFeeBasedOnGasUsed(tx data.TransactionWithFeeHandler, gasUsed uint64) *big.Int

ComputeTxFeeBasedOnGasUsed -

func (*EconomicsHandlerStub) DeveloperPercentage

func (ehs *EconomicsHandlerStub) DeveloperPercentage() float64

DeveloperPercentage -

func (*EconomicsHandlerStub) GasPerDataByte

func (ehs *EconomicsHandlerStub) GasPerDataByte() uint64

GasPerDataByte -

func (*EconomicsHandlerStub) GasPriceForMove

func (ehs *EconomicsHandlerStub) GasPriceForMove(tx data.TransactionWithFeeHandler) uint64

GasPriceForMove -

func (*EconomicsHandlerStub) GasPriceForProcessing

func (ehs *EconomicsHandlerStub) GasPriceForProcessing(tx data.TransactionWithFeeHandler) uint64

GasPriceForProcessing -

func (*EconomicsHandlerStub) GasPriceModifier

func (ehs *EconomicsHandlerStub) GasPriceModifier() float64

GasPriceModifier -

func (*EconomicsHandlerStub) GenesisTotalSupply

func (ehs *EconomicsHandlerStub) GenesisTotalSupply() *big.Int

GenesisTotalSupply -

func (*EconomicsHandlerStub) IsInterfaceNil

func (ehs *EconomicsHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*EconomicsHandlerStub) LeaderPercentage

func (ehs *EconomicsHandlerStub) LeaderPercentage() float64

LeaderPercentage -

func (*EconomicsHandlerStub) MaxGasLimitPerBlock

func (ehs *EconomicsHandlerStub) MaxGasLimitPerBlock(uint32) uint64

MaxGasLimitPerBlock -

func (*EconomicsHandlerStub) MaxGasLimitPerBlockForSafeCrossShard

func (ehs *EconomicsHandlerStub) MaxGasLimitPerBlockForSafeCrossShard() uint64

MaxGasLimitPerBlockForSafeCrossShard -

func (*EconomicsHandlerStub) MaxGasLimitPerMiniBlock

func (ehs *EconomicsHandlerStub) MaxGasLimitPerMiniBlock(uint32) uint64

MaxGasLimitPerMiniBlock -

func (*EconomicsHandlerStub) MaxGasLimitPerMiniBlockForSafeCrossShard

func (ehs *EconomicsHandlerStub) MaxGasLimitPerMiniBlockForSafeCrossShard() uint64

MaxGasLimitPerMiniBlockForSafeCrossShard -

func (*EconomicsHandlerStub) MaxGasLimitPerTx

func (ehs *EconomicsHandlerStub) MaxGasLimitPerTx() uint64

MaxGasLimitPerTx -

func (*EconomicsHandlerStub) MaxInflationRate

func (ehs *EconomicsHandlerStub) MaxInflationRate(year uint32) float64

MaxInflationRate -

func (*EconomicsHandlerStub) MinGasLimit

func (ehs *EconomicsHandlerStub) MinGasLimit() uint64

MinGasLimit will return min gas limit

func (*EconomicsHandlerStub) MinGasPrice

func (ehs *EconomicsHandlerStub) MinGasPrice() uint64

MinGasPrice -

func (*EconomicsHandlerStub) MinGasPriceForProcessing

func (ehs *EconomicsHandlerStub) MinGasPriceForProcessing() uint64

MinGasPriceForProcessing -

func (*EconomicsHandlerStub) MinInflationRate

func (ehs *EconomicsHandlerStub) MinInflationRate() float64

MinInflationRate -

func (*EconomicsHandlerStub) ProtocolSustainabilityAddress

func (ehs *EconomicsHandlerStub) ProtocolSustainabilityAddress() string

ProtocolSustainabilityAddress will return the protocol sustainability address

func (*EconomicsHandlerStub) ProtocolSustainabilityPercentage

func (ehs *EconomicsHandlerStub) ProtocolSustainabilityPercentage() float64

ProtocolSustainabilityPercentage will return the protocol sustainability percentage value

func (*EconomicsHandlerStub) RewardsTopUpFactor

func (ehs *EconomicsHandlerStub) RewardsTopUpFactor() float64

RewardsTopUpFactor -

func (*EconomicsHandlerStub) RewardsTopUpGradientPoint

func (ehs *EconomicsHandlerStub) RewardsTopUpGradientPoint() *big.Int

RewardsTopUpGradientPoint -

func (*EconomicsHandlerStub) SetStatusHandler

func (ehs *EconomicsHandlerStub) SetStatusHandler(statusHandler core.AppStatusHandler) error

SetStatusHandler -

func (*EconomicsHandlerStub) SplitTxGasInCategories

func (ehs *EconomicsHandlerStub) SplitTxGasInCategories(tx data.TransactionWithFeeHandler) (uint64, uint64)

SplitTxGasInCategories -

type EpochStartMetaBlockProcessorStub

type EpochStartMetaBlockProcessorStub struct {
	ValidateCalled               func(data process.InterceptedData, fromConnectedPeer core.PeerID) error
	SaveCalled                   func(data process.InterceptedData, fromConnectedPeer core.PeerID, topic string) error
	RegisterHandlerCalled        func(handler func(topic string, hash []byte, data interface{}))
	GetEpochStartMetaBlockCalled func(ctx context.Context) (data.MetaHeaderHandler, error)
}

EpochStartMetaBlockProcessorStub -

func (*EpochStartMetaBlockProcessorStub) GetEpochStartMetaBlock

func (esmbps *EpochStartMetaBlockProcessorStub) GetEpochStartMetaBlock(ctx context.Context) (data.MetaHeaderHandler, error)

GetEpochStartMetaBlock -

func (*EpochStartMetaBlockProcessorStub) IsInterfaceNil

func (esmbps *EpochStartMetaBlockProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartMetaBlockProcessorStub) RegisterHandler

func (esmbps *EpochStartMetaBlockProcessorStub) RegisterHandler(handler func(topic string, hash []byte, data interface{}))

RegisterHandler -

func (*EpochStartMetaBlockProcessorStub) Save

func (esmbps *EpochStartMetaBlockProcessorStub) Save(data process.InterceptedData, fromConnectedPeer core.PeerID, topic string) error

Save -

func (*EpochStartMetaBlockProcessorStub) Validate

func (esmbps *EpochStartMetaBlockProcessorStub) Validate(data process.InterceptedData, fromConnectedPeer core.PeerID) error

Validate -

type EpochStartNotifierStub

type EpochStartNotifierStub struct {
	NotifyAllCalled                  func(hdr data.HeaderHandler)
	NotifyAllPrepareCalled           func(hdr data.HeaderHandler, body data.BodyHandler)
	NotifyEpochChangeConfirmedCalled func(epoch uint32)
}

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) NotifyEpochChangeConfirmed

func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)

NotifyEpochChangeConfirmed -

type HeaderIntegrityVerifierStub

type HeaderIntegrityVerifierStub struct {
	VerifyCalled     func(header data.HeaderHandler) error
	GetVersionCalled func(epoch uint32) string
}

HeaderIntegrityVerifierStub -

func (*HeaderIntegrityVerifierStub) GetVersion

func (h *HeaderIntegrityVerifierStub) GetVersion(epoch uint32) string

GetVersion -

func (*HeaderIntegrityVerifierStub) IsInterfaceNil

func (h *HeaderIntegrityVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderIntegrityVerifierStub) Verify

Verify -

type HeaderValidatorStub

type HeaderValidatorStub struct {
	IsHeaderConstructionValidCalled func(currHdr, prevHdr data.HeaderHandler) error
}

HeaderValidatorStub -

func (*HeaderValidatorStub) IsHeaderConstructionValid

func (hvs *HeaderValidatorStub) IsHeaderConstructionValid(currHdr, prevHdr data.HeaderHandler) error

IsHeaderConstructionValid -

func (*HeaderValidatorStub) IsInterfaceNil

func (hvs *HeaderValidatorStub) IsInterfaceNil() bool

IsInterfaceNil returns if underlying object is true

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 ImportStartHandlerStub

type ImportStartHandlerStub struct {
	SetStartImportCalled            func() error
	ResetStartImportCalled          func() error
	ShouldStartImportCalled         func() bool
	IsAfterExportBeforeImportCalled func() bool
}

ImportStartHandlerStub -

func (*ImportStartHandlerStub) IsAfterExportBeforeImport

func (ish *ImportStartHandlerStub) IsAfterExportBeforeImport() bool

IsAfterExportBeforeImport -

func (*ImportStartHandlerStub) IsInterfaceNil

func (ish *ImportStartHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ImportStartHandlerStub) ResetStartImport

func (ish *ImportStartHandlerStub) ResetStartImport() error

ResetStartImport -

func (*ImportStartHandlerStub) SetStartImport

func (ish *ImportStartHandlerStub) SetStartImport() error

SetStartImport -

func (*ImportStartHandlerStub) ShouldStartImport

func (ish *ImportStartHandlerStub) ShouldStartImport() bool

ShouldStartImport -

type LatestStorageDataProviderStub

type LatestStorageDataProviderStub struct {
	GetParentDirAndLastEpochCalled func() (string, uint32, error)
	GetCalled                      func() (storage.LatestDataFromStorage, error)
	GetShardsFromDirectoryCalled   func(path string) ([]string, error)
	GetParentDirectoryCalled       func() string
}

LatestStorageDataProviderStub -

func (*LatestStorageDataProviderStub) Get

Get -

func (*LatestStorageDataProviderStub) GetParentDirAndLastEpoch

func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)

GetParentDirAndLastEpoch -

func (*LatestStorageDataProviderStub) GetParentDirectory

func (lsdps *LatestStorageDataProviderStub) GetParentDirectory() string

GetParentDirectory -

func (*LatestStorageDataProviderStub) GetShardsFromDirectory

func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)

GetShardsFromDirectory -

func (*LatestStorageDataProviderStub) IsInterfaceNil

func (lsdps *LatestStorageDataProviderStub) IsInterfaceNil() bool

IsInterfaceNil --

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 MetaBlockInterceptorProcessorStub

type MetaBlockInterceptorProcessorStub struct {
	GetEpochStartMetaBlockCalled func() (data.MetaHeaderHandler, error)
}

MetaBlockInterceptorProcessorStub -

func (*MetaBlockInterceptorProcessorStub) GetEpochStartMetaBlock

GetEpochStartMetaBlock -

func (*MetaBlockInterceptorProcessorStub) IsInterfaceNil

func (m *MetaBlockInterceptorProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MetaBlockInterceptorProcessorStub) RegisterHandler

func (m *MetaBlockInterceptorProcessorStub) RegisterHandler(_ func(topic string, hash []byte, data interface{}))

RegisterHandler -

func (*MetaBlockInterceptorProcessorStub) Save

Save -

func (*MetaBlockInterceptorProcessorStub) SignalEndOfProcessing

func (m *MetaBlockInterceptorProcessorStub) SignalEndOfProcessing(_ []process.InterceptedData)

SignalEndOfProcessing -

func (*MetaBlockInterceptorProcessorStub) Validate

Validate -

type NodeInfoMock

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

NodeInfoMock -

func NewNodeInfo

func NewNodeInfo(address []byte, pubKey []byte, shardId uint32, initialRating uint32) *NodeInfoMock

NewNodeInfo -

func (*NodeInfoMock) AddressBytes

func (n *NodeInfoMock) AddressBytes() []byte

AddressBytes -

func (*NodeInfoMock) AssignedShard

func (n *NodeInfoMock) AssignedShard() uint32

AssignedShard -

func (*NodeInfoMock) GetInitialRating

func (n *NodeInfoMock) GetInitialRating() uint32

GetInitialRating -

func (*NodeInfoMock) IsInterfaceNil

func (n *NodeInfoMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodeInfoMock) PubKeyBytes

func (n *NodeInfoMock) PubKeyBytes() []byte

PubKeyBytes -

type NodesSetupStub

type NodesSetupStub struct {
	InitialNodesInfoForShardCalled            func(shardId uint32) ([]nodesCoordinator.GenesisNodeInfoHandler, []nodesCoordinator.GenesisNodeInfoHandler, error)
	InitialNodesInfoCalled                    func() (map[uint32][]nodesCoordinator.GenesisNodeInfoHandler, map[uint32][]nodesCoordinator.GenesisNodeInfoHandler)
	GetStartTimeCalled                        func() int64
	GetRoundDurationCalled                    func() uint64
	GetShardConsensusGroupSizeCalled          func() uint32
	GetMetaConsensusGroupSizeCalled           func() uint32
	NumberOfShardsCalled                      func() uint32
	MinNumberOfNodesCalled                    func() uint32
	AllInitialNodesCalled                     func() []nodesCoordinator.GenesisNodeInfoHandler
	GetAdaptivityCalled                       func() bool
	GetHysteresisCalled                       func() float32
	GetShardIDForPubKeyCalled                 func(pubkey []byte) (uint32, error)
	InitialEligibleNodesPubKeysForShardCalled func(shardId uint32) ([]string, error)
	InitialNodesPubKeysCalled                 func() map[uint32][]string
	MinNumberOfMetaNodesCalled                func() uint32
	MinNumberOfShardNodesCalled               func() uint32
	MinNumberOfNodesWithHysteresisCalled      func() uint32
}

NodesSetupStub -

func (*NodesSetupStub) AllInitialNodes

AllInitialNodes -

func (*NodesSetupStub) GetAdaptivity

func (n *NodesSetupStub) GetAdaptivity() bool

GetAdaptivity -

func (*NodesSetupStub) GetHysteresis

func (n *NodesSetupStub) GetHysteresis() float32

GetHysteresis -

func (*NodesSetupStub) GetMetaConsensusGroupSize

func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32

GetMetaConsensusGroupSize -

func (*NodesSetupStub) GetRoundDuration

func (n *NodesSetupStub) GetRoundDuration() uint64

GetRoundDuration -

func (*NodesSetupStub) GetShardConsensusGroupSize

func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32

GetShardConsensusGroupSize -

func (*NodesSetupStub) GetShardIDForPubKey

func (n *NodesSetupStub) GetShardIDForPubKey(pubkey []byte) (uint32, error)

GetShardIDForPubKey -

func (*NodesSetupStub) GetStartTime

func (n *NodesSetupStub) GetStartTime() int64

GetStartTime -

func (*NodesSetupStub) InitialEligibleNodesPubKeysForShard

func (n *NodesSetupStub) InitialEligibleNodesPubKeysForShard(shardId uint32) ([]string, error)

InitialEligibleNodesPubKeysForShard -

func (*NodesSetupStub) InitialNodesInfo

InitialNodesInfo -

func (*NodesSetupStub) InitialNodesInfoForShard

InitialNodesInfoForShard -

func (*NodesSetupStub) InitialNodesPubKeys

func (n *NodesSetupStub) InitialNodesPubKeys() map[uint32][]string

InitialNodesPubKeys -

func (*NodesSetupStub) IsInterfaceNil

func (n *NodesSetupStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodesSetupStub) MinNumberOfMetaNodes

func (n *NodesSetupStub) MinNumberOfMetaNodes() uint32

MinNumberOfMetaNodes -

func (*NodesSetupStub) MinNumberOfNodes

func (n *NodesSetupStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*NodesSetupStub) MinNumberOfNodesWithHysteresis

func (n *NodesSetupStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

func (*NodesSetupStub) MinNumberOfShardNodes

func (n *NodesSetupStub) MinNumberOfShardNodes() uint32

MinNumberOfShardNodes -

func (*NodesSetupStub) NumberOfShards

func (n *NodesSetupStub) NumberOfShards() uint32

NumberOfShards -

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 RaterStub

type RaterStub struct {
	GetRatingCalled                func(string) uint32
	GetStartRatingCalled           func() uint32
	GetSignedBlocksThresholdCalled func() float32
	ComputeIncreaseProposerCalled  func(shardId uint32, rating uint32) uint32
	ComputeDecreaseProposerCalled  func(shardId uint32, rating uint32, consecutiveMissedBlocks uint32) uint32
	RevertIncreaseProposerCalled   func(shardId uint32, rating uint32, nrReverts uint32) uint32
	ComputeIncreaseValidatorCalled func(shardId uint32, rating uint32) uint32
	ComputeDecreaseValidatorCalled func(shardId uint32, rating uint32) uint32
	GetChanceCalled                func(rating uint32) uint32
}

RaterStub -

func (*RaterStub) ComputeDecreaseProposer

func (rm *RaterStub) ComputeDecreaseProposer(shardId uint32, currentRating uint32, consecutiveMisses uint32) uint32

ComputeDecreaseProposer -

func (*RaterStub) ComputeDecreaseValidator

func (rm *RaterStub) ComputeDecreaseValidator(shardId uint32, currentRating uint32) uint32

ComputeDecreaseValidator -

func (*RaterStub) ComputeIncreaseProposer

func (rm *RaterStub) ComputeIncreaseProposer(shardId uint32, currentRating uint32) uint32

ComputeIncreaseProposer -

func (*RaterStub) ComputeIncreaseValidator

func (rm *RaterStub) ComputeIncreaseValidator(shardId uint32, currentRating uint32) uint32

ComputeIncreaseValidator -

func (*RaterStub) GetChance

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

GetChance -

func (*RaterStub) GetRating

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

GetRating -

func (*RaterStub) GetSignedBlocksThreshold

func (rm *RaterStub) GetSignedBlocksThreshold() float32

GetSignedBlocksThreshold -

func (*RaterStub) GetStartRating

func (rm *RaterStub) GetStartRating() uint32

GetStartRating -

func (*RaterStub) IsInterfaceNil

func (rm *RaterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RaterStub) RevertIncreaseValidator

func (rm *RaterStub) RevertIncreaseValidator(shardId uint32, currentRating uint32, nrReverts uint32) uint32

RevertIncreaseValidator -

type RewardsCreatorStub

type RewardsCreatorStub struct {
	CreateRewardsMiniBlocksCalled func(
		metaBlock data.MetaHeaderHandler, validatorsInfo map[uint32][]*state.ValidatorInfo, computedEconomics *block.Economics,
	) (block.MiniBlockSlice, error)
	VerifyRewardsMiniBlocksCalled func(
		metaBlock data.MetaHeaderHandler, validatorsInfo map[uint32][]*state.ValidatorInfo, computedEconomics *block.Economics,
	) error
	GetProtocolSustainabilityRewardsCalled func() *big.Int
	GetLocalTxCacheCalled                  func() epochStart.TransactionCacher
	CreateMarshalledDataCalled             func(body *block.Body) map[string][][]byte
	GetRewardsTxsCalled                    func(body *block.Body) map[string]data.TransactionHandler
	SaveBlockDataToStorageCalled           func(metaBlock data.MetaHeaderHandler, body *block.Body)
	DeleteBlockDataFromStorageCalled       func(metaBlock data.MetaHeaderHandler, body *block.Body)
	RemoveBlockDataFromPoolsCalled         func(metaBlock data.MetaHeaderHandler, body *block.Body)
}

RewardsCreatorStub -

func (*RewardsCreatorStub) CreateMarshalledData

func (rcs *RewardsCreatorStub) CreateMarshalledData(body *block.Body) map[string][][]byte

CreateMarshalledData -

func (*RewardsCreatorStub) CreateRewardsMiniBlocks

func (rcs *RewardsCreatorStub) CreateRewardsMiniBlocks(
	metaBlock data.MetaHeaderHandler,
	validatorsInfo map[uint32][]*state.ValidatorInfo,
	computedEconomics *block.Economics,
) (block.MiniBlockSlice, error)

CreateRewardsMiniBlocks -

func (*RewardsCreatorStub) DeleteBlockDataFromStorage

func (rcs *RewardsCreatorStub) DeleteBlockDataFromStorage(metaBlock data.MetaHeaderHandler, body *block.Body)

DeleteBlockDataFromStorage -

func (*RewardsCreatorStub) GetLocalTxCache

func (rcs *RewardsCreatorStub) GetLocalTxCache() epochStart.TransactionCacher

GetLocalTxCache -

func (*RewardsCreatorStub) GetProtocolSustainabilityRewards

func (rcs *RewardsCreatorStub) GetProtocolSustainabilityRewards() *big.Int

GetProtocolSustainabilityRewards -

func (*RewardsCreatorStub) GetRewardsTxs

func (rcs *RewardsCreatorStub) GetRewardsTxs(body *block.Body) map[string]data.TransactionHandler

GetRewardsTxs -

func (*RewardsCreatorStub) IsInterfaceNil

func (rcs *RewardsCreatorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RewardsCreatorStub) RemoveBlockDataFromPools

func (rcs *RewardsCreatorStub) RemoveBlockDataFromPools(metaBlock data.MetaHeaderHandler, body *block.Body)

RemoveBlockDataFromPools -

func (*RewardsCreatorStub) SaveBlockDataToStorage

func (rcs *RewardsCreatorStub) SaveBlockDataToStorage(metaBlock data.MetaHeaderHandler, body *block.Body)

SaveBlockDataToStorage -

func (*RewardsCreatorStub) VerifyRewardsMiniBlocks

func (rcs *RewardsCreatorStub) VerifyRewardsMiniBlocks(
	metaBlock data.MetaHeaderHandler,
	validatorsInfo map[uint32][]*state.ValidatorInfo,
	computedEconomics *block.Economics,
) error

VerifyRewardsMiniBlocks -

type RewardsHandlerStub

type RewardsHandlerStub struct {
	LeaderPercentageCalled                 func() float64
	ProtocolSustainabilityPercentageCalled func() float64
	ProtocolSustainabilityAddressCalled    func() string
	MinInflationRateCalled                 func() float64
	MaxInflationRateCalled                 func(year uint32) float64
	RewardsTopUpGradientPointCalled        func() *big.Int
	RewardsTopUpFactorCalled               func() float64
}

RewardsHandlerStub -

func (*RewardsHandlerStub) IsInterfaceNil

func (r *RewardsHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RewardsHandlerStub) LeaderPercentage

func (r *RewardsHandlerStub) LeaderPercentage() float64

LeaderPercentage -

func (*RewardsHandlerStub) MaxInflationRate

func (r *RewardsHandlerStub) MaxInflationRate(year uint32) float64

MaxInflationRate -

func (*RewardsHandlerStub) MinInflationRate

func (r *RewardsHandlerStub) MinInflationRate() float64

MinInflationRate -

func (*RewardsHandlerStub) ProtocolSustainabilityAddress

func (r *RewardsHandlerStub) ProtocolSustainabilityAddress() string

ProtocolSustainabilityAddress will return the protocol sustainability address

func (*RewardsHandlerStub) ProtocolSustainabilityPercentage

func (r *RewardsHandlerStub) ProtocolSustainabilityPercentage() float64

ProtocolSustainabilityPercentage will return the protocol sustainability percentage value

func (*RewardsHandlerStub) RewardsTopUpFactor

func (r *RewardsHandlerStub) RewardsTopUpFactor() float64

RewardsTopUpFactor -

func (*RewardsHandlerStub) RewardsTopUpGradientPoint

func (r *RewardsHandlerStub) RewardsTopUpGradientPoint() *big.Int

RewardsTopUpGradientPoint -

type RoundHandlerStub

type RoundHandlerStub struct {
	RoundIndex int64

	IndexCalled         func() int64
	TimeDurationCalled  func() time.Duration
	TimeStampCalled     func() time.Time
	UpdateRoundCalled   func(time.Time, time.Time)
	RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration
}

RoundHandlerStub -

func (*RoundHandlerStub) Index

func (rndm *RoundHandlerStub) Index() int64

Index -

func (*RoundHandlerStub) IsInterfaceNil

func (rndm *RoundHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RoundHandlerStub) RemainingTime

func (rndm *RoundHandlerStub) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration

RemainingTime -

func (*RoundHandlerStub) TimeDuration

func (rndm *RoundHandlerStub) TimeDuration() time.Duration

TimeDuration -

func (*RoundHandlerStub) TimeStamp

func (rndm *RoundHandlerStub) TimeStamp() time.Time

TimeStamp -

func (*RoundHandlerStub) UpdateRound

func (rndm *RoundHandlerStub) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)

UpdateRound -

type RoundTimeDurationHandler

type RoundTimeDurationHandler struct {
	TimeDurationCalled func() time.Duration
}

RoundTimeDurationHandler -

func (*RoundTimeDurationHandler) IsInterfaceNil

func (r *RoundTimeDurationHandler) IsInterfaceNil() bool

IsInterfaceNil -

func (*RoundTimeDurationHandler) TimeDuration

func (r *RoundTimeDurationHandler) TimeDuration() time.Duration

TimeDuration -

type ShardCoordinatorStub

type ShardCoordinatorStub struct {
	NumberOfShardsCalled          func() uint32
	ComputeIdCalled               func(address []byte) uint32
	SelfIdCalled                  func() uint32
	SameShardCalled               func(firstAddress, secondAddress []byte) bool
	CommunicationIdentifierCalled func(destShardID uint32) string
}

ShardCoordinatorStub -

func (*ShardCoordinatorStub) CommunicationIdentifier

func (coordinator *ShardCoordinatorStub) CommunicationIdentifier(destShardID uint32) string

CommunicationIdentifier -

func (*ShardCoordinatorStub) ComputeId

func (coordinator *ShardCoordinatorStub) ComputeId(address []byte) uint32

ComputeId -

func (*ShardCoordinatorStub) IsInterfaceNil

func (coordinator *ShardCoordinatorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardCoordinatorStub) NumberOfShards

func (coordinator *ShardCoordinatorStub) NumberOfShards() uint32

NumberOfShards -

func (*ShardCoordinatorStub) SameShard

func (coordinator *ShardCoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool

SameShard -

func (*ShardCoordinatorStub) SelfId

func (coordinator *ShardCoordinatorStub) SelfId() uint32

SelfId -

type ShardIdHasMapStub

type ShardIdHasMapStub struct {
	LoadCalled   func(shardId uint32) ([]byte, bool)
	StoreCalled  func(shardId uint32, hash []byte)
	RangeCalled  func(f func(shardId uint32, hash []byte) bool)
	DeleteCalled func(shardId uint32)
}

ShardIdHasMapStub -

func (*ShardIdHasMapStub) Delete

func (sihsm *ShardIdHasMapStub) Delete(shardId uint32)

Delete -

func (*ShardIdHasMapStub) IsInterfaceNil

func (sihsm *ShardIdHasMapStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardIdHasMapStub) Load

func (sihsm *ShardIdHasMapStub) Load(shardId uint32) ([]byte, bool)

Load -

func (*ShardIdHasMapStub) Range

func (sihsm *ShardIdHasMapStub) Range(f func(shardId uint32, hash []byte) bool)

Range -

func (*ShardIdHasMapStub) Store

func (sihsm *ShardIdHasMapStub) Store(shardId uint32, hash []byte)

Store -

type StakingDataProviderStub

type StakingDataProviderStub struct {
	CleanCalled                           func()
	PrepareStakingDataCalled              func(keys map[uint32][][]byte) error
	GetTotalStakeEligibleNodesCalled      func() *big.Int
	GetTotalTopUpStakeEligibleNodesCalled func() *big.Int
	GetNodeStakedTopUpCalled              func(blsKey []byte) (*big.Int, error)
	FillValidatorInfoCalled               func(blsKey []byte) error
	ComputeUnQualifiedNodesCalled         func(validatorInfos map[uint32][]*state.ValidatorInfo) ([][]byte, map[string][][]byte, error)
}

StakingDataProviderStub -

func (*StakingDataProviderStub) Clean

func (sdps *StakingDataProviderStub) Clean()

Clean -

func (*StakingDataProviderStub) ComputeUnQualifiedNodes

func (sdps *StakingDataProviderStub) ComputeUnQualifiedNodes(validatorInfos map[uint32][]*state.ValidatorInfo) ([][]byte, map[string][][]byte, error)

ComputeUnQualifiedNodes -

func (*StakingDataProviderStub) FillValidatorInfo

func (sdps *StakingDataProviderStub) FillValidatorInfo(blsKey []byte) error

FillValidatorInfo -

func (*StakingDataProviderStub) GetNodeStakedTopUp

func (sdps *StakingDataProviderStub) GetNodeStakedTopUp(blsKey []byte) (*big.Int, error)

GetNodeStakedTopUp -

func (*StakingDataProviderStub) GetTotalStakeEligibleNodes

func (sdps *StakingDataProviderStub) GetTotalStakeEligibleNodes() *big.Int

GetTotalStakeEligibleNodes -

func (*StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes

func (sdps *StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes() *big.Int

GetTotalTopUpStakeEligibleNodes -

func (*StakingDataProviderStub) IsInterfaceNil

func (sdps *StakingDataProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StakingDataProviderStub) PrepareStakingDataForRewards

func (sdps *StakingDataProviderStub) PrepareStakingDataForRewards(keys map[uint32][][]byte) error

PrepareStakingDataForRewards -

type StorageManagerStub

type StorageManagerStub struct {
	DatabaseCalled                    func() common.DBWriteCacher
	TakeSnapshotCalled                func([]byte)
	SetCheckpointCalled               func([]byte)
	PruneCalled                       func([]byte)
	CancelPruneCalled                 func([]byte)
	MarkForEvictionCalled             func([]byte, common.ModifiedHashes) error
	GetDbThatContainsHashCalled       func([]byte) common.DBWriteCacher
	GetSnapshotThatContainsHashCalled func(rootHash []byte) common.SnapshotDbHandler
	IsPruningEnabledCalled            func() bool
	EnterSnapshotModeCalled           func()
	ExitSnapshotModeCalled            func()
	IsInterfaceNilCalled              func() bool
}

StorageManagerStub --

func (*StorageManagerStub) CancelPrune

func (sms *StorageManagerStub) CancelPrune([]byte, state.TriePruningIdentifier)

CancelPrune --

func (*StorageManagerStub) Close

func (sms *StorageManagerStub) Close() error

Close -

func (*StorageManagerStub) Database

func (sms *StorageManagerStub) Database() common.DBWriteCacher

Database --

func (*StorageManagerStub) EnterSnapshotMode

func (sms *StorageManagerStub) EnterSnapshotMode()

EnterSnapshotMode --

func (*StorageManagerStub) ExitSnapshotMode

func (sms *StorageManagerStub) ExitSnapshotMode()

ExitSnapshotMode --

func (*StorageManagerStub) GetSnapshotDbBatchDelay

func (sms *StorageManagerStub) GetSnapshotDbBatchDelay() int

GetSnapshotDbBatchDelay -

func (*StorageManagerStub) GetSnapshotThatContainsHash

func (sms *StorageManagerStub) GetSnapshotThatContainsHash(d []byte) common.SnapshotDbHandler

GetSnapshotThatContainsHash --

func (*StorageManagerStub) IsInterfaceNil

func (sms *StorageManagerStub) IsInterfaceNil() bool

IsInterfaceNil --

func (*StorageManagerStub) IsPruningEnabled

func (sms *StorageManagerStub) IsPruningEnabled() bool

IsPruningEnabled --

func (*StorageManagerStub) MarkForEviction

func (sms *StorageManagerStub) MarkForEviction(d []byte, m common.ModifiedHashes) error

MarkForEviction --

func (*StorageManagerStub) Prune

Prune --

func (*StorageManagerStub) SetCheckpoint

func (sms *StorageManagerStub) SetCheckpoint([]byte)

SetCheckpoint --

func (*StorageManagerStub) TakeSnapshot

func (sms *StorageManagerStub) TakeSnapshot([]byte)

TakeSnapshot --

type StorerMock

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

StorerMock -

func NewStorerMock

func NewStorerMock() *StorerMock

NewStorerMock -

func (*StorerMock) ClearCache

func (sm *StorerMock) ClearCache()

ClearCache -

func (*StorerMock) Close

func (sm *StorerMock) Close() error

Close -

func (*StorerMock) DestroyUnit

func (sm *StorerMock) DestroyUnit() error

DestroyUnit -

func (*StorerMock) Get

func (sm *StorerMock) Get(key []byte) ([]byte, error)

Get -

func (*StorerMock) GetBulkFromEpoch

func (sm *StorerMock) GetBulkFromEpoch(keys [][]byte, _ uint32) ([]storage.KeyValuePair, error)

GetBulkFromEpoch -

func (*StorerMock) GetFromEpoch

func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)

GetFromEpoch -

func (*StorerMock) GetOldestEpoch

func (sm *StorerMock) GetOldestEpoch() (uint32, error)

GetOldestEpoch -

func (*StorerMock) Has

func (sm *StorerMock) Has(_ []byte) error

Has -

func (*StorerMock) IsInterfaceNil

func (sm *StorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerMock) Put

func (sm *StorerMock) Put(key, data []byte) error

Put -

func (*StorerMock) PutInEpoch

func (sm *StorerMock) PutInEpoch(key, data []byte, _ uint32) error

PutInEpoch -

func (*StorerMock) RangeKeys

func (sm *StorerMock) RangeKeys(_ func(key []byte, val []byte) bool)

RangeKeys -

func (*StorerMock) Remove

func (sm *StorerMock) Remove(key []byte) error

Remove -

func (*StorerMock) RemoveFromCurrentEpoch

func (sm *StorerMock) RemoveFromCurrentEpoch(key []byte) error

RemoveFromCurrentEpoch -

func (*StorerMock) SearchFirst

func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)

SearchFirst -

type SyncTimerStub

type SyncTimerStub struct {
	StartSyncingTimeCalled     func()
	ClockOffsetCalled          func() time.Duration
	FormattedCurrentTimeCalled func() string
	CurrentTimeCalled          func() time.Time
}

SyncTimerStub is a mock implementation of SyncTimer interface

func (*SyncTimerStub) ClockOffset

func (sts *SyncTimerStub) ClockOffset() time.Duration

ClockOffset is a mock implementation for ClockOffset

func (*SyncTimerStub) Close

func (sts *SyncTimerStub) Close() error

Close -

func (*SyncTimerStub) CurrentTime

func (sts *SyncTimerStub) CurrentTime() time.Time

CurrentTime is a mock implementation for CurrentTime

func (*SyncTimerStub) FormattedCurrentTime

func (sts *SyncTimerStub) FormattedCurrentTime() string

FormattedCurrentTime is a mock implementation for FormattedCurrentTime

func (*SyncTimerStub) IsInterfaceNil

func (sts *SyncTimerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SyncTimerStub) StartSyncingTime

func (sts *SyncTimerStub) StartSyncingTime()

StartSyncingTime is a mock implementation for StartSyncingTime

type TxForCurrentBlockStub

type TxForCurrentBlockStub struct {
	CleanCalled func()
	GetTxCalled func(txHash []byte) (data.TransactionHandler, error)
	AddTxCalled func(txHash []byte, tx data.TransactionHandler)
}

TxForCurrentBlockStub -

func (*TxForCurrentBlockStub) AddTx

func (t *TxForCurrentBlockStub) AddTx(txHash []byte, tx data.TransactionHandler)

AddTx -

func (*TxForCurrentBlockStub) Clean

func (t *TxForCurrentBlockStub) Clean()

Clean -

func (*TxForCurrentBlockStub) GetTx

func (t *TxForCurrentBlockStub) GetTx(txHash []byte) (data.TransactionHandler, error)

GetTx -

func (*TxForCurrentBlockStub) IsInterfaceNil

func (t *TxForCurrentBlockStub) IsInterfaceNil() bool

IsInterfaceNil -

type Uint64ByteSliceConverterMock

type Uint64ByteSliceConverterMock struct {
	ToByteSliceCalled func(uint64) []byte
	ToUint64Called    func([]byte) (uint64, error)
}

Uint64ByteSliceConverterMock converts byte slice to/from uint64

func (*Uint64ByteSliceConverterMock) IsInterfaceNil

func (u *Uint64ByteSliceConverterMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*Uint64ByteSliceConverterMock) ToByteSlice

func (u *Uint64ByteSliceConverterMock) ToByteSlice(p uint64) []byte

ToByteSlice is a mock implementation for Uint64ByteSliceConverter

func (*Uint64ByteSliceConverterMock) ToUint64

func (u *Uint64ByteSliceConverterMock) ToUint64(p []byte) (uint64, error)

ToUint64 is a mock implementation for Uint64ByteSliceConverter

type Uint64SyncMapCacherStub

type Uint64SyncMapCacherStub struct {
	ClearCalled           func()
	GetCalled             func(nonce uint64) (dataRetriever.ShardIdHashMap, bool)
	MergeCalled           func(nonce uint64, src dataRetriever.ShardIdHashMap)
	RemoveCalled          func(nonce uint64, shardId uint32)
	RegisterHandlerCalled func(handler func(nonce uint64, shardId uint32, value []byte))
	HasCalled             func(nonce uint64, shardId uint32) bool
}

Uint64SyncMapCacherStub -

func (*Uint64SyncMapCacherStub) Clear

func (usmcs *Uint64SyncMapCacherStub) Clear()

Clear -

func (*Uint64SyncMapCacherStub) Get

Get -

func (*Uint64SyncMapCacherStub) Has

func (usmcs *Uint64SyncMapCacherStub) Has(nonce uint64, shardId uint32) bool

Has -

func (*Uint64SyncMapCacherStub) IsInterfaceNil

func (usmcs *Uint64SyncMapCacherStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*Uint64SyncMapCacherStub) Merge

Merge -

func (*Uint64SyncMapCacherStub) RegisterHandler

func (usmcs *Uint64SyncMapCacherStub) RegisterHandler(handler func(nonce uint64, shardId uint32, value []byte))

RegisterHandler -

func (*Uint64SyncMapCacherStub) Remove

func (usmcs *Uint64SyncMapCacherStub) Remove(nonce uint64, shardId uint32)

Remove -

type UnitOpenerStub

type UnitOpenerStub struct {
}

UnitOpenerStub -

func (*UnitOpenerStub) GetMostRecentStorageUnit

func (u *UnitOpenerStub) GetMostRecentStorageUnit(_ config.DBConfig) (storage.Storer, error)

GetMostRecentStorageUnit -

func (*UnitOpenerStub) IsInterfaceNil

func (u *UnitOpenerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*UnitOpenerStub) OpenDB

OpenDB -

type VMExecutionHandlerStub

type VMExecutionHandlerStub struct {
	RunSmartContractCreateCalled func(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
	RunSmartContractCallCalled   func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	GasScheduleChangeCalled      func(gasSchedule map[string]map[string]uint64)
	GetVersionCalled             func() string
}

VMExecutionHandlerStub -

func (*VMExecutionHandlerStub) Close

func (vm *VMExecutionHandlerStub) Close() error

Close -

func (*VMExecutionHandlerStub) GasScheduleChange

func (vm *VMExecutionHandlerStub) GasScheduleChange(gasSchedule map[string]map[string]uint64)

GasScheduleChange -

func (*VMExecutionHandlerStub) GetVersion

func (vm *VMExecutionHandlerStub) GetVersion() string

GetVersion -

func (*VMExecutionHandlerStub) IsInterfaceNil

func (vm *VMExecutionHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*VMExecutionHandlerStub) RunSmartContractCall

func (vm *VMExecutionHandlerStub) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

RunSmartContractCall computes the result of a smart contract call and how the system must change after the execution

func (*VMExecutionHandlerStub) RunSmartContractCreate

func (vm *VMExecutionHandlerStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)

RunSmartContractCreate --

type ValidatorInfoSyncerStub

type ValidatorInfoSyncerStub struct {
}

ValidatorInfoSyncerStub -

func (*ValidatorInfoSyncerStub) IsInterfaceNil

func (vip *ValidatorInfoSyncerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorInfoSyncerStub) SyncMiniBlocks

func (vip *ValidatorInfoSyncerStub) SyncMiniBlocks(_ data.HeaderHandler) ([][]byte, data.BodyHandler, error)

SyncMiniBlocks -

func (*ValidatorInfoSyncerStub) SyncValidatorsInfo

func (vip *ValidatorInfoSyncerStub) SyncValidatorsInfo(_ data.BodyHandler) ([][]byte, map[string]*state.ShardValidatorInfo, error)

SyncValidatorsInfo -

type ValidatorStatisticsProcessorStub

type ValidatorStatisticsProcessorStub struct {
	ProcessCalled        func(validatorInfo data.ShardValidatorInfoHandler) error
	CommitCalled         func() ([]byte, error)
	IsInterfaceNilCalled func() bool
}

ValidatorStatisticsProcessorStub -

func (*ValidatorStatisticsProcessorStub) Commit

func (pm *ValidatorStatisticsProcessorStub) Commit() ([]byte, error)

Commit -

func (*ValidatorStatisticsProcessorStub) IsInterfaceNil

func (pm *ValidatorStatisticsProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorStatisticsProcessorStub) Process

Process -

Jump to

Keyboard shortcuts

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