mock

package
v1.3.16-indexer1.2.19 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNegativeValue = errors.New("negative value provided")

ErrNegativeValue -

Functions

This section is empty.

Types

type AccountsParserStub

type AccountsParserStub struct {
	InitialAccountsSplitOnAddressesShardsCalled           func(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)
	InitialAccountsSplitOnDelegationAddressesShardsCalled func(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)
	InitialAccountsCalled                                 func() []genesis.InitialAccountHandler
	GetTotalStakedForDelegationAddressCalled              func(delegationAddress string) *big.Int
	GetInitialAccountsForDelegatedCalled                  func(addressBytes []byte) []genesis.InitialAccountHandler
	GenerateInitialTransactionsCalled                     func(shardCoordinator sharding.Coordinator, initialIndexingData map[uint32]*genesis.IndexingData) ([]*block.MiniBlock, map[uint32]*indexer.Pool, error)
}

AccountsParserStub -

func (*AccountsParserStub) GenerateInitialTransactions added in v1.3.0

func (aps *AccountsParserStub) GenerateInitialTransactions(shardCoordinator sharding.Coordinator, initialIndexingData map[uint32]*genesis.IndexingData) ([]*block.MiniBlock, map[uint32]*indexer.Pool, error)

GenerateInitialTransactions -

func (*AccountsParserStub) GetInitialAccountsForDelegated

func (aps *AccountsParserStub) GetInitialAccountsForDelegated(addressBytes []byte) []genesis.InitialAccountHandler

GetInitialAccountsForDelegated -

func (*AccountsParserStub) GetTotalStakedForDelegationAddress

func (aps *AccountsParserStub) GetTotalStakedForDelegationAddress(delegationAddress string) *big.Int

GetTotalStakedForDelegationAddress -

func (*AccountsParserStub) InitialAccounts

func (aps *AccountsParserStub) InitialAccounts() []genesis.InitialAccountHandler

InitialAccounts -

func (*AccountsParserStub) InitialAccountsSplitOnAddressesShards

func (aps *AccountsParserStub) InitialAccountsSplitOnAddressesShards(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)

InitialAccountsSplitOnAddressesShards -

func (*AccountsParserStub) InitialAccountsSplitOnDelegationAddressesShards

func (aps *AccountsParserStub) InitialAccountsSplitOnDelegationAddressesShards(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)

InitialAccountsSplitOnDelegationAddressesShards -

func (*AccountsParserStub) IsInterfaceNil

func (aps *AccountsParserStub) IsInterfaceNil() bool

IsInterfaceNil -

type BaseAccountMock

type BaseAccountMock struct {
	AddressBytesField []byte
	Nonce             uint64
}

BaseAccountMock -

func (*BaseAccountMock) AddressBytes

func (bam *BaseAccountMock) AddressBytes() []byte

AddressBytes -

func (*BaseAccountMock) GetNonce

func (bam *BaseAccountMock) GetNonce() uint64

GetNonce -

func (*BaseAccountMock) IncreaseNonce

func (bam *BaseAccountMock) IncreaseNonce(nonce uint64)

IncreaseNonce -

func (*BaseAccountMock) IsInterfaceNil

func (bam *BaseAccountMock) IsInterfaceNil() bool

IsInterfaceNil -

type BlockChainHookHandlerMock

type BlockChainHookHandlerMock struct {
	SetCurrentHeaderCalled             func(hdr data.HeaderHandler)
	NewAddressCalled                   func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
	IsPayableCalled                    func(sndAddress []byte, rcvAddress []byte) (bool, error)
	DeleteCompiledCodeCalled           func(codeHash []byte)
	ProcessBuiltInFunctionCalled       func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	FilterCodeMetadataForUpgradeCalled func(input []byte) ([]byte, error)
	ApplyFiltersOnCodeMetadataCalled   func(codeMetadata vmcommon.CodeMetadata) vmcommon.CodeMetadata
}

BlockChainHookHandlerMock -

func (*BlockChainHookHandlerMock) ApplyFiltersOnCodeMetadata added in v1.3.7

func (e *BlockChainHookHandlerMock) ApplyFiltersOnCodeMetadata(codeMetadata vmcommon.CodeMetadata) vmcommon.CodeMetadata

ApplyFiltersOnCodeMetadata -

func (*BlockChainHookHandlerMock) DeleteCompiledCode added in v1.1.12

func (e *BlockChainHookHandlerMock) DeleteCompiledCode(codeHash []byte)

DeleteCompiledCode -

func (*BlockChainHookHandlerMock) FilterCodeMetadataForUpgrade added in v1.3.7

