dataRetriever

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePoolsHolder

func CreatePoolsHolder(numShards uint32, selfShard uint32) dataRetriever.PoolsHolder

CreatePoolsHolder -

func CreatePoolsHolderWithTxPool

func CreatePoolsHolderWithTxPool(txPool dataRetriever.ShardedDataCacherNotifier) dataRetriever.PoolsHolder

CreatePoolsHolderWithTxPool -

func CreateTxPool

func CreateTxPool(numShards uint32, selfShard uint32) (dataRetriever.ShardedDataCacherNotifier, error)

CreateTxPool -

Types

type ChunkRequesterStub added in v1.6.0

type ChunkRequesterStub struct {
	RequesterStub
	RequestDataFromReferenceAndChunkCalled func(reference []byte, chunkIndex uint32) error
}

ChunkRequesterStub -

func (*ChunkRequesterStub) RequestDataFromReferenceAndChunk added in v1.6.0

func (stub *ChunkRequesterStub) RequestDataFromReferenceAndChunk(reference []byte, chunkIndex uint32) error

RequestDataFromReferenceAndChunk -

type EpochRequesterStub added in v1.6.0

type EpochRequesterStub struct {
	RequesterStub
	RequestDataFromEpochCalled func(identifier []byte) error
}

EpochRequesterStub -

func (*EpochRequesterStub) RequestDataFromEpoch added in v1.6.0

func (stub *EpochRequesterStub) RequestDataFromEpoch(identifier []byte) error

RequestDataFromEpoch -

type HashSliceRequesterStub added in v1.6.0

type HashSliceRequesterStub struct {
	RequesterStub
	RequestDataFromHashArrayCalled func(hashes [][]byte, epoch uint32) error
}

HashSliceRequesterStub -

func (*HashSliceRequesterStub) IsInterfaceNil added in v1.6.0

func (stub *HashSliceRequesterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HashSliceRequesterStub) RequestDataFromHashArray added in v1.6.0

