Documentation ¶
Index ¶
- func NewNonceHashConverterMock() *nonceHashConverterMock
- func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
- type AccountsStub
- func (aam *AccountsStub) AddJournalEntry(je state.JournalEntry)
- func (aam *AccountsStub) Commit() ([]byte, error)
- func (aam *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)
- func (aam *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)
- func (aam *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)
- func (aam *AccountsStub) JournalLen() int
- func (aam *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error
- func (aam *AccountsStub) RecreateTrie(rootHash []byte) error
- func (aam *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error
- func (aam *AccountsStub) RemoveCode(codeHash []byte) error
- func (aam *AccountsStub) RevertToSnapshot(snapshot int) error
- func (aam *AccountsStub) RootHash() ([]byte, error)
- func (aam *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error
- func (aam *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error
- type AddressConverterFake
- func (acf *AddressConverterFake) AddressLen() int
- func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type AddressConverterStub
- func (ac AddressConverterStub) AddressLen() int
- func (ac AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (ac AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (ac AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (ac AddressConverterStub) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type AppStatusHandlerStub
- func (ashs *AppStatusHandlerStub) Close()
- func (ashs *AppStatusHandlerStub) Decrement(key string)
- func (ashs *AppStatusHandlerStub) Increment(key string)
- func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
- func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
- func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
- func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
- type BlockChainMock
- func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler
- func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte
- func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetGenesisHeaderHash() []byte
- func (bc *BlockChainMock) GetLocalHeight() int64
- func (bc *BlockChainMock) GetNetworkHeight() int64
- func (bc *BlockChainMock) HasBadBlock(blockHash []byte) bool
- func (bc *BlockChainMock) PutBadBlock(blockHash []byte)
- func (bc *BlockChainMock) SetCurrentBlockBody(body data.BodyHandler) error
- func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error
- func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)
- func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error
- func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)
- func (bc *BlockChainMock) SetLocalHeight(height int64)
- func (bc *BlockChainMock) SetNetworkHeight(height int64)
- type BlockProcessorStub
- func (blProcMock BlockProcessorStub) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
- func (blProcMock *BlockProcessorStub) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
- func (blProcMock *BlockProcessorStub) CreateBlockBody(round uint64, haveTime func() bool) (data.BodyHandler, error)
- func (blProcMock BlockProcessorStub) CreateBlockHeader(body data.BodyHandler, round uint64, haveTime func() bool) (data.HeaderHandler, error)
- func (blProcMock *BlockProcessorStub) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)
- func (blProcMock BlockProcessorStub) DecodeBlockBody(dta []byte) data.BodyHandler
- func (blProcMock BlockProcessorStub) DecodeBlockHeader(dta []byte) data.HeaderHandler
- func (blProcMock BlockProcessorStub) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
- func (blProcMock *BlockProcessorStub) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, ...) error
- func (blProcMock *BlockProcessorStub) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
- func (blProcMock *BlockProcessorStub) RevertAccountState()
- type CacherStub
- func (cs *CacherStub) Clear()
- func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)
- func (cs *CacherStub) Has(key []byte) bool
- func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
- func (cs *CacherStub) Keys() [][]byte
- func (cs *CacherStub) Len() int
- func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
- func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
- func (cs *CacherStub) RegisterHandler(handler func(key []byte))
- func (cs *CacherStub) Remove(key []byte)
- func (cs *CacherStub) RemoveOldest()
- type ChainHandlerStub
- func (chs *ChainHandlerStub) GetCurrentBlockBody() data.BodyHandler
- func (chs *ChainHandlerStub) GetCurrentBlockHeader() data.HeaderHandler
- func (chs *ChainHandlerStub) GetCurrentBlockHeaderHash() []byte
- func (chs *ChainHandlerStub) GetGenesisHeader() data.HeaderHandler
- func (chs *ChainHandlerStub) GetGenesisHeaderHash() []byte
- func (chs *ChainHandlerStub) GetLocalHeight() int64
- func (chs *ChainHandlerStub) GetNetworkHeight() int64
- func (chs *ChainHandlerStub) HasBadBlock(blockHash []byte) bool
- func (chs *ChainHandlerStub) PutBadBlock(blockHash []byte)
- func (chs *ChainHandlerStub) SetCurrentBlockBody(body data.BodyHandler) error
- func (chs *ChainHandlerStub) SetCurrentBlockHeader(bh data.HeaderHandler) error
- func (chs *ChainHandlerStub) SetCurrentBlockHeaderHash(hash []byte)
- func (chs *ChainHandlerStub) SetGenesisHeader(gb data.HeaderHandler) error
- func (chs *ChainHandlerStub) SetGenesisHeaderHash(hash []byte)
- func (chs *ChainHandlerStub) SetLocalHeight(height int64)
- func (chs *ChainHandlerStub) SetNetworkHeight(height int64)
- type ChainStorerMock
- func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerMock) Destroy() error
- func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- type ForkDetectorMock
- func (f *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, ...) error
- func (f *ForkDetectorMock) CheckFork() (bool, uint64, []byte)
- func (f *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
- func (f *ForkDetectorMock) ProbableHighestNonce() uint64
- func (f *ForkDetectorMock) RemoveHeaders(nonce uint64, hash []byte)
- func (fdm *ForkDetectorMock) ResetProbableHighestNonceIfNeeded()
- type GeneratorSuite
- type HasherFake
- type HasherMock
- type InterceptorsContainerStub
- func (ics *InterceptorsContainerStub) Add(key string, val process.Interceptor) error
- func (ics *InterceptorsContainerStub) AddMultiple(keys []string, interceptors []process.Interceptor) error
- func (ics *InterceptorsContainerStub) Get(key string) (process.Interceptor, error)
- func (ics *InterceptorsContainerStub) Len() int
- func (ics *InterceptorsContainerStub) Remove(key string)
- func (ics *InterceptorsContainerStub) Replace(key string, val process.Interceptor) error
- type KeyGenMock
- type MarshalizerFake
- type MarshalizerMock
- type MessengerStub
- func (ms *MessengerStub) Bootstrap() error
- func (ms *MessengerStub) Broadcast(topic string, buff []byte)
- func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
- func (ms *MessengerStub) BroadcastOnChannelBlocking(channel string, topic string, buff []byte)
- func (ms *MessengerStub) Close() error
- func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
- func (ms *MessengerStub) HasTopic(name string) bool
- func (ms *MessengerStub) HasTopicValidator(name string) bool
- func (ms *MessengerStub) PeerAddress(pid p2p.PeerID) string
- func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
- type MetaPoolsHolderStub
- func (mphs *MetaPoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (mphs *MetaPoolsHolderStub) MetaChainBlocks() storage.Cacher
- func (mphs *MetaPoolsHolderStub) MiniBlockHashes() dataRetriever.ShardedDataCacherNotifier
- func (mphs *MetaPoolsHolderStub) ShardHeaders() storage.Cacher
- type MultisignMock
- func (mm *MultisignMock) AggregateCommitments(bitmap []byte) error
- func (mm *MultisignMock) AggregateSigs(bitmap []byte) ([]byte, error)
- func (mm *MultisignMock) Commitment(index uint16) ([]byte, error)
- func (mm *MultisignMock) CommitmentHash(index uint16) ([]byte, error)
- func (mm *MultisignMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
- func (mm *MultisignMock) CreateCommitment() (commSecret []byte, commitment []byte)
- func (mm *MultisignMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
- func (mm *MultisignMock) Reset(pubKeys []string, index uint16) error
- func (mm *MultisignMock) SetAggregatedSig([]byte) error
- func (mm *MultisignMock) SignatureShare(index uint16) ([]byte, error)
- func (mm *MultisignMock) StoreCommitment(index uint16, value []byte) error
- func (mm *MultisignMock) StoreCommitmentHash(index uint16, commHash []byte) error
- func (mm *MultisignMock) StoreSignatureShare(index uint16, sig []byte) error
- func (mm *MultisignMock) Verify(msg []byte, bitmap []byte) error
- func (mm *MultisignMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
- type P2PMessageStub
- func (msg *P2PMessageStub) Data() []byte
- func (msg *P2PMessageStub) From() []byte
- func (msg *P2PMessageStub) Key() []byte
- func (msg *P2PMessageStub) Peer() p2p.PeerID
- func (msg *P2PMessageStub) SeqNo() []byte
- func (msg *P2PMessageStub) Signature() []byte
- func (msg *P2PMessageStub) TopicIDs() []string
- type PoolsHolderStub
- func (phs *PoolsHolderStub) Headers() storage.Cacher
- func (phs *PoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (phs *PoolsHolderStub) MetaBlocks() storage.Cacher
- func (phs *PoolsHolderStub) MetaHeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher
- func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
- func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type PrivateKeyStub
- type PublicKeyMock
- type ResolversFinderStub
- func (rfs *ResolversFinderStub) Add(key string, val dataRetriever.Resolver) error
- func (rfs *ResolversFinderStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
- func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) Get(key string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) Len() int
- func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) Remove(key string)
- func (rfs *ResolversFinderStub) Replace(key string, val dataRetriever.Resolver) error
- type RounderMock
- func (rndm *RounderMock) Index() int64
- func (rndm *RounderMock) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
- func (rndm *RounderMock) TimeDuration() time.Duration
- func (rndm *RounderMock) TimeStamp() time.Time
- func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
- type ScDataGetterStub
- type ShardCoordinatorMock
- func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm ShardCoordinatorMock) ComputeId(address state.AddressContainer) uint32
- func (scm ShardCoordinatorMock) NumberOfShards() uint32
- func (scm ShardCoordinatorMock) SameShard(firstAddress, secondAddress state.AddressContainer) bool
- func (scm ShardCoordinatorMock) SelfId() uint32
- func (scm ShardCoordinatorMock) SetSelfShardId(shardId uint32) error
- type ShardedDataStub
- func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)
- func (sd *ShardedDataStub) Clear()
- func (sd *ShardedDataStub) ClearShardStore(cacheId string)
- func (sd *ShardedDataStub) CreateShardStore(cacheId string)
- func (sd *ShardedDataStub) MergeShardStores(sourceCacheId, destCacheId string)
- func (sd *ShardedDataStub) MoveData(sourceCacheId, destCacheId string, key [][]byte)
- func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))
- func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)
- func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)
- func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)
- func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
- func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)
- type SinglesignFailMock
- type SinglesignMock
- type SinglesignStub
- type StorerStub
- func (ss *StorerStub) ClearCache()
- func (ss *StorerStub) DestroyUnit() error
- func (ss *StorerStub) Get(key []byte) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) (bool, error)
- func (ss *StorerStub) HasOrAdd(key []byte, value []byte) (bool, error)
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) Remove(key []byte) error
- type Streamer
- type SuiteMock
- func (s *SuiteMock) CreatePoint() crypto.Point
- func (s *SuiteMock) CreateScalar() crypto.Scalar
- func (s *SuiteMock) GetUnderlyingSuite() interface{}
- func (s *SuiteMock) PointLen() int
- func (s *SuiteMock) RandomStream() cipher.Stream
- func (s *SuiteMock) ScalarLen() int
- func (s *SuiteMock) String() string
- type SyncStub
- type Uint64CacherStub
- func (ucs *Uint64CacherStub) Clear()
- func (ucs *Uint64CacherStub) Get(nonce uint64) ([]byte, bool)
- func (ucs *Uint64CacherStub) Has(nonce uint64) bool
- func (ucs *Uint64CacherStub) HasOrAdd(nonce uint64, value []byte) (bool, bool)
- func (ucs *Uint64CacherStub) Keys() []uint64
- func (ucs *Uint64CacherStub) Len() int
- func (ucs *Uint64CacherStub) Peek(nonce uint64) ([]byte, bool)
- func (ucs *Uint64CacherStub) Put(nonce uint64, value []byte) bool
- func (ucs *Uint64CacherStub) RegisterHandler(handler func(nonce uint64))
- func (ucs *Uint64CacherStub) Remove(nonce uint64)
- func (ucs *Uint64CacherStub) RemoveOldest()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNonceHashConverterMock ¶
func NewNonceHashConverterMock() *nonceHashConverterMock
func NewOneShardCoordinatorMock ¶
func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
Types ¶
type AccountsStub ¶
type AccountsStub struct { AddJournalEntryCalled func(je state.JournalEntry) CommitCalled func() ([]byte, error) GetAccountWithJournalCalled func(addressContainer state.AddressContainer) (state.AccountHandler, error) GetExistingAccountCalled func(addressContainer state.AddressContainer) (state.AccountHandler, error) HasAccountStateCalled func(addressContainer state.AddressContainer) (bool, error) JournalLenCalled func() int PutCodeCalled func(accountHandler state.AccountHandler, code []byte) error RemoveAccountCalled func(addressContainer state.AddressContainer) error RemoveCodeCalled func(codeHash []byte) error RevertToSnapshotCalled func(snapshot int) error SaveAccountStateCalled func(acountWrapper state.AccountHandler) error SaveDataTrieCalled func(acountWrapper state.AccountHandler) error RootHashCalled func() ([]byte, error) RecreateTrieCalled func(rootHash []byte) error }
func (*AccountsStub) AddJournalEntry ¶ added in v1.0.3
func (aam *AccountsStub) AddJournalEntry(je state.JournalEntry)
func (*AccountsStub) Commit ¶
func (aam *AccountsStub) Commit() ([]byte, error)
func (*AccountsStub) GetAccountWithJournal ¶ added in v1.0.3
func (aam *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)
func (*AccountsStub) GetExistingAccount ¶
func (aam *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)
func (*AccountsStub) HasAccount ¶ added in v1.0.3
func (aam *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)
func (*AccountsStub) JournalLen ¶
func (aam *AccountsStub) JournalLen() int
func (*AccountsStub) PutCode ¶ added in v1.0.3
func (aam *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error
func (*AccountsStub) RecreateTrie ¶
func (aam *AccountsStub) RecreateTrie(rootHash []byte) error
func (*AccountsStub) RemoveAccount ¶
func (aam *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error
func (*AccountsStub) RemoveCode ¶ added in v1.0.3
func (aam *AccountsStub) RemoveCode(codeHash []byte) error
func (*AccountsStub) RevertToSnapshot ¶
func (aam *AccountsStub) RevertToSnapshot(snapshot int) error
func (*AccountsStub) RootHash ¶
func (aam *AccountsStub) RootHash() ([]byte, error)
func (*AccountsStub) SaveDataTrie ¶ added in v1.0.3
func (aam *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error
func (*AccountsStub) SaveJournalizedAccount ¶ added in v1.0.3
func (aam *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error
type AddressConverterFake ¶
type AddressConverterFake struct {
// contains filtered or unexported fields
}
func NewAddressConverterFake ¶
func NewAddressConverterFake(addressLen int, prefix string) *AddressConverterFake
func (*AddressConverterFake) AddressLen ¶
func (acf *AddressConverterFake) AddressLen() int
func (*AddressConverterFake) ConvertToHex ¶
func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
func (*AddressConverterFake) CreateAddressFromHex ¶
func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
func (*AddressConverterFake) CreateAddressFromPublicKeyBytes ¶
func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
func (*AddressConverterFake) PrepareAddressBytes ¶
func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
type AddressConverterStub ¶
type AddressConverterStub struct { CreateAddressFromPublicKeyBytesHandler func(pubKey []byte) (state.AddressContainer, error) ConvertToHexHandler func(addressContainer state.AddressContainer) (string, error) CreateAddressFromHexHandler func(hexAddress string) (state.AddressContainer, error) PrepareAddressBytesHandler func(addressBytes []byte) ([]byte, error) AddressLenHandler func() int }
func (AddressConverterStub) AddressLen ¶
func (ac AddressConverterStub) AddressLen() int
func (AddressConverterStub) ConvertToHex ¶
func (ac AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)
func (AddressConverterStub) CreateAddressFromHex ¶
func (ac AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
func (AddressConverterStub) CreateAddressFromPublicKeyBytes ¶
func (ac AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
func (AddressConverterStub) PrepareAddressBytes ¶
func (ac AddressConverterStub) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
type AppStatusHandlerStub ¶
type AppStatusHandlerStub struct { IncrementHandler func(key string) DecrementHandler func(key string) SetUInt64ValueHandler func(key string, value uint64) SetInt64ValueHandler func(key string, value int64) SetStringValueHandler func(key string, value string) CloseHandler func() }
AppStatusHandlerStub is a stub implementation of AppStatusHandler
func (*AppStatusHandlerStub) Close ¶
func (ashs *AppStatusHandlerStub) Close()
Close will call the handler of the stub for closing
func (*AppStatusHandlerStub) Decrement ¶
func (ashs *AppStatusHandlerStub) Decrement(key string)
Decrement will call the handler of the stub for decrementing
func (*AppStatusHandlerStub) Increment ¶
func (ashs *AppStatusHandlerStub) Increment(key string)
Increment will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) IsInterfaceNil ¶
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
func (*AppStatusHandlerStub) SetInt64Value ¶
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
SetInt64Value will call the handler of the stub for setting an int64 value
func (*AppStatusHandlerStub) SetStringValue ¶
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
SetStringValue will call the handler of the stub for setting an string value
func (*AppStatusHandlerStub) SetUInt64Value ¶
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
SetUInt64Value will call the handler of the stub for setting an uint64 value
type BlockChainMock ¶
type BlockChainMock struct { GetGenesisHeaderCalled func() data.HeaderHandler SetGenesisHeaderCalled func(handler data.HeaderHandler) error GetGenesisHeaderHashCalled func() []byte SetGenesisHeaderHashCalled func([]byte) GetCurrentBlockHeaderCalled func() data.HeaderHandler SetCurrentBlockHeaderCalled func(data.HeaderHandler) error GetCurrentBlockHeaderHashCalled func() []byte SetCurrentBlockHeaderHashCalled func([]byte) GetCurrentBlockBodyCalled func() data.BodyHandler SetCurrentBlockBodyCalled func(data.BodyHandler) error GetLocalHeightCalled func() int64 SetLocalHeightCalled func(int64) GetNetworkHeightCalled func() int64 SetNetworkHeightCalled func(int64) HasBadBlockCalled func([]byte) bool PutBadBlockCalled func([]byte) }
BlockChainMock is a mock implementation of the blockchain interface
func (*BlockChainMock) GetCurrentBlockBody ¶
func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler
GetCurrentBlockBody returns the tx block body pointer
func (*BlockChainMock) GetCurrentBlockHeader ¶
func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler
GetCurrentBlockHeader returns current block header pointer
func (*BlockChainMock) GetCurrentBlockHeaderHash ¶
func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte
GetCurrentBlockHeaderHash returns the current block header hash
func (*BlockChainMock) GetGenesisHeader ¶
func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler
GetGenesisHeader returns the genesis block header pointer
func (*BlockChainMock) GetGenesisHeaderHash ¶
func (bc *BlockChainMock) GetGenesisHeaderHash() []byte
GetGenesisHeaderHash returns the genesis block header hash
func (*BlockChainMock) GetLocalHeight ¶ added in v1.0.3
func (bc *BlockChainMock) GetLocalHeight() int64
GetLocalHeight returns the height of the local chain
func (*BlockChainMock) GetNetworkHeight ¶ added in v1.0.3
func (bc *BlockChainMock) GetNetworkHeight() int64
GetNetworkHeight sets the percieved height of the network chain
func (*BlockChainMock) HasBadBlock ¶ added in v1.0.3
func (bc *BlockChainMock) HasBadBlock(blockHash []byte) bool
HasBadBlock returns true if the provided hash is blacklisted as a bad block, or false otherwise
func (*BlockChainMock) PutBadBlock ¶ added in v1.0.3
func (bc *BlockChainMock) PutBadBlock(blockHash []byte)
PutBadBlock adds the given serialized block to the bad block cache, blacklisting it
func (*BlockChainMock) SetCurrentBlockBody ¶
func (bc *BlockChainMock) SetCurrentBlockBody(body data.BodyHandler) error
SetCurrentBlockBody sets the tx block body pointer
func (*BlockChainMock) SetCurrentBlockHeader ¶
func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error
SetCurrentBlockHeader sets current block header pointer
func (*BlockChainMock) SetCurrentBlockHeaderHash ¶
func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)
SetCurrentBlockHeaderHash returns the current block header hash
func (*BlockChainMock) SetGenesisHeader ¶
func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error
SetGenesisHeader sets the genesis block header pointer
func (*BlockChainMock) SetGenesisHeaderHash ¶
func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)
SetGenesisHeaderHash sets the genesis block header hash
func (*BlockChainMock) SetLocalHeight ¶ added in v1.0.3
func (bc *BlockChainMock) SetLocalHeight(height int64)
SetLocalHeight sets the height of the local chain
func (*BlockChainMock) SetNetworkHeight ¶ added in v1.0.3
func (bc *BlockChainMock) SetNetworkHeight(height int64)
SetNetworkHeight sets the percieved height of the network chain
type BlockProcessorStub ¶
type BlockProcessorStub struct { ProcessBlockCalled func(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error CommitBlockCalled func(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error RevertAccountStateCalled func() CreateGenesisBlockCalled func(balances map[string]*big.Int) (data.HeaderHandler, error) CreateBlockBodyCalled func(round uint64, haveTime func() bool) (data.BodyHandler, error) RestoreBlockIntoPoolsCalled func(header data.HeaderHandler, body data.BodyHandler) error SetOnRequestTransactionCalled func(f func(destShardID uint32, txHash []byte)) CreateBlockHeaderCalled func(body data.BodyHandler, round uint64, haveTime func() bool) (data.HeaderHandler, error) MarshalizedDataToBroadcastCalled func(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error) DecodeBlockBodyCalled func(dta []byte) data.BodyHandler DecodeBlockHeaderCalled func(dta []byte) data.HeaderHandler AddLastNotarizedHdrCalled func(shardId uint32, processedHdr data.HeaderHandler) }
BlockProcessorStub mocks the implementation for a blockProcessor
func (BlockProcessorStub) AddLastNotarizedHdr ¶
func (blProcMock BlockProcessorStub) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
func (*BlockProcessorStub) CommitBlock ¶
func (blProcMock *BlockProcessorStub) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
CommitBlock mocks the commit of a block
func (*BlockProcessorStub) CreateBlockBody ¶ added in v1.0.3
func (blProcMock *BlockProcessorStub) CreateBlockBody(round uint64, haveTime func() bool) (data.BodyHandler, error)
CreateTxBlockBody mocks the creation of a transaction block body
func (BlockProcessorStub) CreateBlockHeader ¶ added in v1.0.3
func (blProcMock BlockProcessorStub) CreateBlockHeader(body data.BodyHandler, round uint64, haveTime func() bool) (data.HeaderHandler, error)
func (*BlockProcessorStub) CreateGenesisBlock ¶
func (blProcMock *BlockProcessorStub) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)
CreateGenesisBlock mocks the creation of a genesis block body
func (BlockProcessorStub) DecodeBlockBody ¶
func (blProcMock BlockProcessorStub) DecodeBlockBody(dta []byte) data.BodyHandler
func (BlockProcessorStub) DecodeBlockHeader ¶
func (blProcMock BlockProcessorStub) DecodeBlockHeader(dta []byte) data.HeaderHandler
func (BlockProcessorStub) MarshalizedDataToBroadcast ¶
func (blProcMock BlockProcessorStub) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
func (*BlockProcessorStub) ProcessBlock ¶
func (blProcMock *BlockProcessorStub) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
ProcessBlock mocks pocessing a block
func (*BlockProcessorStub) RestoreBlockIntoPools ¶
func (blProcMock *BlockProcessorStub) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
func (*BlockProcessorStub) RevertAccountState ¶
func (blProcMock *BlockProcessorStub) RevertAccountState()
RevertAccountState mocks revert of the accounts state
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) HasCalled func(key []byte) bool PeekCalled func(key []byte) (value interface{}, ok bool) HasOrAddCalled func(key []byte, value interface{}) (ok, evicted bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int RegisterHandlerCalled func(func(key []byte)) }
func (*CacherStub) Clear ¶
func (cs *CacherStub) Clear()
func (*CacherStub) Get ¶
func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)
func (*CacherStub) Has ¶
func (cs *CacherStub) Has(key []byte) bool
func (*CacherStub) HasOrAdd ¶
func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
func (*CacherStub) Keys ¶
func (cs *CacherStub) Keys() [][]byte
func (*CacherStub) Len ¶
func (cs *CacherStub) Len() int
func (*CacherStub) Peek ¶
func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
func (*CacherStub) Put ¶
func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
func (*CacherStub) RegisterHandler ¶
func (cs *CacherStub) RegisterHandler(handler func(key []byte))
func (*CacherStub) Remove ¶
func (cs *CacherStub) Remove(key []byte)
func (*CacherStub) RemoveOldest ¶
func (cs *CacherStub) RemoveOldest()
type ChainHandlerStub ¶
type ChainHandlerStub struct { GetGenesisHeaderCalled func() data.HeaderHandler GetGenesisHeaderHashCalled func() []byte SetGenesisHeaderCalled func(gb data.HeaderHandler) error SetGenesisHeaderHashCalled func(hash []byte) }
func (*ChainHandlerStub) GetCurrentBlockBody ¶
func (chs *ChainHandlerStub) GetCurrentBlockBody() data.BodyHandler
func (*ChainHandlerStub) GetCurrentBlockHeader ¶
func (chs *ChainHandlerStub) GetCurrentBlockHeader() data.HeaderHandler
func (*ChainHandlerStub) GetCurrentBlockHeaderHash ¶
func (chs *ChainHandlerStub) GetCurrentBlockHeaderHash() []byte
func (*ChainHandlerStub) GetGenesisHeader ¶
func (chs *ChainHandlerStub) GetGenesisHeader() data.HeaderHandler
func (*ChainHandlerStub) GetGenesisHeaderHash ¶
func (chs *ChainHandlerStub) GetGenesisHeaderHash() []byte
func (*ChainHandlerStub) GetLocalHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) GetLocalHeight() int64
func (*ChainHandlerStub) GetNetworkHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) GetNetworkHeight() int64
func (*ChainHandlerStub) HasBadBlock ¶ added in v1.0.3
func (chs *ChainHandlerStub) HasBadBlock(blockHash []byte) bool
func (*ChainHandlerStub) PutBadBlock ¶ added in v1.0.3
func (chs *ChainHandlerStub) PutBadBlock(blockHash []byte)
func (*ChainHandlerStub) SetCurrentBlockBody ¶
func (chs *ChainHandlerStub) SetCurrentBlockBody(body data.BodyHandler) error
func (*ChainHandlerStub) SetCurrentBlockHeader ¶
func (chs *ChainHandlerStub) SetCurrentBlockHeader(bh data.HeaderHandler) error
func (*ChainHandlerStub) SetCurrentBlockHeaderHash ¶
func (chs *ChainHandlerStub) SetCurrentBlockHeaderHash(hash []byte)
func (*ChainHandlerStub) SetGenesisHeader ¶
func (chs *ChainHandlerStub) SetGenesisHeader(gb data.HeaderHandler) error
func (*ChainHandlerStub) SetGenesisHeaderHash ¶
func (chs *ChainHandlerStub) SetGenesisHeaderHash(hash []byte)
func (*ChainHandlerStub) SetLocalHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) SetLocalHeight(height int64)
func (*ChainHandlerStub) SetNetworkHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) SetNetworkHeight(height int64)
type ChainStorerMock ¶
type ChainStorerMock 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 }
ChainStorerMock is a mock implementation of the ChianStorer interface
func (*ChainStorerMock) AddStorer ¶
func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
AddStorer will add a new storer to the chain map
func (*ChainStorerMock) Destroy ¶
func (bc *ChainStorerMock) Destroy() error
Destroy removes the underlying files/resources used by the storage service
func (*ChainStorerMock) Get ¶
func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
Get returns the value for the given key if found in the selected storage unit, nil otherwise. It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error
func (*ChainStorerMock) GetAll ¶
func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
GetAll gets all the elements with keys in the keys array, from the selected storage unit It can report an error if the provided unit type is not supported, if there is a missing key in the unit, or if the underlying implementation of the storage unit reports an error.
func (*ChainStorerMock) GetStorer ¶
func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
GetStorer returns the storer from the chain map or nil if the storer was not found
func (*ChainStorerMock) Has ¶
func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
Has returns true if the key is found in the selected Unit or false otherwise It can return an error if the provided unit type is not supported or if the underlying implementation of the storage unit reports an error.
func (*ChainStorerMock) Put ¶
func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
Put stores the key, value pair in the selected storage unit It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error
type ForkDetectorMock ¶
type ForkDetectorMock struct { AddHeaderCalled func(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, finalHeader data.HeaderHandler, finalHeaderHash []byte) error RemoveHeadersCalled func(nonce uint64, hash []byte) CheckForkCalled func() (bool, uint64, []byte) GetHighestFinalBlockNonceCalled func() uint64 ProbableHighestNonceCalled func() uint64 ResetProbableHighestNonceIfNeededCalled func() }
ForkDetectorMock is a mock implementation for the ForkDetector interface
func (*ForkDetectorMock) AddHeader ¶
func (f *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, finalHeader data.HeaderHandler, finalHeaderHash []byte) error
AddHeader is a mock implementation for AddHeader
func (*ForkDetectorMock) CheckFork ¶
func (f *ForkDetectorMock) CheckFork() (bool, uint64, []byte)
CheckFork is a mock implementation for CheckFork
func (*ForkDetectorMock) GetHighestFinalBlockNonce ¶
func (f *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce
func (*ForkDetectorMock) ProbableHighestNonce ¶
func (f *ForkDetectorMock) ProbableHighestNonce() uint64
ProbableHighestNonce is a mock implementation for GetProbableHighestNonce
func (*ForkDetectorMock) RemoveHeaders ¶ added in v1.0.3
func (f *ForkDetectorMock) RemoveHeaders(nonce uint64, hash []byte)
RemoveHeaders is a mock implementation for RemoveHeaders
func (*ForkDetectorMock) ResetProbableHighestNonceIfNeeded ¶ added in v1.0.11
func (fdm *ForkDetectorMock) ResetProbableHighestNonceIfNeeded()
type GeneratorSuite ¶
type HasherFake ¶
type HasherFake struct { }
HasherFake that will be used for testing
func (HasherFake) Compute ¶
func (sha HasherFake) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (HasherFake) EmptyHash ¶
func (sha HasherFake) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
type HasherMock ¶
func (HasherMock) Compute ¶
func (hash HasherMock) Compute(s string) []byte
func (HasherMock) EmptyHash ¶
func (hash HasherMock) EmptyHash() []byte
func (HasherMock) Size ¶
func (HasherMock) Size() int
type InterceptorsContainerStub ¶
type InterceptorsContainerStub struct { }
func (*InterceptorsContainerStub) Add ¶
func (ics *InterceptorsContainerStub) Add(key string, val process.Interceptor) error
func (*InterceptorsContainerStub) AddMultiple ¶
func (ics *InterceptorsContainerStub) AddMultiple(keys []string, interceptors []process.Interceptor) error
func (*InterceptorsContainerStub) Get ¶
func (ics *InterceptorsContainerStub) Get(key string) (process.Interceptor, error)
func (*InterceptorsContainerStub) Len ¶
func (ics *InterceptorsContainerStub) Len() int
func (*InterceptorsContainerStub) Remove ¶
func (ics *InterceptorsContainerStub) Remove(key string)
func (*InterceptorsContainerStub) Replace ¶
func (ics *InterceptorsContainerStub) Replace(key string, val process.Interceptor) error
type KeyGenMock ¶
type KeyGenMock struct { GeneratePairMock func() (crypto.PrivateKey, crypto.PublicKey) PrivateKeyFromByteArrayMock func(b []byte) (crypto.PrivateKey, error) PublicKeyFromByteArrayMock func(b []byte) (crypto.PublicKey, error) SuiteMock func() crypto.Suite }
func (*KeyGenMock) GeneratePair ¶
func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
func (*KeyGenMock) PrivateKeyFromByteArray ¶
func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
func (*KeyGenMock) PublicKeyFromByteArray ¶
func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
func (*KeyGenMock) Suite ¶
func (keyGen *KeyGenMock) Suite() crypto.Suite
type MarshalizerFake ¶
type MarshalizerFake struct {
Fail bool
}
MarshalizerFake that will be used for testing
func (*MarshalizerFake) Marshal ¶
func (mm *MarshalizerFake) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerFake) Unmarshal ¶
func (mm *MarshalizerFake) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type MarshalizerMock ¶
type MarshalizerMock struct { MarshalHandler func(obj interface{}) ([]byte, error) UnmarshalHandler func(obj interface{}, buff []byte) error }
func (MarshalizerMock) Marshal ¶
func (j MarshalizerMock) Marshal(obj interface{}) ([]byte, error)
func (MarshalizerMock) Unmarshal ¶
func (j MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
type MessengerStub ¶
type MessengerStub struct { CloseCalled func() error CreateTopicCalled func(name string, createChannelForTopic bool) error HasTopicCalled func(name string) bool HasTopicValidatorCalled func(name string) bool BroadcastOnChannelCalled func(channel string, topic string, buff []byte) BroadcastCalled func(topic string, buff []byte) RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error BootstrapCalled func() error PeerAddressCalled func(pid p2p.PeerID) string BroadcastOnChannelBlockingCalled func(channel string, topic string, buff []byte) }
func (*MessengerStub) Bootstrap ¶
func (ms *MessengerStub) Bootstrap() error
func (*MessengerStub) Broadcast ¶
func (ms *MessengerStub) Broadcast(topic string, buff []byte)
func (*MessengerStub) BroadcastOnChannel ¶
func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
func (*MessengerStub) BroadcastOnChannelBlocking ¶
func (ms *MessengerStub) BroadcastOnChannelBlocking(channel string, topic string, buff []byte)
func (*MessengerStub) Close ¶
func (ms *MessengerStub) Close() error
func (*MessengerStub) CreateTopic ¶
func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
func (*MessengerStub) HasTopic ¶
func (ms *MessengerStub) HasTopic(name string) bool
func (*MessengerStub) HasTopicValidator ¶
func (ms *MessengerStub) HasTopicValidator(name string) bool
func (*MessengerStub) PeerAddress ¶
func (ms *MessengerStub) PeerAddress(pid p2p.PeerID) string
func (*MessengerStub) RegisterMessageProcessor ¶
func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
type MetaPoolsHolderStub ¶ added in v1.0.3
type MetaPoolsHolderStub struct { MetaChainBlocksCalled func() storage.Cacher MiniBlockHashesCalled func() dataRetriever.ShardedDataCacherNotifier ShardHeadersCalled func() storage.Cacher HeadersNoncesCalled func() dataRetriever.Uint64SyncMapCacher }
func (*MetaPoolsHolderStub) HeadersNonces ¶ added in v1.0.11
func (mphs *MetaPoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*MetaPoolsHolderStub) MetaChainBlocks ¶ added in v1.0.3
func (mphs *MetaPoolsHolderStub) MetaChainBlocks() storage.Cacher
func (*MetaPoolsHolderStub) MiniBlockHashes ¶ added in v1.0.3
func (mphs *MetaPoolsHolderStub) MiniBlockHashes() dataRetriever.ShardedDataCacherNotifier
func (*MetaPoolsHolderStub) ShardHeaders ¶ added in v1.0.3
func (mphs *MetaPoolsHolderStub) ShardHeaders() storage.Cacher
type MultisignMock ¶
type MultisignMock struct { }
func (*MultisignMock) AggregateCommitments ¶
func (mm *MultisignMock) AggregateCommitments(bitmap []byte) error
func (*MultisignMock) AggregateSigs ¶
func (mm *MultisignMock) AggregateSigs(bitmap []byte) ([]byte, error)
func (*MultisignMock) Commitment ¶
func (mm *MultisignMock) Commitment(index uint16) ([]byte, error)
func (*MultisignMock) CommitmentHash ¶
func (mm *MultisignMock) CommitmentHash(index uint16) ([]byte, error)
func (*MultisignMock) Create ¶
func (mm *MultisignMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
func (*MultisignMock) CreateCommitment ¶
func (mm *MultisignMock) CreateCommitment() (commSecret []byte, commitment []byte)
func (*MultisignMock) CreateSignatureShare ¶
func (mm *MultisignMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
func (*MultisignMock) SetAggregatedSig ¶
func (mm *MultisignMock) SetAggregatedSig([]byte) error
func (*MultisignMock) SignatureShare ¶
func (mm *MultisignMock) SignatureShare(index uint16) ([]byte, error)
func (*MultisignMock) StoreCommitment ¶
func (mm *MultisignMock) StoreCommitment(index uint16, value []byte) error
func (*MultisignMock) StoreCommitmentHash ¶
func (mm *MultisignMock) StoreCommitmentHash(index uint16, commHash []byte) error
func (*MultisignMock) StoreSignatureShare ¶
func (mm *MultisignMock) StoreSignatureShare(index uint16, sig []byte) error
func (*MultisignMock) VerifySignatureShare ¶
type P2PMessageStub ¶
type P2PMessageStub struct { FromField []byte DataField []byte SeqNoField []byte TopicIDsField []string SignatureField []byte KeyField []byte PeerField p2p.PeerID }
func (*P2PMessageStub) Data ¶
func (msg *P2PMessageStub) Data() []byte
func (*P2PMessageStub) From ¶
func (msg *P2PMessageStub) From() []byte
func (*P2PMessageStub) Key ¶
func (msg *P2PMessageStub) Key() []byte
func (*P2PMessageStub) Peer ¶
func (msg *P2PMessageStub) Peer() p2p.PeerID
func (*P2PMessageStub) SeqNo ¶
func (msg *P2PMessageStub) SeqNo() []byte
func (*P2PMessageStub) Signature ¶
func (msg *P2PMessageStub) Signature() []byte
func (*P2PMessageStub) TopicIDs ¶ added in v1.0.3
func (msg *P2PMessageStub) TopicIDs() []string
type PoolsHolderStub ¶
type PoolsHolderStub struct { HeadersCalled func() storage.Cacher HeadersNoncesCalled func() dataRetriever.Uint64SyncMapCacher PeerChangesBlocksCalled func() storage.Cacher TransactionsCalled func() dataRetriever.ShardedDataCacherNotifier UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier MiniBlocksCalled func() storage.Cacher MetaBlocksCalled func() storage.Cacher MetaHeadersNoncesCalled func() dataRetriever.Uint64SyncMapCacher }
func (*PoolsHolderStub) Headers ¶
func (phs *PoolsHolderStub) Headers() storage.Cacher
func (*PoolsHolderStub) HeadersNonces ¶ added in v1.0.3
func (phs *PoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*PoolsHolderStub) MetaBlocks ¶ added in v1.0.3
func (phs *PoolsHolderStub) MetaBlocks() storage.Cacher
func (*PoolsHolderStub) MetaHeadersNonces ¶ added in v1.0.3
func (phs *PoolsHolderStub) MetaHeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*PoolsHolderStub) MiniBlocks ¶
func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher
func (*PoolsHolderStub) PeerChangesBlocks ¶
func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
func (*PoolsHolderStub) Transactions ¶
func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderStub) UnsignedTransactions ¶
func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
type PrivateKeyStub ¶
type PrivateKeyStub struct { ToByteArrayHandler func() ([]byte, error) GeneratePublicHandler func() crypto.PublicKey SuiteHandler func() crypto.Suite ScalarHandler func() crypto.Scalar }
func (*PrivateKeyStub) GeneratePublic ¶
func (sk *PrivateKeyStub) GeneratePublic() crypto.PublicKey
func (*PrivateKeyStub) Scalar ¶
func (sk *PrivateKeyStub) Scalar() crypto.Scalar
func (*PrivateKeyStub) Suite ¶
func (sk *PrivateKeyStub) Suite() crypto.Suite
func (*PrivateKeyStub) ToByteArray ¶
func (sk *PrivateKeyStub) ToByteArray() ([]byte, error)
type PublicKeyMock ¶
type PublicKeyMock struct { ToByteArrayHandler func() ([]byte, error) SuiteCalled func() crypto.Suite PointCalled func() crypto.Point }
func (*PublicKeyMock) Point ¶
func (sspk *PublicKeyMock) Point() crypto.Point
func (*PublicKeyMock) Suite ¶
func (sspk *PublicKeyMock) Suite() crypto.Suite
func (*PublicKeyMock) ToByteArray ¶
func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)
type ResolversFinderStub ¶
type ResolversFinderStub 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 IntraShardResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) MetaChainResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) CrossShardResolverCalled func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error) }
func (*ResolversFinderStub) Add ¶
func (rfs *ResolversFinderStub) Add(key string, val dataRetriever.Resolver) error
func (*ResolversFinderStub) AddMultiple ¶
func (rfs *ResolversFinderStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
func (*ResolversFinderStub) CrossShardResolver ¶
func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) Get ¶
func (rfs *ResolversFinderStub) Get(key string) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) IntraShardResolver ¶
func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) Len ¶
func (rfs *ResolversFinderStub) Len() int
func (*ResolversFinderStub) MetaChainResolver ¶
func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) Remove ¶
func (rfs *ResolversFinderStub) Remove(key string)
func (*ResolversFinderStub) Replace ¶
func (rfs *ResolversFinderStub) Replace(key string, val dataRetriever.Resolver) error
type RounderMock ¶
type RounderMock struct { 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 // contains filtered or unexported fields }
func (*RounderMock) Index ¶
func (rndm *RounderMock) Index() int64
func (*RounderMock) RemainingTime ¶
func (*RounderMock) TimeDuration ¶
func (rndm *RounderMock) TimeDuration() time.Duration
func (*RounderMock) TimeStamp ¶
func (rndm *RounderMock) TimeStamp() time.Time
func (*RounderMock) UpdateRound ¶
func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
type ScDataGetterStub ¶ added in v1.0.11
type ShardCoordinatorMock ¶
type ShardCoordinatorMock struct {
SelfShardId uint32
}
func (ShardCoordinatorMock) CommunicationIdentifier ¶
func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
func (ShardCoordinatorMock) ComputeId ¶
func (scm ShardCoordinatorMock) ComputeId(address state.AddressContainer) uint32
func (ShardCoordinatorMock) NumberOfShards ¶
func (scm ShardCoordinatorMock) NumberOfShards() uint32
func (ShardCoordinatorMock) SameShard ¶
func (scm ShardCoordinatorMock) SameShard(firstAddress, secondAddress state.AddressContainer) bool
func (ShardCoordinatorMock) SelfId ¶
func (scm ShardCoordinatorMock) SelfId() uint32
func (ShardCoordinatorMock) SetSelfShardId ¶
func (scm ShardCoordinatorMock) SetSelfShardId(shardId uint32) error
type ShardedDataStub ¶
type ShardedDataStub struct { RegisterHandlerCalled func(func(key []byte)) ShardDataStoreCalled func(cacheId string) (c storage.Cacher) AddDataCalled func(key []byte, data interface{}, cacheId string) SearchFirstDataCalled func(key []byte) (value interface{}, ok bool) RemoveDataCalled func(key []byte, cacheId string) RemoveDataFromAllShardsCalled func(key []byte) MergeShardStoresCalled func(sourceCacheId, destCacheId string) MoveDataCalled func(sourceCacheId, destCacheId string, key [][]byte) ClearCalled func() ClearShardStoreCalled func(cacheId string) RemoveSetOfDataFromPoolCalled func(keys [][]byte, destCacheId string) CreateShardStoreCalled func(destCacheId string) }
func (*ShardedDataStub) AddData ¶
func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)
func (*ShardedDataStub) Clear ¶
func (sd *ShardedDataStub) Clear()
func (*ShardedDataStub) ClearShardStore ¶
func (sd *ShardedDataStub) ClearShardStore(cacheId string)
func (*ShardedDataStub) CreateShardStore ¶
func (sd *ShardedDataStub) CreateShardStore(cacheId string)
func (*ShardedDataStub) MergeShardStores ¶
func (sd *ShardedDataStub) MergeShardStores(sourceCacheId, destCacheId string)
func (*ShardedDataStub) MoveData ¶ added in v1.0.3
func (sd *ShardedDataStub) MoveData(sourceCacheId, destCacheId string, key [][]byte)
func (*ShardedDataStub) RegisterHandler ¶
func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))
func (*ShardedDataStub) RemoveData ¶
func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)
func (*ShardedDataStub) RemoveDataFromAllShards ¶
func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)
func (*ShardedDataStub) RemoveSetOfDataFromPool ¶
func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)
func (*ShardedDataStub) SearchFirstData ¶
func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
func (*ShardedDataStub) ShardDataStore ¶
func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)
type SinglesignFailMock ¶
type SinglesignFailMock struct { }
func (*SinglesignFailMock) Sign ¶
func (s *SinglesignFailMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign Signs a message with using a single signature schnorr scheme
type SinglesignMock ¶
type SinglesignMock struct { }
func (*SinglesignMock) Sign ¶
func (s *SinglesignMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign Signs a message with using a single signature schnorr scheme
type SinglesignStub ¶
type SinglesignStub struct { SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error }
func (*SinglesignStub) Sign ¶
func (s *SinglesignStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign Signs a message with using a single signature schnorr scheme
type StorerStub ¶
type StorerStub struct { PutCalled func(key, data []byte) error GetCalled func(key []byte) ([]byte, error) HasCalled func(key []byte) (bool, error) HasOrAddCalled func(key []byte, value []byte) (bool, error) RemoveCalled func(key []byte) error ClearCacheCalled func() DestroyUnitCalled func() error }
func (*StorerStub) ClearCache ¶
func (ss *StorerStub) ClearCache()
func (*StorerStub) DestroyUnit ¶
func (ss *StorerStub) DestroyUnit() error
func (*StorerStub) HasOrAdd ¶ added in v1.0.3
func (ss *StorerStub) HasOrAdd(key []byte, value []byte) (bool, error)
func (*StorerStub) Put ¶
func (ss *StorerStub) Put(key, data []byte) error
func (*StorerStub) Remove ¶
func (ss *StorerStub) Remove(key []byte) error
type Streamer ¶
type Streamer struct {
// contains filtered or unexported fields
}
func NewStreamer ¶
func NewStreamer() *Streamer
func (*Streamer) XORKeyStream ¶
type SuiteMock ¶
type SuiteMock struct { StringStub func() string ScalarLenStub func() int CreateScalarStub func() crypto.Scalar PointLenStub func() int CreatePointStub func() crypto.Point RandomStreamStub func() cipher.Stream GetUnderlyingSuiteStub func() interface{} }
func (*SuiteMock) CreatePoint ¶
func (*SuiteMock) CreateScalar ¶
func (*SuiteMock) GetUnderlyingSuite ¶
func (s *SuiteMock) GetUnderlyingSuite() interface{}
func (*SuiteMock) RandomStream ¶
type SyncStub ¶
type SyncStub struct { }
func (*SyncStub) ClockOffset ¶
func (*SyncStub) CurrentTime ¶
func (*SyncStub) FormattedCurrentTime ¶
type Uint64CacherStub ¶
type Uint64CacherStub struct { ClearCalled func() PutCalled func(uint64, []byte) bool GetCalled func(uint64) ([]byte, bool) HasCalled func(uint64) bool PeekCalled func(uint64) ([]byte, bool) HasOrAddCalled func(uint64, []byte) (bool, bool) RemoveCalled func(uint64) RemoveOldestCalled func() KeysCalled func() []uint64 LenCalled func() int RegisterHandlerCalled func(handler func(nonce uint64)) }
func (*Uint64CacherStub) Clear ¶
func (ucs *Uint64CacherStub) Clear()
func (*Uint64CacherStub) Has ¶
func (ucs *Uint64CacherStub) Has(nonce uint64) bool
func (*Uint64CacherStub) HasOrAdd ¶
func (ucs *Uint64CacherStub) HasOrAdd(nonce uint64, value []byte) (bool, bool)
func (*Uint64CacherStub) Keys ¶
func (ucs *Uint64CacherStub) Keys() []uint64
func (*Uint64CacherStub) Len ¶
func (ucs *Uint64CacherStub) Len() int
func (*Uint64CacherStub) RegisterHandler ¶
func (ucs *Uint64CacherStub) RegisterHandler(handler func(nonce uint64))
func (*Uint64CacherStub) Remove ¶
func (ucs *Uint64CacherStub) Remove(nonce uint64)
func (*Uint64CacherStub) RemoveOldest ¶
func (ucs *Uint64CacherStub) RemoveOldest()
Source Files ¶
- accountsStub.go
- addressConverterFake.go
- addressConverterStub.go
- appStatusHandlerStub.go
- blockChainMock.go
- blockProcessorStub.go
- cacherStub.go
- chainHandlerStub.go
- chainStorerMock.go
- forkDetectorMock.go
- hasherFake.go
- hasherMock.go
- interceptorContainerStub.go
- keyMock.go
- marshalizerFake.go
- marshalizerMock.go
- messengerStub.go
- metaPoolsHolderStub.go
- multisignMock.go
- nonceHashConverterMock.go
- oneShardCoordinatorMock.go
- p2pMessageStub.go
- poolsHolderStub.go
- resolversFinderStub.go
- rounderMock.go
- scDataGetterStub.go
- shardCoordinatorMock.go
- shardedDataStub.go
- singlesignerMock.go
- storerStub.go
- streamerMock.go
- suiteStub.go
- syncStub.go
- uint64CacherStub.go