func (e *BlockChainHookHandlerMock) FilterCodeMetadataForUpgrade(input []byte) ([]byte, error)

FilterCodeMetadataForUpgrade -

func (*BlockChainHookHandlerMock) IsInterfaceNil

func (e *BlockChainHookHandlerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*BlockChainHookHandlerMock) IsPayable added in v1.0.147

func (e *BlockChainHookHandlerMock) IsPayable(sndAddress []byte, recvAddress []byte) (bool, error)

IsPayable -

func (*BlockChainHookHandlerMock) NewAddress

func (e *BlockChainHookHandlerMock) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)

NewAddress -

func (*BlockChainHookHandlerMock) ProcessBuiltInFunction added in v1.2.4

func (e *BlockChainHookHandlerMock) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

ProcessBuiltInFunction -

func (*BlockChainHookHandlerMock) SaveNFTMetaDataToSystemAccount added in v1.2.35

func (e *BlockChainHookHandlerMock) SaveNFTMetaDataToSystemAccount(_ data.TransactionHandler) error

SaveNFTMetaDataToSystemAccount -

func (*BlockChainHookHandlerMock) SetCurrentHeader

func (e *BlockChainHookHandlerMock) SetCurrentHeader(hdr data.HeaderHandler)

SetCurrentHeader -

type ChainStorerStub added in v1.2.4

type ChainStorerStub struct {
	AddStorerCalled               func(key dataRetriever.UnitType, s storage.Storer)
	GetStorerCalled               func(unitType dataRetriever.UnitType) storage.Storer
	HasCalled                     func(unitType dataRetriever.UnitType, key []byte) error
	GetCalled                     func(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
	PutCalled                     func(unitType dataRetriever.UnitType, key []byte, value []byte) error
	GetAllCalled                  func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
	DestroyCalled                 func() error
	CloseAllCalled                func() error
	SetEpochForPutOperationCalled func(epoch uint32)
	GetAllStorersCalled           func() map[dataRetriever.UnitType]storage.Storer
}

ChainStorerStub -

func (*ChainStorerStub) AddStorer added in v1.2.4

func (css *ChainStorerStub) AddStorer(key dataRetriever.UnitType, s storage.Storer)

AddStorer will add a new storer to the chain map

func (*ChainStorerStub) CloseAll added in v1.2.4

func (css *ChainStorerStub) CloseAll() error

CloseAll -

func (*ChainStorerStub) Destroy added in v1.2.4

func (css *ChainStorerStub) Destroy() error

Destroy -

func (*ChainStorerStub) Get added in v1.2.4

func (css *ChainStorerStub) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)

Get -

func (*ChainStorerStub) GetAll added in v1.2.4

func (css *ChainStorerStub) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)

GetAll -

func (*ChainStorerStub) GetAllStorers added in v1.2.4

func (css *ChainStorerStub) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

func (*ChainStorerStub) GetStorer added in v1.2.4

func (css *ChainStorerStub) GetStorer(unitType dataRetriever.UnitType) storage.Storer

GetStorer returns the storer from the chain map or nil if the storer was not found

func (*ChainStorerStub) Has added in v1.2.4

func (css *ChainStorerStub) Has(unitType dataRetriever.UnitType, key []byte) error

Has -

func (*ChainStorerStub) IsInterfaceNil added in v1.2.4

func (css *ChainStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ChainStorerStub) Put added in v1.2.4

func (css *ChainStorerStub) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error

Put -

func (*ChainStorerStub) SetEpochForPutOperation added in v1.2.4

func (css *ChainStorerStub) SetEpochForPutOperation(epoch uint32)

SetEpochForPutOperation -

type CoordinatorStub

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

CoordinatorStub -

func (*CoordinatorStub) CommunicationIdentifier

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

CommunicationIdentifier -

func (*CoordinatorStub) ComputeId

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

ComputeId -

func (*CoordinatorStub) IsInterfaceNil

func (coordinator *CoordinatorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*CoordinatorStub) NumberOfShards

func (coordinator *CoordinatorStub) NumberOfShards() uint32

NumberOfShards -

func (*CoordinatorStub) SameShard

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

SameShard -

func (*CoordinatorStub) SelfId

func (coordinator *CoordinatorStub) SelfId() uint32

SelfId -

type CoreComponentsMock added in v1.2.0

type CoreComponentsMock struct {
	IntMarsh            marshal.Marshalizer
	TxMarsh             marshal.Marshalizer
	Hash                hashing.Hasher
	TxSignHasherField   hashing.Hasher
	UInt64ByteSliceConv typeConverters.Uint64ByteSliceConverter
	AddrPubKeyConv      core.PubkeyConverter
	Chain               string
	MinTxVersion        uint32
	StatHandler         core.AppStatusHandler
}