func (stub *HashSliceRequesterStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error

RequestDataFromHashArray -

type HeaderRequesterStub added in v1.6.0

type HeaderRequesterStub struct {
	RequestDataFromHashCalled  func(hash []byte, epoch uint32) error
	SetNumPeersToQueryCalled   func(intra int, cross int)
	NumPeersToQueryCalled      func() (int, int)
	SetDebugHandlerCalled      func(handler dataRetriever.DebugHandler) error
	RequestDataFromEpochCalled func(identifier []byte) error
	RequestDataFromNonceCalled func(nonce uint64, epoch uint32) error
}

HeaderRequesterStub -

func (*HeaderRequesterStub) IsInterfaceNil added in v1.6.0

func (stub *HeaderRequesterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderRequesterStub) NumPeersToQuery added in v1.6.0

func (stub *HeaderRequesterStub) NumPeersToQuery() (int, int)

NumPeersToQuery -

func (*HeaderRequesterStub) RequestDataFromEpoch added in v1.6.0

func (stub *HeaderRequesterStub) RequestDataFromEpoch(identifier []byte) error

RequestDataFromEpoch -

func (*HeaderRequesterStub) RequestDataFromHash added in v1.6.0

func (stub *HeaderRequesterStub) RequestDataFromHash(hash []byte, epoch uint32) error

RequestDataFromHash -

func (*HeaderRequesterStub) RequestDataFromNonce added in v1.6.0

func (stub *HeaderRequesterStub) RequestDataFromNonce(nonce uint64, epoch uint32) error

RequestDataFromNonce -

func (*HeaderRequesterStub) SetDebugHandler added in v1.6.0

func (stub *HeaderRequesterStub) SetDebugHandler(handler dataRetriever.DebugHandler) error

SetDebugHandler -

func (*HeaderRequesterStub) SetNumPeersToQuery added in v1.6.0

func (stub *HeaderRequesterStub) SetNumPeersToQuery(intra int, cross int)

SetNumPeersToQuery -

type NonceRequesterStub added in v1.6.0

type NonceRequesterStub struct {
	RequesterStub
	RequestDataFromNonceCalled func(nonce uint64, epoch uint32) error
}

NonceRequesterStub -

func (*NonceRequesterStub) RequestDataFromNonce added in v1.6.0

func (stub *NonceRequesterStub) RequestDataFromNonce(nonce uint64, epoch uint32) error

RequestDataFromNonce -

type PoolsHolderMock

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

PoolsHolderMock -

func NewPoolsHolderMock

func NewPoolsHolderMock() *PoolsHolderMock

NewPoolsHolderMock -

func (*PoolsHolderMock) Close

func (holder *PoolsHolderMock) Close() error

Close -

func (*PoolsHolderMock) CurrentBlockTxs

func (holder *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher

CurrentBlockTxs -

func (*PoolsHolderMock) CurrentEpochValidatorInfo

func (holder *PoolsHolderMock) CurrentEpochValidatorInfo() dataRetriever.ValidatorInfoCacher

CurrentEpochValidatorInfo -

func (*PoolsHolderMock) Headers

func (holder *PoolsHolderMock) Headers() dataRetriever.HeadersPool

Headers -

func (*PoolsHolderMock) Heartbeats

func (holder *PoolsHolderMock) Heartbeats() storage.Cacher

Heartbeats -

func (*PoolsHolderMock) IsInterfaceNil

func (holder *PoolsHolderMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PoolsHolderMock) MiniBlocks

func (holder *PoolsHolderMock) MiniBlocks() storage.Cacher

MiniBlocks -

func (*PoolsHolderMock) PeerAuthentications

func (holder *PoolsHolderMock) PeerAuthentications() storage.Cacher

PeerAuthentications -

func (*PoolsHolderMock) PeerChangesBlocks

func (holder *PoolsHolderMock) PeerChangesBlocks() storage.Cacher

PeerChangesBlocks -

func (*PoolsHolderMock) RewardTransactions

func (holder *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier

RewardTransactions -

func (*PoolsHolderMock) SetHeadersPool added in v1.7.6

func (holder *PoolsHolderMock) SetHeadersPool(headersPool dataRetriever.HeadersPool)

SetHeadersPool -

func (*PoolsHolderMock) SetTransactions

func (holder *PoolsHolderMock) SetTransactions(pool dataRetriever.ShardedDataCacherNotifier)

SetTransactions -

func (*PoolsHolderMock) SetUnsignedTransactions

func (holder *PoolsHolderMock) SetUnsignedTransactions(pool dataRetriever.ShardedDataCacherNotifier)

SetUnsignedTransactions -

func (*PoolsHolderMock) SmartContracts

func (holder *PoolsHolderMock) SmartContracts() storage.Cacher

SmartContracts -

func (*PoolsHolderMock) Transactions

Transactions -

func (*PoolsHolderMock) TrieNodes

func (holder *PoolsHolderMock) TrieNodes() storage.Cacher

TrieNodes -

func (*PoolsHolderMock) TrieNodesChunks

func (holder *PoolsHolderMock) TrieNodesChunks() storage.Cacher

TrieNodesChunks -

func (*PoolsHolderMock) UnsignedTransactions

func (holder *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier

UnsignedTransactions -

func (*PoolsHolderMock) ValidatorsInfo

func (holder *PoolsHolderMock) ValidatorsInfo() dataRetriever.ShardedDataCacherNotifier

ValidatorsInfo -

type PoolsHolderStub

type PoolsHolderStub struct {
	HeadersCalled                func() dataRetriever.HeadersPool
	TransactionsCalled           func() dataRetriever.ShardedDataCacherNotifier
	UnsignedTransactionsCalled   func() dataRetriever.ShardedDataCacherNotifier
	RewardTransactionsCalled     func() dataRetriever.ShardedDataCacherNotifier
	MiniBlocksCalled             func() storage.Cacher
	MetaBlocksCalled             func() storage.Cacher
	CurrBlockTxsCalled           func() dataRetriever.TransactionCacher
	CurrEpochValidatorInfoCalled func() dataRetriever.ValidatorInfoCacher
	TrieNodesCalled              func() storage.Cacher
	TrieNodesChunksCalled        func() storage.Cacher
	PeerChangesBlocksCalled      func() storage.Cacher
	SmartContractsCalled         func() storage.Cacher
	PeerAuthenticationsCalled    func() storage.Cacher
	HeartbeatsCalled             func() storage.Cacher
	ValidatorsInfoCalled         func() dataRetriever.ShardedDataCacherNotifier
	CloseCalled                  func() error
}

PoolsHolderStub -

func NewPoolsHolderStub

func NewPoolsHolderStub() *PoolsHolderStub

NewPoolsHolderStub -

func (*PoolsHolderStub) Close

func (holder *PoolsHolderStub) Close() error

Close -

func (*PoolsHolderStub) CurrentBlockTxs

func (holder *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher

CurrentBlockTxs -

func (*PoolsHolderStub) CurrentEpochValidatorInfo

func (holder *PoolsHolderStub) CurrentEpochValidatorInfo() dataRetriever.ValidatorInfoCacher

CurrentEpochValidatorInfo -

func (*PoolsHolderStub) Headers

func (holder *PoolsHolderStub) Headers() dataRetriever.HeadersPool

Headers -

func (*PoolsHolderStub) Heartbeats

func (holder *PoolsHolderStub) Heartbeats() storage.Cacher

Heartbeats -

func (*PoolsHolderStub) IsInterfaceNil

func (holder *PoolsHolderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PoolsHolderStub) MetaBlocks

func (holder *PoolsHolderStub) MetaBlocks() storage.Cacher

MetaBlocks -

func (*PoolsHolderStub) MiniBlocks

func (holder *PoolsHolderStub) MiniBlocks() storage.Cacher

MiniBlocks -

func (*PoolsHolderStub) PeerAuthentications

func (holder *PoolsHolderStub) PeerAuthentications() storage.Cacher

PeerAuthentications -

func (*PoolsHolderStub) PeerChangesBlocks

func (holder *PoolsHolderStub) PeerChangesBlocks() storage.Cacher

PeerChangesBlocks -

func (*PoolsHolderStub) RewardTransactions

func (holder *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier

RewardTransactions -

func (*PoolsHolderStub) SmartContracts

func (holder *PoolsHolderStub) SmartContracts() storage.Cacher

SmartContracts -

func (*PoolsHolderStub) Transactions

Transactions -

func (*PoolsHolderStub) TrieNodes

func (holder *PoolsHolderStub) TrieNodes() storage.Cacher

TrieNodes -

func (*PoolsHolderStub) TrieNodesChunks

func (holder *PoolsHolderStub) TrieNodesChunks() storage.Cacher

TrieNodesChunks -

func (*PoolsHolderStub) UnsignedTransactions

func (holder *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier

UnsignedTransactions -

func (*PoolsHolderStub) ValidatorsInfo

func (holder *PoolsHolderStub) ValidatorsInfo() dataRetriever.ShardedDataCacherNotifier

ValidatorsInfo -

type RequesterStub added in v1.6.0

type RequesterStub struct {
	RequestDataFromHashCalled func(hash []byte, epoch uint32) error
	SetNumPeersToQueryCalled  func(intra int, cross int)
	NumPeersToQueryCalled     func() (int, int)
	SetDebugHandlerCalled     func(handler dataRetriever.DebugHandler) error
}

RequesterStub -

func (*RequesterStub) IsInterfaceNil added in v1.6.0

func (stub *RequesterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RequesterStub) NumPeersToQuery added in v1.6.0

func (stub *RequesterStub) NumPeersToQuery() (int, int)

NumPeersToQuery -

func (*RequesterStub) RequestDataFromHash added in v1.6.0

func (stub *RequesterStub) RequestDataFromHash(hash []byte, epoch uint32) error

RequestDataFromHash -

func (*RequesterStub) SetDebugHandler added in v1.6.0

func (stub *RequesterStub) SetDebugHandler(handler dataRetriever.DebugHandler) error

SetDebugHandler -

func (*RequesterStub) SetNumPeersToQuery added in v1.6.0

func (stub *RequesterStub) SetNumPeersToQuery(intra int, cross int)

SetNumPeersToQuery -

type RequestersContainerStub added in v1.6.0

type RequestersContainerStub struct {
	GetCalled           func(key string) (dataRetriever.Requester, error)
	AddCalled           func(key string, val dataRetriever.Requester) error
	AddMultipleCalled   func(keys []string, requesters []dataRetriever.Requester) error
	ReplaceCalled       func(key string, val dataRetriever.Requester) error
	RemoveCalled        func(key string)
	LenCalled           func() int
	RequesterKeysCalled func() string
	IterateCalled       func(handler func(key string, requester dataRetriever.Requester) bool)
	CloseCalled         func() error
}

RequestersContainerStub -

func (*RequestersContainerStub) Add added in v1.6.0

Add -

func (*RequestersContainerStub) AddMultiple added in v1.6.0

func (stub *RequestersContainerStub) AddMultiple(keys []string, requesters []dataRetriever.Requester) error

AddMultiple -

func (*RequestersContainerStub) Close added in v1.6.0

func (stub *RequestersContainerStub) Close() error

Close -

func (*RequestersContainerStub) Get added in v1.6.0

Get -

func (*RequestersContainerStub) IsInterfaceNil added in v1.6.0

func (stub *RequestersContainerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RequestersContainerStub) Iterate added in v1.6.0

func (stub *RequestersContainerStub) Iterate(handler func(key string, requester dataRetriever.Requester) bool)

Iterate -

func (*RequestersContainerStub) Len added in v1.6.0

func (stub *RequestersContainerStub) Len() int

Len -

func (*RequestersContainerStub) Remove added in v1.6.0

func (stub *RequestersContainerStub) Remove(key string)

Remove -

func (*RequestersContainerStub) Replace added in v1.6.0

Replace -

func (*RequestersContainerStub) RequesterKeys added in v1.6.0

func (stub *RequestersContainerStub) RequesterKeys() string

RequesterKeys -

type RequestersFinderStub added in v1.6.0

type RequestersFinderStub struct {
	IntraShardRequesterCalled     func(baseTopic string) (dataRetriever.Requester, error)
	MetaChainRequesterCalled      func(baseTopic string) (dataRetriever.Requester, error)
	CrossShardRequesterCalled     func(baseTopic string, crossShard uint32) (dataRetriever.Requester, error)
	MetaCrossShardRequesterCalled func(baseTopic string, crossShard uint32) (dataRetriever.Requester, error)
	GetCalled                     func(key string) (dataRetriever.Requester, error)
	AddCalled                     func(key string, val dataRetriever.Requester) error
	AddMultipleCalled             func(keys []string, requesters []dataRetriever.Requester) error
	ReplaceCalled                 func(key string, val dataRetriever.Requester) error
	RemoveCalled                  func(key string)
	LenCalled                     func() int
	RequesterKeysCalled           func() string
	IterateCalled                 func(handler func(key string, requester dataRetriever.Requester) bool)
	CloseCalled                   func() error
}

RequestersFinderStub -

func (*RequestersFinderStub) Add added in v1.6.0

Add -

func (*RequestersFinderStub) AddMultiple added in v1.6.0

func (stub *RequestersFinderStub) AddMultiple(keys []string, requesters []dataRetriever.Requester) error

AddMultiple -

func (*RequestersFinderStub) Close added in v1.6.0

func (stub *RequestersFinderStub) Close() error

Close -

func (*RequestersFinderStub) CrossShardRequester added in v1.6.0

func (stub *RequestersFinderStub) CrossShardRequester(baseTopic string, crossShard uint32) (dataRetriever.Requester, error)

CrossShardRequester -

func (*RequestersFinderStub) Get added in v1.6.0

Get -

func (*RequestersFinderStub) IntraShardRequester added in v1.6.0

func (stub *RequestersFinderStub) IntraShardRequester(baseTopic string) (dataRetriever.Requester, error)

IntraShardRequester -

func (*RequestersFinderStub) IsInterfaceNil added in v1.6.0

func (stub *RequestersFinderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RequestersFinderStub) Iterate added in v1.6.0

func (stub *RequestersFinderStub) Iterate(handler func(key string, requester dataRetriever.Requester) bool)

Iterate -

func (*RequestersFinderStub) Len added in v1.6.0

func (stub *RequestersFinderStub) Len() int

Len -

func (*RequestersFinderStub) MetaChainRequester added in v1.6.0

func (stub *RequestersFinderStub) MetaChainRequester(baseTopic string) (dataRetriever.Requester, error)

MetaChainRequester -

func (*RequestersFinderStub) MetaCrossShardRequester added in v1.6.0

func (stub *RequestersFinderStub) MetaCrossShardRequester(baseTopic string, crossShard uint32) (dataRetriever.Requester, error)

MetaCrossShardRequester -

func (*RequestersFinderStub) Remove added in v1.6.0

func (stub *RequestersFinderStub) Remove(key string)

Remove -

func (*RequestersFinderStub) Replace added in v1.6.0

func (stub *RequestersFinderStub) Replace(key string, val dataRetriever.Requester) error

Replace -

func (*RequestersFinderStub) RequesterKeys added in v1.6.0

func (stub *RequestersFinderStub) RequesterKeys() string

RequesterKeys -

type ResolversContainerStub added in v1.6.0

type ResolversContainerStub struct {
	GetCalled          func(key string) (dataRetriever.Resolver, error)
	AddCalled          func(key string, val dataRetriever.Resolver) error
	ReplaceCalled      func(key string, val dataRetriever.Resolver) error
	RemoveCalled       func(key string)
	LenCalled          func() int
	ResolverKeysCalled func() string
	IterateCalled      func(handler func(key string, resolver dataRetriever.Resolver) bool)
	CloseCalled        func() error
}

ResolversContainerStub -

func (*ResolversContainerStub) Add added in v1.6.0

Add -

func (*ResolversContainerStub) AddMultiple added in v1.6.0

func (rcs *ResolversContainerStub) AddMultiple(_ []string, _ []dataRetriever.Resolver) error

AddMultiple -

func (*ResolversContainerStub) Close added in v1.6.0

func (rcs *ResolversContainerStub) Close() error

Close -

func (*ResolversContainerStub) Get added in v1.6.0

Get -

func (*ResolversContainerStub) IsInterfaceNil added in v1.6.0

func (rcs *ResolversContainerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ResolversContainerStub) Iterate added in v1.6.0

func (rcs *ResolversContainerStub) Iterate(handler func(key string, resolver dataRetriever.Resolver) bool)

Iterate -

func (*ResolversContainerStub) Len added in v1.6.0

func (rcs *ResolversContainerStub) Len() int

Len -

func (*ResolversContainerStub) Remove added in v1.6.0

func (rcs *ResolversContainerStub) Remove(key string)

Remove -

func (*ResolversContainerStub) Replace added in v1.6.0

func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error

Replace -

func (*ResolversContainerStub) ResolverKeys added in v1.6.0

func (rcs *ResolversContainerStub) ResolverKeys() string

ResolverKeys -

type TopicRequestSenderStub added in v1.6.0

type TopicRequestSenderStub struct {
	SendOnRequestTopicCalled func(rd *dataRetriever.RequestData, originalHashes [][]byte) error
	SetNumPeersToQueryCalled func(intra int, cross int)
	GetNumPeersToQueryCalled func() (int, int)
	RequestTopicCalled       func() string
	TargetShardIDCalled      func() uint32
	SetDebugHandlerCalled    func(handler dataRetriever.DebugHandler) error
	DebugHandlerCalled       func() dataRetriever.DebugHandler
}

TopicRequestSenderStub -

func (*TopicRequestSenderStub) DebugHandler added in v1.6.0

func (stub *TopicRequestSenderStub) DebugHandler() dataRetriever.DebugHandler

DebugHandler -

func (*TopicRequestSenderStub) IsInterfaceNil added in v1.6.0

func (stub *TopicRequestSenderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*TopicRequestSenderStub) NumPeersToQuery added in v1.6.0

func (stub *TopicRequestSenderStub) NumPeersToQuery() (int, int)

NumPeersToQuery -

func (*TopicRequestSenderStub) RequestTopic added in v1.6.0

func (stub *TopicRequestSenderStub) RequestTopic() string

RequestTopic -

func (*TopicRequestSenderStub) SendOnRequestTopic added in v1.6.0

func (stub *TopicRequestSenderStub) SendOnRequestTopic(rd *dataRetriever.RequestData, originalHashes [][]byte) error

SendOnRequestTopic -

func (*TopicRequestSenderStub) SetDebugHandler added in v1.6.0

func (stub *TopicRequestSenderStub) SetDebugHandler(handler dataRetriever.DebugHandler) error

SetDebugHandler -

func (*TopicRequestSenderStub) SetNumPeersToQuery added in v1.6.0

func (stub *TopicRequestSenderStub) SetNumPeersToQuery(intra int, cross int)

SetNumPeersToQuery -

func (*TopicRequestSenderStub) TargetShardID added in v1.6.0

func (stub *TopicRequestSenderStub) TargetShardID() uint32

TargetShardID -

Jump to

Keyboard shortcuts

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