Documentation ¶
Index ¶
- 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 Facade
- func (f *Facade) GenerateAndSendBulkTransactions(destination string, value *big.Int, nrTransactions uint64) error
- func (f *Facade) GenerateAndSendBulkTransactionsOneByOne(destination string, value *big.Int, nrTransactions uint64) error
- func (f *Facade) GenerateTransaction(sender string, receiver string, value *big.Int, code string) (*transaction.Transaction, error)
- func (f *Facade) GetAccount(address string) (*state.Account, error)
- func (f *Facade) GetBalance(address string) (*big.Int, error)
- func (f *Facade) GetCurrentPublicKey() string
- func (f *Facade) GetHeartbeats() ([]heartbeat.PubKeyHeartbeat, error)
- func (f *Facade) GetTransaction(hash string) (*transaction.Transaction, error)
- func (f *Facade) IsNodeRunning() bool
- func (f *Facade) RecentNotarizedBlocks(maxShardHeadersNum int) ([]*external.BlockHeader, error)
- func (f *Facade) RetrieveShardBlock(blockHash []byte) (*external.ShardBlockInfo, error)
- func (f *Facade) SendTransaction(nonce uint64, sender string, receiver string, value *big.Int, gasPrice uint64, ...) (string, error)
- func (f *Facade) StartNode() error
- func (f *Facade) StopNode() error
- func (f *Facade) TpsBenchmark() *statistics.TpsBenchmark
- type WrongFacade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 Facade ¶
type Facade struct { Running bool ShouldErrorStart bool ShouldErrorStop bool GetCurrentPublicKeyHandler func() string TpsBenchmarkHandler func() *statistics.TpsBenchmark GetHeartbeatsHandler func() ([]heartbeat.PubKeyHeartbeat, error) BalanceHandler func(string) (*big.Int, error) GetAccountHandler func(address string) (*state.Account, error) GenerateTransactionHandler func(sender string, receiver string, value *big.Int, code string) (*transaction.Transaction, error) GetTransactionHandler func(hash string) (*transaction.Transaction, error) SendTransactionHandler func(nonce uint64, sender string, receiver string, value *big.Int, gasPrice uint64, gasLimit uint64, code string, signature []byte) (string, error) GenerateAndSendBulkTransactionsHandler func(destination string, value *big.Int, nrTransactions uint64) error GenerateAndSendBulkTransactionsOneByOneHandler func(destination string, value *big.Int, nrTransactions uint64) error RecentNotarizedBlocksHandler func(maxShardHeadersNum int) ([]*external.BlockHeader, error) RetrieveShardBlockHandler func(blockHash []byte) (*external.ShardBlockInfo, error) }
Facade is the mock implementation of a node router handler
func (*Facade) GenerateAndSendBulkTransactions ¶ added in v1.0.3
func (f *Facade) GenerateAndSendBulkTransactions(destination string, value *big.Int, nrTransactions uint64) error
GenerateAndSendBulkTransactions is the mock implementation of a handler's GenerateAndSendBulkTransactions method
func (*Facade) GenerateAndSendBulkTransactionsOneByOne ¶ added in v1.0.3
func (f *Facade) GenerateAndSendBulkTransactionsOneByOne(destination string, value *big.Int, nrTransactions uint64) error
GenerateAndSendBulkTransactionsOneByOne is the mock implementation of a handler's GenerateAndSendBulkTransactionsOneByOne method
func (*Facade) GenerateTransaction ¶
func (f *Facade) GenerateTransaction(sender string, receiver string, value *big.Int, code string) (*transaction.Transaction, error)
GenerateTransaction is the mock implementation of a handler's GenerateTransaction method
func (*Facade) GetAccount ¶
GetAccount is the mock implementation of a handler's GetAccount method
func (*Facade) GetBalance ¶
GetBalance is the mock implementation of a handler's GetBalance method
func (*Facade) GetCurrentPublicKey ¶ added in v1.0.3
GetCurrentPublicKey is the mock implementation of a handler's StopNode method
func (*Facade) GetHeartbeats ¶
func (f *Facade) GetHeartbeats() ([]heartbeat.PubKeyHeartbeat, error)
func (*Facade) GetTransaction ¶
func (f *Facade) GetTransaction(hash string) (*transaction.Transaction, error)
GetTransaction is the mock implementation of a handler's GetTransaction method
func (*Facade) IsNodeRunning ¶
IsNodeRunning is the mock implementation of a handler's IsNodeRunning method
func (*Facade) RecentNotarizedBlocks ¶ added in v1.0.3
func (f *Facade) RecentNotarizedBlocks(maxShardHeadersNum int) ([]*external.BlockHeader, error)
func (*Facade) RetrieveShardBlock ¶ added in v1.0.3
func (f *Facade) RetrieveShardBlock(blockHash []byte) (*external.ShardBlockInfo, error)
func (*Facade) SendTransaction ¶ added in v1.0.3
func (f *Facade) SendTransaction(nonce uint64, sender string, receiver string, value *big.Int, gasPrice uint64, gasLimit uint64, code string, signature []byte) (string, error)
SendTransaction is the mock implementation of a handler's SendTransaction method
func (*Facade) TpsBenchmark ¶
func (f *Facade) TpsBenchmark() *statistics.TpsBenchmark
TpsBenchmark is the mock implementation for retreiving the TpsBenchmark
type WrongFacade ¶
type WrongFacade struct { }
WrongFacade is a struct that can be used as a wrong implementation of the node router handler