CoreComponentsMock -

func (*CoreComponentsMock) AddressPubKeyConverter added in v1.2.0

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

AddressPubKeyConverter -

func (*CoreComponentsMock) ChainID added in v1.2.0

func (ccm *CoreComponentsMock) ChainID() string

ChainID -

func (*CoreComponentsMock) Hasher added in v1.2.0

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

Hasher -

func (*CoreComponentsMock) InternalMarshalizer added in v1.2.0

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

InternalMarshalizer -

func (*CoreComponentsMock) IsInterfaceNil added in v1.2.0

func (ccm *CoreComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CoreComponentsMock) MinTransactionVersion added in v1.2.0

func (ccm *CoreComponentsMock) MinTransactionVersion() uint32

MinTransactionVersion -

func (*CoreComponentsMock) TxMarshalizer added in v1.2.0

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

TxMarshalizer -

func (*CoreComponentsMock) TxSignHasher added in v1.2.0

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

TxSignHasher -

func (*CoreComponentsMock) Uint64ByteSliceConverter added in v1.2.0

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

Uint64ByteSliceConverter -

type DataComponentsMock added in v1.2.0

type DataComponentsMock struct {
	Storage           dataRetriever.StorageService
	Blkc              data.ChainHandler
	DataPool          dataRetriever.PoolsHolder
	MiniBlockProvider MiniBlockProvider
}

DataComponentsMock -

func (*DataComponentsMock) Blockchain added in v1.2.0

func (dcm *DataComponentsMock) Blockchain() data.ChainHandler

Blockchain -

func (*DataComponentsMock) Clone added in v1.2.0

func (dcm *DataComponentsMock) Clone() interface{}

Clone -

func (*DataComponentsMock) Datapool added in v1.2.0

Datapool -

func (*DataComponentsMock) IsInterfaceNil added in v1.2.0

func (dcm *DataComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*DataComponentsMock) MiniBlocksProvider added in v1.2.0

func (dcm *DataComponentsMock) MiniBlocksProvider() MiniBlockProvider

MiniBlocksProvider -

func (*DataComponentsMock) SetBlockchain added in v1.2.0

func (dcm *DataComponentsMock) SetBlockchain(chain data.ChainHandler)

SetBlockchain -

func (*DataComponentsMock) StorageService added in v1.2.0

func (dcm *DataComponentsMock) StorageService() dataRetriever.StorageService

StorageService -

type DeployProcessorStub

type DeployProcessorStub struct {
	DeployCalled                 func(sc genesis.InitialSmartContractHandler) ([][]byte, error)
	SetReplacePlaceholdersCalled func(handler func(txData string, scResultingAddressBytes []byte) (string, error))
}

DeployProcessorStub -

func (*DeployProcessorStub) Deploy

Deploy -

func (*DeployProcessorStub) IsInterfaceNil

