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) IsInterfaceNil() bool
- func (cs *CacherStub) Keys() [][]byte
- func (cs *CacherStub) Len() int
- func (cs *CacherStub) MaxSize() 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, value interface{}))
- func (cs *CacherStub) Remove(key []byte)
- func (cs *CacherStub) RemoveOldest()
- func (cs *CacherStub) UnRegisterHandler(handler func(key []byte, value interface{}))
- type Facade
- func (f *Facade) ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error)
- func (f *Facade) CreateTransaction(nonce uint64, value string, receiverHex string, senderHex string, ...) (*transaction.Transaction, []byte, error)
- func (f *Facade) DecodeAddressPubkey(pk string) ([]byte, error)
- func (f *Facade) EncodeAddressPubkey(pk []byte) (string, error)
- func (f *Facade) ExecuteSCQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)
- func (f *Facade) GetAccount(address string) (state.UserAccountHandler, error)
- func (f *Facade) GetBalance(address string) (*big.Int, error)
- func (f *Facade) GetHeartbeats() ([]data.PubKeyHeartbeat, error)
- func (f *Facade) GetQueryHandler(name string) (debug.QueryHandler, error)
- func (f *Facade) GetTransaction(hash string) (*transaction.ApiTransactionResult, error)
- func (f *Facade) GetTransactionStatus(hash string) (string, error)
- func (f *Facade) GetValueForKey(address string, key string) (string, error)
- func (f *Facade) IsInterfaceNil() bool
- func (f *Facade) NodeConfig() map[string]interface{}
- func (f *Facade) PprofEnabled() bool
- func (f *Facade) RestAPIServerDebugMode() bool
- func (f *Facade) RestApiInterface() string
- func (f *Facade) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
- func (f *Facade) StatusMetrics() external.StatusMetricsHandler
- func (f *Facade) TpsBenchmark() *statistics.TpsBenchmark
- func (f *Facade) ValidateTransaction(tx *transaction.Transaction) error
- func (f *Facade) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
- type HardforkFacade
- type LoggerStub
- func (l *LoggerStub) Debug(message string, args ...interface{})
- func (l *LoggerStub) Error(message string, args ...interface{})
- func (l *LoggerStub) GetLevel() logger.LogLevel
- func (l *LoggerStub) Info(message string, args ...interface{})
- func (l *LoggerStub) IsInterfaceNil() bool
- func (l *LoggerStub) Log(line *logger.LogLine)
- func (l *LoggerStub) LogIfError(err error, args ...interface{})
- func (l *LoggerStub) SetLevel(logLevel logger.LogLevel)
- func (l *LoggerStub) Trace(message string, args ...interface{})
- func (l *LoggerStub) Warn(message string, args ...interface{})
- type MarshalizerStub
- type QueryHandlerStub
- type WrongFacade
- type WsConnStub
- func (wcs *WsConnStub) Close() error
- func (wcs *WsConnStub) ReadMessage() (messageType int, p []byte, err error)
- func (wcs *WsConnStub) SetCloseHandler(f func() error)
- func (wcs *WsConnStub) SetReadMessageHandler(f func() (messageType int, p []byte, err error))
- func (wcs *WsConnStub) SetWriteMessageHandler(f func(messageType int, data []byte) error)
- func (wcs *WsConnStub) WriteMessage(messageType int, data []byte) error
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 MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte, value interface{})) UnRegisterHandlerCalled func(func(key []byte, value interface{})) }
CacherStub -
func (*CacherStub) HasOrAdd ¶
func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
HasOrAdd -
func (*CacherStub) IsInterfaceNil ¶
func (cs *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Peek ¶
func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherStub) Put ¶
func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
Put -
func (*CacherStub) RegisterHandler ¶
func (cs *CacherStub) RegisterHandler(handler func(key []byte, value interface{}))
RegisterHandler -
func (*CacherStub) UnRegisterHandler ¶ added in v1.0.126
func (cs *CacherStub) UnRegisterHandler(handler func(key []byte, value interface{}))
UnRegisterHandler -
type Facade ¶
type Facade struct { ShouldErrorStart bool ShouldErrorStop bool TpsBenchmarkHandler func() *statistics.TpsBenchmark GetHeartbeatsHandler func() ([]data.PubKeyHeartbeat, error) BalanceHandler func(string) (*big.Int, error) GetAccountHandler func(address string) (state.UserAccountHandler, error) GenerateTransactionHandler func(sender string, receiver string, value *big.Int, code string) (*transaction.Transaction, error) GetTransactionHandler func(hash string) (*transaction.ApiTransactionResult, error) CreateTransactionHandler func(nonce uint64, value string, receiverHex string, senderHex string, gasPrice uint64, gasLimit uint64, data string, signatureHex string) (*transaction.Transaction, []byte, error) ValidateTransactionHandler func(tx *transaction.Transaction) error SendBulkTransactionsHandler func(txs []*transaction.Transaction) (uint64, error) ExecuteSCQueryHandler func(query *process.SCQuery) (*vmcommon.VMOutput, error) StatusMetricsHandler func() external.StatusMetricsHandler ValidatorStatisticsHandler func() (map[string]*state.ValidatorApiResponse, error) ComputeTransactionGasLimitHandler func(tx *transaction.Transaction) (uint64, error) NodeConfigCalled func() map[string]interface{} GetQueryHandlerCalled func(name string) (debug.QueryHandler, error) GetTransactionStatusCalled func(hash string) (string, error) GetValueForKeyCalled func(address string, key string) (string, error) }
Facade is the mock implementation of a node router handler
func (*Facade) ComputeTransactionGasLimit ¶
func (f *Facade) ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error)
ComputeTransactionGasLimit --
func (*Facade) CreateTransaction ¶
func (f *Facade) CreateTransaction( nonce uint64, value string, receiverHex string, senderHex string, gasPrice uint64, gasLimit uint64, data string, signatureHex string, ) (*transaction.Transaction, []byte, error)
CreateTransaction is mock implementation of a handler's CreateTransaction method
func (*Facade) DecodeAddressPubkey ¶ added in v1.0.104
DecodeAddressPubkey -
func (*Facade) EncodeAddressPubkey ¶ added in v1.0.104
EncodeAddressPubkey -
func (*Facade) ExecuteSCQuery ¶
ExecuteSCQuery is a mock implementation.
func (*Facade) GetAccount ¶
func (f *Facade) GetAccount(address string) (state.UserAccountHandler, error)
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) GetHeartbeats ¶
func (f *Facade) GetHeartbeats() ([]data.PubKeyHeartbeat, error)
GetHeartbeats returns the slice of heartbeat info
func (*Facade) GetQueryHandler ¶ added in v1.0.110
func (f *Facade) GetQueryHandler(name string) (debug.QueryHandler, error)
GetQueryHandler -
func (*Facade) GetTransaction ¶
func (f *Facade) GetTransaction(hash string) (*transaction.ApiTransactionResult, error)
GetTransaction is the mock implementation of a handler's GetTransaction method
func (*Facade) GetTransactionStatus ¶ added in v1.0.125
GetTransactionStatus -
func (*Facade) GetValueForKey ¶ added in v1.0.125
GetValueForKey is the mock implementation of a handler's GetValueForKey method
func (*Facade) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Facade) NodeConfig ¶ added in v1.0.104
NodeConfig -
func (*Facade) RestAPIServerDebugMode ¶
RestAPIServerDebugMode -
func (*Facade) SendBulkTransactions ¶
func (f *Facade) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
SendBulkTransactions is the mock implementation of a handler's SendBulkTransactions method
func (*Facade) StatusMetrics ¶
func (f *Facade) StatusMetrics() external.StatusMetricsHandler
StatusMetrics is the mock implementation for the StatusMetrics
func (*Facade) TpsBenchmark ¶
func (f *Facade) TpsBenchmark() *statistics.TpsBenchmark
TpsBenchmark is the mock implementation for retreiving the TpsBenchmark
func (*Facade) ValidateTransaction ¶
func (f *Facade) ValidateTransaction(tx *transaction.Transaction) error
ValidateTransaction --
func (*Facade) ValidatorStatisticsApi ¶
func (f *Facade) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
ValidatorStatisticsApi is the mock implementation of a handler's ValidatorStatisticsApi method
type HardforkFacade ¶ added in v1.0.102
type HardforkFacade struct { TriggerCalled func(epoch uint32) error IsSelfTriggerCalled func() bool }
HardforkFacade -
func (*HardforkFacade) IsSelfTrigger ¶ added in v1.0.102
func (hf *HardforkFacade) IsSelfTrigger() bool
IsSelfTrigger -
func (*HardforkFacade) Trigger ¶ added in v1.0.102
func (hf *HardforkFacade) Trigger(epoch uint32) error
Trigger -
type LoggerStub ¶
type LoggerStub struct { LogCalled func(level string, message string, args ...interface{}) SetLevelCalled func(logLevel logger.LogLevel) }
LoggerStub -
func (*LoggerStub) GetLevel ¶ added in v0.0.5
func (l *LoggerStub) GetLevel() logger.LogLevel
GetLevel -
func (*LoggerStub) LogIfError ¶
func (l *LoggerStub) LogIfError(err error, args ...interface{})
LogIfError -
type MarshalizerStub ¶
type MarshalizerStub struct { MarshalCalled func(obj interface{}) ([]byte, error) UnmarshalCalled func(obj interface{}, buff []byte) error }
MarshalizerStub -
func (*MarshalizerStub) IsInterfaceNil ¶
func (ms *MarshalizerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*MarshalizerStub) Marshal ¶
func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error)
Marshal -
func (*MarshalizerStub) Unmarshal ¶
func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error
Unmarshal -
type QueryHandlerStub ¶ added in v1.0.110
QueryHandlerStub -
func (*QueryHandlerStub) IsInterfaceNil ¶ added in v1.0.110
func (qhs *QueryHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*QueryHandlerStub) Query ¶ added in v1.0.110
func (qhs *QueryHandlerStub) Query(search string) []string
Query -
type WrongFacade ¶
type WrongFacade struct { }
WrongFacade is a struct that can be used as a wrong implementation of the node router handler
type WsConnStub ¶
type WsConnStub struct {
// contains filtered or unexported fields
}
WsConnStub -
func (*WsConnStub) ReadMessage ¶
func (wcs *WsConnStub) ReadMessage() (messageType int, p []byte, err error)
ReadMessage -
func (*WsConnStub) SetCloseHandler ¶
func (wcs *WsConnStub) SetCloseHandler(f func() error)
SetCloseHandler -
func (*WsConnStub) SetReadMessageHandler ¶
func (wcs *WsConnStub) SetReadMessageHandler(f func() (messageType int, p []byte, err error))
SetReadMessageHandler -
func (*WsConnStub) SetWriteMessageHandler ¶
func (wcs *WsConnStub) SetWriteMessageHandler(f func(messageType int, data []byte) error)
SetWriteMessageHandler -
func (*WsConnStub) WriteMessage ¶
func (wcs *WsConnStub) WriteMessage(messageType int, data []byte) error
WriteMessage -