func (dps *DeployProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

type GasScheduleNotifierMock added in v1.1.12

type GasScheduleNotifierMock struct {
	GasSchedule map[string]map[string]uint64
}

GasScheduleNotifierMock -

func NewGasScheduleNotifierMock added in v1.1.12

func NewGasScheduleNotifierMock(gasSchedule map[string]map[string]uint64) *GasScheduleNotifierMock

NewGasScheduleNotifierMock -

func (*GasScheduleNotifierMock) IsInterfaceNil added in v1.1.12

func (g *GasScheduleNotifierMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*GasScheduleNotifierMock) LatestGasSchedule added in v1.1.12

func (g *GasScheduleNotifierMock) LatestGasSchedule() map[string]map[string]uint64

LatestGasSchedule -

func (*GasScheduleNotifierMock) RegisterNotifyHandler added in v1.1.12

func (g *GasScheduleNotifierMock) RegisterNotifyHandler(handler core.GasScheduleSubscribeHandler)

RegisterNotifyHandler -

func (*GasScheduleNotifierMock) UnRegisterAll added in v1.1.12

func (g *GasScheduleNotifierMock) UnRegisterAll()

UnRegisterAll -

type GenesisNodeInfoHandlerMock

type GenesisNodeInfoHandlerMock struct {
	AssignedShardValue uint32
	AddressBytesValue  []byte
	PubKeyBytesValue   []byte
	InitialRatingValue uint32
}

GenesisNodeInfoHandlerMock -

func (*GenesisNodeInfoHandlerMock) AddressBytes

func (gnihm *GenesisNodeInfoHandlerMock) AddressBytes() []byte

AddressBytes -

func (*GenesisNodeInfoHandlerMock) AssignedShard

func (gnihm *GenesisNodeInfoHandlerMock) AssignedShard() uint32

AssignedShard -

func (*GenesisNodeInfoHandlerMock) GetInitialRating added in v1.0.149

func (gnihm *GenesisNodeInfoHandlerMock) GetInitialRating() uint32

GetInitialRating -

func (*GenesisNodeInfoHandlerMock) IsInterfaceNil

func (gnihm *GenesisNodeInfoHandlerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*GenesisNodeInfoHandlerMock) PubKeyBytes

func (gnihm *GenesisNodeInfoHandlerMock) PubKeyBytes() []byte

PubKeyBytes -

type ImportStartHandlerStub added in v1.0.133

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

ImportStartHandlerStub -

func (*ImportStartHandlerStub) IsAfterExportBeforeImport added in v1.0.133

func (ish *ImportStartHandlerStub) IsAfterExportBeforeImport() bool

IsAfterExportBeforeImport -

func (*ImportStartHandlerStub) IsInterfaceNil added in v1.0.133

func (ish *ImportStartHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ImportStartHandlerStub) ResetStartImport added in v1.0.133

func (ish *ImportStartHandlerStub) ResetStartImport() error

ResetStartImport -

func (*ImportStartHandlerStub) SetStartImport added in v1.0.133

func (ish *ImportStartHandlerStub) SetStartImport() error

SetStartImport -

func (*ImportStartHandlerStub) ShouldStartImport added in v1.0.133

func (ish *ImportStartHandlerStub) ShouldStartImport() bool

ShouldStartImport -

type IndexerMock added in v1.1.6

type IndexerMock struct {
	SaveBlockCalled func(args *indexer.ArgsSaveBlockData)
}

IndexerMock is a mock implementation fot the Indexer interface

func (*IndexerMock) Close added in v1.1.6

func (im *IndexerMock) Close() error

Close will do nothing

func (*IndexerMock) IsInterfaceNil added in v1.1.6

func (im *IndexerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*IndexerMock) IsNilIndexer added in v1.1.6

func (im *IndexerMock) IsNilIndexer() bool

IsNilIndexer -

func (*IndexerMock) RevertIndexedBlock added in v1.1.6

func (im *IndexerMock) RevertIndexedBlock(_ data.HeaderHandler, _ data.BodyHandler)

RevertIndexedBlock -

func (*IndexerMock) SaveAccounts added in v1.1.6

func (im *IndexerMock) SaveAccounts(_ uint64, _ []state.UserAccountHandler)

SaveAccounts -

func (*IndexerMock) SaveBlock added in v1.1.6

func (im *IndexerMock) SaveBlock(args *indexer.ArgsSaveBlockData)

SaveBlock -

func (*IndexerMock) SaveMetaBlock added in v1.1.6

func (im *IndexerMock) SaveMetaBlock(_ data.HeaderHandler, _ []uint64)

SaveMetaBlock -

func (*IndexerMock) SaveRoundsInfo added in v1.1.6

func (im *IndexerMock) SaveRoundsInfo(_ []*indexer.RoundInfo)

SaveRoundsInfo -

func (*IndexerMock) SaveValidatorsPubKeys added in v1.1.6

func (im *IndexerMock) SaveValidatorsPubKeys(_ map[uint32][][]byte, _ uint32)

SaveValidatorsPubKeys -

func (*IndexerMock) SaveValidatorsRating added in v1.1.6

func (im *IndexerMock) SaveValidatorsRating(_ string, _ []*indexer.ValidatorRatingInfo)

SaveValidatorsRating --

func (*IndexerMock) SetTxLogsProcessor added in v1.1.6

func (im *IndexerMock) SetTxLogsProcessor(_ process.TransactionLogProcessorDatabase)

SetTxLogsProcessor will do nothing

type InitialNodesHandlerStub

type InitialNodesHandlerStub struct {
	InitialNodesInfoCalled               func() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
	MinNumberOfNodesCalled               func() uint32
	MinNumberOfNodesWithHysteresisCalled func() uint32
}

InitialNodesHandlerStub -

func (*InitialNodesHandlerStub) InitialNodesInfo

InitialNodesInfo -

func (*InitialNodesHandlerStub) IsInterfaceNil

func (inhs *InitialNodesHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*InitialNodesHandlerStub) MinNumberOfNodes

func (inhs *InitialNodesHandlerStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*InitialNodesHandlerStub) MinNumberOfNodesWithHysteresis added in v1.1.3

func (inhs *InitialNodesHandlerStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

type InitialNodesSetupHandlerStub

type InitialNodesSetupHandlerStub struct {
	InitialNodesInfoCalled               func() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
	MinNumberOfNodesCalled               func() uint32
	MinNumberOfNodesWithHysteresisCalled func() uint32
}

InitialNodesSetupHandlerStub -

func (*InitialNodesSetupHandlerStub) InitialNodesInfo

InitialNodesInfo -

func (*InitialNodesSetupHandlerStub) IsInterfaceNil

func (inshs *InitialNodesSetupHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*InitialNodesSetupHandlerStub) MinNumberOfNodes

func (inshs *InitialNodesSetupHandlerStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*InitialNodesSetupHandlerStub) MinNumberOfNodesWithHysteresis added in v1.2.0

func (inshs *InitialNodesSetupHandlerStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

type KeyGenMock added in v1.0.120

type KeyGenMock struct {
}

KeyGenMock -

func (*KeyGenMock) CheckPublicKeyValid added in v1.0.120

func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error

CheckPublicKeyValid -

func (*KeyGenMock) GeneratePair added in v1.0.120

func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)

GeneratePair -

func (*KeyGenMock) IsInterfaceNil added in v1.0.120

func (keyGen *KeyGenMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*KeyGenMock) PrivateKeyFromByteArray added in v1.0.120

func (keyGen *KeyGenMock) PrivateKeyFromByteArray(_ []byte) (crypto.PrivateKey, error)

PrivateKeyFromByteArray -

func (*KeyGenMock) PublicKeyFromByteArray added in v1.0.120

func (keyGen *KeyGenMock) PublicKeyFromByteArray(_ []byte) (crypto.PublicKey, error)

PublicKeyFromByteArray -

func (*KeyGenMock) Suite added in v1.0.120

func (keyGen *KeyGenMock) Suite() crypto.Suite

Suite -

type KeyGeneratorStub added in v1.0.120

type KeyGeneratorStub struct {
	GeneratePairCalled            func() (crypto.PrivateKey, crypto.PublicKey)
	PrivateKeyFromByteArrayCalled func(b []byte) (crypto.PrivateKey, error)
	PublicKeyFromByteArrayCalled  func(b []byte) (crypto.PublicKey, error)
	CheckPublicKeyValidCalled     func(b []byte) error
	SuiteCalled                   func() crypto.Suite
}

KeyGeneratorStub -

func (*KeyGeneratorStub) CheckPublicKeyValid added in v1.0.120

func (kgs *KeyGeneratorStub) CheckPublicKeyValid(b []byte) error

CheckPublicKeyValid -

func (*KeyGeneratorStub) GeneratePair added in v1.0.120

func (kgs *KeyGeneratorStub) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)

GeneratePair -

func (*KeyGeneratorStub) IsInterfaceNil added in v1.0.120

func (kgs *KeyGeneratorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*KeyGeneratorStub) PrivateKeyFromByteArray added in v1.0.120

func (kgs *KeyGeneratorStub) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)

PrivateKeyFromByteArray -

func (*KeyGeneratorStub) PublicKeyFromByteArray added in v1.0.120

func (kgs *KeyGeneratorStub) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)

PublicKeyFromByteArray -

func (*KeyGeneratorStub) Suite added in v1.0.120

func (kgs *KeyGeneratorStub) Suite() crypto.Suite

Suite -

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 MemDbMock

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

MemDbMock represents the memory database storage. It holds a map of key value pairs and a mutex to handle concurrent accesses to the map

func NewMemDbMock

func NewMemDbMock() *MemDbMock

NewMemDbMock creates a new memorydb object

func (*MemDbMock) Close

func (s *MemDbMock) Close() error

Close closes the files/resources associated to the storage medium

func (*MemDbMock) Destroy

func (s *MemDbMock) Destroy() error

Destroy removes the storage medium stored data

func (*MemDbMock) DestroyClosed

func (s *MemDbMock) DestroyClosed() error

DestroyClosed removes the already closed storage medium stored data

func (*MemDbMock) Get

func (s *MemDbMock) Get(key []byte) ([]byte, error)

Get gets the value associated to the key, or reports an error

func (*MemDbMock) Has

func (s *MemDbMock) Has(key []byte) error

Has returns true if the given key is present in the persistence medium, false otherwise

func (*MemDbMock) Init

func (s *MemDbMock) Init() error

Init initializes the storage medium and prepares it for usage

func (*MemDbMock) IsInterfaceNil

func (s *MemDbMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MemDbMock) Put

func (s *MemDbMock) Put(key, val []byte) error

Put adds the value to the (key, val) storage medium

func (*MemDbMock) Remove

func (s *MemDbMock) Remove(key []byte) error

Remove removes the data associated to the given key

type MiniBlockProvider added in v1.2.0

type MiniBlockProvider interface {
	GetMiniBlocks(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)
	GetMiniBlocksFromPool(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)
	GetMiniBlocksFromStorer(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)
	IsInterfaceNil() bool
}

MiniBlockProvider defines what a miniblock data provider should do

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 added in v1.0.149

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 NodesListSplitterStub

type NodesListSplitterStub struct {
	GetAllNodesCalled       func() []sharding.GenesisNodeInfoHandler
	GetDelegatedNodesCalled func(delegationScAddress []byte) []sharding.GenesisNodeInfoHandler
}

NodesListSplitterStub -

func (*NodesListSplitterStub) GetAllNodes

GetAllNodes -

func (*NodesListSplitterStub) GetDelegatedNodes

func (nlss *NodesListSplitterStub) GetDelegatedNodes(delegationScAddress []byte) []sharding.GenesisNodeInfoHandler

GetDelegatedNodes -

func (*NodesListSplitterStub) IsInterfaceNil

func (nlss *NodesListSplitterStub) IsInterfaceNil() bool

IsInterfaceNil -

type PrivateKeyMock added in v1.0.120

type PrivateKeyMock struct {
}

PrivateKeyMock -

func (*PrivateKeyMock) GeneratePublic added in v1.0.120

func (sk *PrivateKeyMock) GeneratePublic() crypto.PublicKey

GeneratePublic -

func (*PrivateKeyMock) IsInterfaceNil added in v1.0.120

func (sk *PrivateKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyMock) Scalar added in v1.0.120

func (sk *PrivateKeyMock) Scalar() crypto.Scalar

Scalar -

func (*PrivateKeyMock) Suite added in v1.0.120

func (sk *PrivateKeyMock) Suite() crypto.Suite

Suite -

func (*PrivateKeyMock) ToByteArray added in v1.0.120

func (sk *PrivateKeyMock) ToByteArray() ([]byte, error)

ToByteArray -

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 PubkeyConverterStub

type PubkeyConverterStub struct {
	LenCalled    func() int
	DecodeCalled func(humanReadable string) ([]byte, error)
	EncodeCalled func(pkBytes []byte) string
}

PubkeyConverterStub -

func (*PubkeyConverterStub) Decode

func (pcs *PubkeyConverterStub) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterStub) Encode

func (pcs *PubkeyConverterStub) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterStub) IsInterfaceNil

func (pcs *PubkeyConverterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterStub) Len

func (pcs *PubkeyConverterStub) Len() int

Len -

type PublicKeyMock added in v1.0.120

type PublicKeyMock struct {
}

PublicKeyMock -

func (*PublicKeyMock) IsInterfaceNil added in v1.0.120

func (sspk *PublicKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PublicKeyMock) Point added in v1.0.120

func (sspk *PublicKeyMock) Point() crypto.Point

Point -

func (*PublicKeyMock) Suite added in v1.0.120

func (sspk *PublicKeyMock) Suite() crypto.Suite

Suite -

func (*PublicKeyMock) ToByteArray added in v1.0.120

func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)

ToByteArray -

type QueryServiceStub added in v1.0.116

type QueryServiceStub struct {
	ComputeScCallGasLimitCalled func(tx *transaction.Transaction) (uint64, error)
	ExecuteQueryCalled          func(query *process.SCQuery) (*vmcommon.VMOutput, error)
	CloseCalled                 func() error
}

QueryServiceStub -

func (*QueryServiceStub) Close added in v1.2.0

func (qss *QueryServiceStub) Close() error

Close -

func (*QueryServiceStub) ComputeScCallGasLimit added in v1.0.116

func (qss *QueryServiceStub) ComputeScCallGasLimit(tx *transaction.Transaction) (uint64, error)

ComputeScCallGasLimit -

func (*QueryServiceStub) ExecuteQuery added in v1.0.116

func (qss *QueryServiceStub) ExecuteQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)

ExecuteQuery -

func (*QueryServiceStub) IsInterfaceNil added in v1.0.116

func (qss *QueryServiceStub) IsInterfaceNil() bool

IsInterfaceNil -

type ShardCoordinatorMock

type ShardCoordinatorMock struct {
	NumOfShards uint32
	SelfShardId uint32
}

ShardCoordinatorMock -

func (*ShardCoordinatorMock) CommunicationIdentifier

func (scm *ShardCoordinatorMock) CommunicationIdentifier(_ uint32) string

CommunicationIdentifier -

func (*ShardCoordinatorMock) ComputeId

func (scm *ShardCoordinatorMock) ComputeId(address []byte) uint32

ComputeId -

func (*ShardCoordinatorMock) IsInterfaceNil

func (scm *ShardCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*ShardCoordinatorMock) NumberOfShards

func (scm *ShardCoordinatorMock) NumberOfShards() uint32

NumberOfShards -

func (*ShardCoordinatorMock) SameShard

func (scm *ShardCoordinatorMock) SameShard(address1, address2 []byte) bool

SameShard -

func (*ShardCoordinatorMock) SelfId

func (scm *ShardCoordinatorMock) SelfId() uint32

SelfId -

type SmartContractParserStub

type SmartContractParserStub struct {
	InitialSmartContractsSplitOnOwnersShardsCalled func(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialSmartContractHandler, error)
	InitialSmartContractsCalled                    func() []genesis.InitialSmartContractHandler
	GetDeployedSCAddressesCalled                   func(scType string) (map[string]struct{}, error)
}

SmartContractParserStub -

func (*SmartContractParserStub) GetDeployedSCAddresses added in v1.0.133

func (scps *SmartContractParserStub) GetDeployedSCAddresses(scType string) (map[string]struct{}, error)

GetDeployedSCAddresses -

func (*SmartContractParserStub) InitialSmartContracts

func (scps *SmartContractParserStub) InitialSmartContracts() []genesis.InitialSmartContractHandler

InitialSmartContracts -

func (*SmartContractParserStub) InitialSmartContractsSplitOnOwnersShards

func (scps *SmartContractParserStub) InitialSmartContractsSplitOnOwnersShards(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialSmartContractHandler, error)

InitialSmartContractsSplitOnOwnersShards -

func (*SmartContractParserStub) IsInterfaceNil

func (scps *SmartContractParserStub) IsInterfaceNil() bool

IsInterfaceNil -

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 added in v1.2.0

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 added in v1.0.149

func (sms *StorageManagerStub) GetSnapshotDbBatchDelay() int

GetSnapshotDbBatchDelay -

func (*StorageManagerStub) GetSnapshotThatContainsHash added in v1.0.129

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 added in v1.0.147

func (sm *StorerMock) GetBulkFromEpoch(keys [][]byte, _ uint32) (map[string][]byte, error)

GetBulkFromEpoch -

func (*StorerMock) GetFromEpoch

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

GetFromEpoch -

func (*StorerMock) GetOldestEpoch added in v1.2.4

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 added in v1.1.1

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

PutInEpoch -

func (*StorerMock) RangeKeys added in v1.0.138

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 added in v1.3.7

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

RemoveFromCurrentEpoch -

func (*StorerMock) SearchFirst

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

SearchFirst -

type TxExecutionProcessorStub

type TxExecutionProcessorStub struct {
	ExecuteTransactionCalled func(nonce uint64, sndAddr []byte, rcvAddress []byte, value *big.Int, data []byte) error
	AccountExistsCalled      func(address []byte) bool
	GetNonceCalled           func(senderBytes []byte) (uint64, error)
	AddBalanceCalled         func(senderBytes []byte, value *big.Int) error
	AddNonceCalled           func(senderBytes []byte, nonce uint64) error
}

TxExecutionProcessorStub -

func (*TxExecutionProcessorStub) AddBalance

func (teps *TxExecutionProcessorStub) AddBalance(senderBytes []byte, value *big.Int) error

AddBalance -

func (*TxExecutionProcessorStub) AddNonce

func (teps *TxExecutionProcessorStub) AddNonce(senderBytes []byte, nonce uint64) error

AddNonce -

func (*TxExecutionProcessorStub) ExecuteTransaction

func (teps *TxExecutionProcessorStub) ExecuteTransaction(nonce uint64, sndAddr []byte, rcvAddress []byte, value *big.Int, data []byte) error

ExecuteTransaction -

func (*TxExecutionProcessorStub) GetAccount added in v1.0.133

func (teps *TxExecutionProcessorStub) GetAccount(address []byte) (state.UserAccountHandler, bool)

GetAccount -

func (*TxExecutionProcessorStub) GetExecutedTransactions added in v1.3.0

func (tep *TxExecutionProcessorStub) GetExecutedTransactions() []data.TransactionHandler

GetExecutedTransactions -

func (*TxExecutionProcessorStub) GetNonce

func (teps *TxExecutionProcessorStub) GetNonce(senderBytes []byte) (uint64, error)

GetNonce -

func (*TxExecutionProcessorStub) IsInterfaceNil

func (teps *TxExecutionProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

type TxLogProcessorMock

type TxLogProcessorMock struct {
}

TxLogProcessorMock -

func (*TxLogProcessorMock) Clean added in v1.2.3

func (tlpm *TxLogProcessorMock) Clean()

Clean -

func (*TxLogProcessorMock) GetAllCurrentLogs added in v1.2.3

func (tlpm *TxLogProcessorMock) GetAllCurrentLogs() []*data.LogData

GetAllCurrentLogs -

func (*TxLogProcessorMock) GetLog

func (tlpm *TxLogProcessorMock) GetLog(_ []byte) (data.LogHandler, error)

GetLog -

func (*TxLogProcessorMock) IsInterfaceNil

func (tlpm *TxLogProcessorMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*TxLogProcessorMock) SaveLog

SaveLog -

type Uint64ByteSliceConverterMock

type Uint64ByteSliceConverterMock struct {
}

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 UserAccountMock

type UserAccountMock struct {
	BaseAccountMock

	BalanceField *big.Int
	// contains filtered or unexported fields
}

UserAccountMock -

func (*UserAccountMock) AddToBalance

func (uam *UserAccountMock) AddToBalance(value *big.Int) error

AddToBalance -

func (*UserAccountMock) AddToDeveloperReward

func (uam *UserAccountMock) AddToDeveloperReward(_ *big.Int)

AddToDeveloperReward -

func (*UserAccountMock) ChangeOwnerAddress

func (uam *UserAccountMock) ChangeOwnerAddress(_ []byte, _ []byte) error

ChangeOwnerAddress -

func (*UserAccountMock) ClaimDeveloperRewards

func (uam *UserAccountMock) ClaimDeveloperRewards(_ []byte) (*big.Int, error)

ClaimDeveloperRewards -

func (*UserAccountMock) DataTrie

func (uam *UserAccountMock) DataTrie() common.Trie

DataTrie -

func (*UserAccountMock) DataTrieTracker

func (uam *UserAccountMock) DataTrieTracker() state.DataTrieTracker

DataTrieTracker -

func (*UserAccountMock) GetBalance

func (uam *UserAccountMock) GetBalance() *big.Int

GetBalance -

func (UserAccountMock) GetCodeHash

func (uam UserAccountMock) GetCodeHash() []byte

GetCodeHash -

func (*UserAccountMock) GetCodeMetadata

func (uam *UserAccountMock) GetCodeMetadata() []byte

GetCodeMetadata -

func (*UserAccountMock) GetDeveloperReward

func (uam *UserAccountMock) GetDeveloperReward() *big.Int

GetDeveloperReward -

func (*UserAccountMock) GetOwnerAddress

func (uam *UserAccountMock) GetOwnerAddress() []byte

GetOwnerAddress -

func (*UserAccountMock) GetRootHash

func (uam *UserAccountMock) GetRootHash() []byte

GetRootHash -

func (*UserAccountMock) GetUserName

func (uam *UserAccountMock) GetUserName() []byte

GetUserName -

func (*UserAccountMock) HasNewCode added in v1.1.22

func (uam *UserAccountMock) HasNewCode() bool

HasNewCode -

func (*UserAccountMock) RetrieveValueFromDataTrieTracker added in v1.2.10

func (uam *UserAccountMock) RetrieveValueFromDataTrieTracker(_ []byte) ([]byte, error)

RetrieveValueFromDataTrieTracker -

func (*UserAccountMock) SetCode

func (uam *UserAccountMock) SetCode(code []byte)

SetCode -

func (*UserAccountMock) SetCodeHash

func (uam *UserAccountMock) SetCodeHash(bytes []byte)

SetCodeHash -

func (*UserAccountMock) SetCodeMetadata

func (uam *UserAccountMock) SetCodeMetadata(codeMetadata []byte)

SetCodeMetadata -

func (*UserAccountMock) SetDataTrie

func (uam *UserAccountMock) SetDataTrie(_ common.Trie)

SetDataTrie -

func (*UserAccountMock) SetOwnerAddress

func (uam *UserAccountMock) SetOwnerAddress(_ []byte)

SetOwnerAddress -

func (*UserAccountMock) SetRootHash

func (uam *UserAccountMock) SetRootHash(bytes []byte)

SetRootHash -

func (*UserAccountMock) SetUserName

func (uam *UserAccountMock) SetUserName(_ []byte)

SetUserName -

func (*UserAccountMock) SubFromBalance

func (uam *UserAccountMock) SubFromBalance(value *big.Int) error

SubFromBalance -

Jump to

Keyboard shortcuts

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