Documentation ¶
Index ¶
- type FacadeStub
- func (f *FacadeStub) Close() error
- func (f *FacadeStub) ComputeTransactionGasLimit(tx *transaction.Transaction) (*transaction.CostResponse, error)
- func (f *FacadeStub) CreateTransaction(nonce uint64, value string, receiver string, receiverUsername []byte, ...) (*transaction.Transaction, []byte, error)
- func (f *FacadeStub) DecodeAddressPubkey(pk string) ([]byte, error)
- func (f *FacadeStub) EncodeAddressPubkey(pk []byte) (string, error)
- func (f *FacadeStub) ExecuteSCQuery(query *process.SCQuery) (*vm.VMOutputApi, error)
- func (f *FacadeStub) GetAccount(address string) (api.AccountResponse, error)
- func (f *FacadeStub) GetAllESDTTokens(address string) (map[string]*esdt.ESDigitalToken, error)
- func (f *FacadeStub) GetAllIssuedESDTs(tokenType string) ([]string, error)
- func (f *FacadeStub) GetBalance(address string) (*big.Int, error)
- func (f *FacadeStub) GetBlockByHash(hash string, withTxs bool) (*api.Block, error)
- func (f *FacadeStub) GetBlockByNonce(nonce uint64, withTxs bool) (*api.Block, error)
- func (f *FacadeStub) GetBlockByRound(round uint64, withTxs bool) (*api.Block, error)
- func (f *FacadeStub) GetDelegatorsList() ([]*api.Delegator, error)
- func (f *FacadeStub) GetDirectStakedList() ([]*api.DirectStakedValue, error)
- func (f *FacadeStub) GetESDTData(address string, key string, nonce uint64) (*esdt.ESDigitalToken, error)
- func (f *FacadeStub) GetESDTsRoles(address string) (map[string][]string, error)
- func (f *FacadeStub) GetESDTsWithRole(address string, role string) ([]string, error)
- func (f *FacadeStub) GetHeartbeats() ([]data.PubKeyHeartbeat, error)
- func (f *FacadeStub) GetKeyValuePairs(address string) (map[string]string, error)
- func (f *FacadeStub) GetNFTTokenIDsRegisteredByAddress(address string) ([]string, error)
- func (f *FacadeStub) GetNumCheckpointsFromAccountState() uint32
- func (f *FacadeStub) GetNumCheckpointsFromPeerState() uint32
- func (f *FacadeStub) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
- func (f *FacadeStub) GetProof(rootHash string, address string) (*common.GetProofResponse, error)
- func (f *FacadeStub) GetProofCurrentRootHash(address string) (*common.GetProofResponse, error)
- func (f *FacadeStub) GetProofDataTrie(rootHash string, address string, key string) (*common.GetProofResponse, *common.GetProofResponse, error)
- func (f *FacadeStub) GetQueryHandler(name string) (debug.QueryHandler, error)
- func (f *FacadeStub) GetThrottlerForEndpoint(endpoint string) (core.Throttler, bool)
- func (f *FacadeStub) GetTokenSupply(token string) (string, error)
- func (f *FacadeStub) GetTotalStakedValue() (*api.StakeValues, error)
- func (f *FacadeStub) GetTransaction(hash string, withResults bool) (*transaction.ApiTransactionResult, error)
- func (f *FacadeStub) GetUsername(address string) (string, error)
- func (f *FacadeStub) GetValueForKey(address string, key string) (string, error)
- func (f *FacadeStub) IsInterfaceNil() bool
- func (f *FacadeStub) IsSelfTrigger() bool
- func (f *FacadeStub) NodeConfig() map[string]interface{}
- func (f *FacadeStub) PprofEnabled() bool
- func (f *FacadeStub) RestAPIServerDebugMode() bool
- func (f *FacadeStub) RestApiInterface() string
- func (f *FacadeStub) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
- func (f *FacadeStub) SimulateTransactionExecution(tx *transaction.Transaction) (*txSimData.SimulationResults, error)
- func (f *FacadeStub) StatusMetrics() external.StatusMetricsHandler
- func (f *FacadeStub) Trigger(_ uint32, _ bool) error
- func (f *FacadeStub) ValidateTransaction(tx *transaction.Transaction) error
- func (f *FacadeStub) ValidateTransactionForSimulation(tx *transaction.Transaction, bypassSignature bool) error
- func (f *FacadeStub) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
- func (f *FacadeStub) VerifyProof(rootHash string, address string, proof [][]byte) (bool, 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 ThrottlerStub
- 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 FacadeStub ¶ added in v1.2.23
type FacadeStub struct { ShouldErrorStart bool ShouldErrorStop bool GetHeartbeatsHandler func() ([]data.PubKeyHeartbeat, error) BalanceHandler func(string) (*big.Int, error) GetAccountHandler func(address string) (api.AccountResponse, error) GenerateTransactionHandler func(sender string, receiver string, value *big.Int, code string) (*transaction.Transaction, error) GetTransactionHandler func(hash string, withResults bool) (*transaction.ApiTransactionResult, error) CreateTransactionHandler func(nonce uint64, value string, receiver string, receiverUsername []byte, sender string, senderUsername []byte, gasPrice uint64, gasLimit uint64, data []byte, signatureHex string, chainID string, version uint32, options uint32) (*transaction.Transaction, []byte, error) ValidateTransactionHandler func(tx *transaction.Transaction) error ValidateTransactionForSimulationHandler func(tx *transaction.Transaction, bypassSignature bool) error SendBulkTransactionsHandler func(txs []*transaction.Transaction) (uint64, error) ExecuteSCQueryHandler func(query *process.SCQuery) (*vm.VMOutputApi, error) StatusMetricsHandler func() external.StatusMetricsHandler ValidatorStatisticsHandler func() (map[string]*state.ValidatorApiResponse, error) ComputeTransactionGasLimitHandler func(tx *transaction.Transaction) (*transaction.CostResponse, error) NodeConfigCalled func() map[string]interface{} GetQueryHandlerCalled func(name string) (debug.QueryHandler, error) GetValueForKeyCalled func(address string, key string) (string, error) GetPeerInfoCalled func(pid string) ([]core.QueryP2PPeerInfo, error) GetThrottlerForEndpointCalled func(endpoint string) (core.Throttler, bool) GetUsernameCalled func(address string) (string, error) GetKeyValuePairsCalled func(address string) (map[string]string, error) SimulateTransactionExecutionHandler func(tx *transaction.Transaction) (*txSimData.SimulationResults, error) GetNumCheckpointsFromAccountStateCalled func() uint32 GetNumCheckpointsFromPeerStateCalled func() uint32 GetESDTDataCalled func(address string, key string, nonce uint64) (*esdt.ESDigitalToken, error) GetAllESDTTokensCalled func(address string) (map[string]*esdt.ESDigitalToken, error) GetESDTsWithRoleCalled func(address string, role string) ([]string, error) GetESDTsRolesCalled func(address string) (map[string][]string, error) GetNFTTokenIDsRegisteredByAddressCalled func(address string) ([]string, error) GetBlockByHashCalled func(hash string, withTxs bool) (*api.Block, error) GetBlockByNonceCalled func(nonce uint64, withTxs bool) (*api.Block, error) GetBlockByRoundCalled func(round uint64, withTxs bool) (*api.Block, error) GetTotalStakedValueHandler func() (*api.StakeValues, error) GetAllIssuedESDTsCalled func(tokenType string) ([]string, error) GetDirectStakedListHandler func() ([]*api.DirectStakedValue, error) GetDelegatorsListHandler func() ([]*api.Delegator, error) GetProofCalled func(string, string) (*common.GetProofResponse, error) GetProofCurrentRootHashCalled func(string) (*common.GetProofResponse, error) GetProofDataTrieCalled func(string, string, string) (*common.GetProofResponse, *common.GetProofResponse, error) VerifyProofCalled func(string, string, [][]byte) (bool, error) GetTokenSupplyCalled func(token string) (string, error) }
FacadeStub is the mock implementation of a node router handler
func (*FacadeStub) ComputeTransactionGasLimit ¶ added in v1.2.23
func (f *FacadeStub) ComputeTransactionGasLimit(tx *transaction.Transaction) (*transaction.CostResponse, error)
ComputeTransactionGasLimit -
func (*FacadeStub) CreateTransaction ¶ added in v1.2.23
func (f *FacadeStub) CreateTransaction( nonce uint64, value string, receiver string, receiverUsername []byte, sender string, senderUsername []byte, gasPrice uint64, gasLimit uint64, data []byte, signatureHex string, chainID string, version uint32, options uint32, ) (*transaction.Transaction, []byte, error)
CreateTransaction is mock implementation of a handler's CreateTransaction method
func (*FacadeStub) DecodeAddressPubkey ¶ added in v1.2.23
func (f *FacadeStub) DecodeAddressPubkey(pk string) ([]byte, error)
DecodeAddressPubkey -
func (*FacadeStub) EncodeAddressPubkey ¶ added in v1.2.23
func (f *FacadeStub) EncodeAddressPubkey(pk []byte) (string, error)
EncodeAddressPubkey -
func (*FacadeStub) ExecuteSCQuery ¶ added in v1.2.23
func (f *FacadeStub) ExecuteSCQuery(query *process.SCQuery) (*vm.VMOutputApi, error)
ExecuteSCQuery is a mock implementation.
func (*FacadeStub) GetAccount ¶ added in v1.2.23
func (f *FacadeStub) GetAccount(address string) (api.AccountResponse, error)
GetAccount -
func (*FacadeStub) GetAllESDTTokens ¶ added in v1.2.23
func (f *FacadeStub) GetAllESDTTokens(address string) (map[string]*esdt.ESDigitalToken, error)
GetAllESDTTokens -
func (*FacadeStub) GetAllIssuedESDTs ¶ added in v1.2.23
func (f *FacadeStub) GetAllIssuedESDTs(tokenType string) ([]string, error)
GetAllIssuedESDTs -
func (*FacadeStub) GetBalance ¶ added in v1.2.23
func (f *FacadeStub) GetBalance(address string) (*big.Int, error)
GetBalance is the mock implementation of a handler's GetBalance method
func (*FacadeStub) GetBlockByHash ¶ added in v1.2.23
GetBlockByHash -
func (*FacadeStub) GetBlockByNonce ¶ added in v1.2.23
GetBlockByNonce -
func (*FacadeStub) GetBlockByRound ¶ added in v1.2.23
GetBlockByRound -
func (*FacadeStub) GetDelegatorsList ¶ added in v1.2.23
func (f *FacadeStub) GetDelegatorsList() ([]*api.Delegator, error)
GetDelegatorsList -
func (*FacadeStub) GetDirectStakedList ¶ added in v1.2.23
func (f *FacadeStub) GetDirectStakedList() ([]*api.DirectStakedValue, error)
GetDirectStakedList -
func (*FacadeStub) GetESDTData ¶ added in v1.2.23
func (f *FacadeStub) GetESDTData(address string, key string, nonce uint64) (*esdt.ESDigitalToken, error)
GetESDTData -
func (*FacadeStub) GetESDTsRoles ¶ added in v1.2.23
func (f *FacadeStub) GetESDTsRoles(address string) (map[string][]string, error)
GetESDTsRoles -
func (*FacadeStub) GetESDTsWithRole ¶ added in v1.2.23
func (f *FacadeStub) GetESDTsWithRole(address string, role string) ([]string, error)
GetESDTsWithRole -
func (*FacadeStub) GetHeartbeats ¶ added in v1.2.23
func (f *FacadeStub) GetHeartbeats() ([]data.PubKeyHeartbeat, error)
GetHeartbeats returns the slice of heartbeat info
func (*FacadeStub) GetKeyValuePairs ¶ added in v1.2.23
func (f *FacadeStub) GetKeyValuePairs(address string) (map[string]string, error)
GetKeyValuePairs -
func (*FacadeStub) GetNFTTokenIDsRegisteredByAddress ¶ added in v1.2.23
func (f *FacadeStub) GetNFTTokenIDsRegisteredByAddress(address string) ([]string, error)
GetNFTTokenIDsRegisteredByAddress -
func (*FacadeStub) GetNumCheckpointsFromAccountState ¶ added in v1.2.23
func (f *FacadeStub) GetNumCheckpointsFromAccountState() uint32
GetNumCheckpointsFromAccountState -
func (*FacadeStub) GetNumCheckpointsFromPeerState ¶ added in v1.2.23
func (f *FacadeStub) GetNumCheckpointsFromPeerState() uint32
GetNumCheckpointsFromPeerState -
func (*FacadeStub) GetPeerInfo ¶ added in v1.2.23
func (f *FacadeStub) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
GetPeerInfo -
func (*FacadeStub) GetProof ¶ added in v1.2.23
func (f *FacadeStub) GetProof(rootHash string, address string) (*common.GetProofResponse, error)
GetProof -
func (*FacadeStub) GetProofCurrentRootHash ¶ added in v1.2.23
func (f *FacadeStub) GetProofCurrentRootHash(address string) (*common.GetProofResponse, error)
GetProofCurrentRootHash -
func (*FacadeStub) GetProofDataTrie ¶ added in v1.2.23
func (f *FacadeStub) GetProofDataTrie(rootHash string, address string, key string) (*common.GetProofResponse, *common.GetProofResponse, error)
GetProofDataTrie -
func (*FacadeStub) GetQueryHandler ¶ added in v1.2.23
func (f *FacadeStub) GetQueryHandler(name string) (debug.QueryHandler, error)
GetQueryHandler -
func (*FacadeStub) GetThrottlerForEndpoint ¶ added in v1.2.23
func (f *FacadeStub) GetThrottlerForEndpoint(endpoint string) (core.Throttler, bool)
GetThrottlerForEndpoint -
func (*FacadeStub) GetTokenSupply ¶ added in v1.2.23
func (f *FacadeStub) GetTokenSupply(token string) (string, error)
GetTokenSupply -
func (*FacadeStub) GetTotalStakedValue ¶ added in v1.2.23
func (f *FacadeStub) GetTotalStakedValue() (*api.StakeValues, error)
GetTotalStakedValue -
func (*FacadeStub) GetTransaction ¶ added in v1.2.23
func (f *FacadeStub) GetTransaction(hash string, withResults bool) (*transaction.ApiTransactionResult, error)
GetTransaction is the mock implementation of a handler's GetTransaction method
func (*FacadeStub) GetUsername ¶ added in v1.2.23
func (f *FacadeStub) GetUsername(address string) (string, error)
GetUsername -
func (*FacadeStub) GetValueForKey ¶ added in v1.2.23
func (f *FacadeStub) GetValueForKey(address string, key string) (string, error)
GetValueForKey is the mock implementation of a handler's GetValueForKey method
func (*FacadeStub) IsInterfaceNil ¶ added in v1.2.23
func (f *FacadeStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*FacadeStub) IsSelfTrigger ¶ added in v1.2.23
func (f *FacadeStub) IsSelfTrigger() bool
IsSelfTrigger -
func (*FacadeStub) NodeConfig ¶ added in v1.2.23
func (f *FacadeStub) NodeConfig() map[string]interface{}
NodeConfig -
func (*FacadeStub) PprofEnabled ¶ added in v1.2.23
func (f *FacadeStub) PprofEnabled() bool
PprofEnabled -
func (*FacadeStub) RestAPIServerDebugMode ¶ added in v1.2.23
func (f *FacadeStub) RestAPIServerDebugMode() bool
RestAPIServerDebugMode -
func (*FacadeStub) RestApiInterface ¶ added in v1.2.23
func (f *FacadeStub) RestApiInterface() string
RestApiInterface -
func (*FacadeStub) SendBulkTransactions ¶ added in v1.2.23
func (f *FacadeStub) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
SendBulkTransactions is the mock implementation of a handler's SendBulkTransactions method
func (*FacadeStub) SimulateTransactionExecution ¶ added in v1.2.23
func (f *FacadeStub) SimulateTransactionExecution(tx *transaction.Transaction) (*txSimData.SimulationResults, error)
SimulateTransactionExecution is the mock implementation of a handler's SimulateTransactionExecution method
func (*FacadeStub) StatusMetrics ¶ added in v1.2.23
func (f *FacadeStub) StatusMetrics() external.StatusMetricsHandler
StatusMetrics is the mock implementation for the StatusMetrics
func (*FacadeStub) Trigger ¶ added in v1.2.23
func (f *FacadeStub) Trigger(_ uint32, _ bool) error
Trigger -
func (*FacadeStub) ValidateTransaction ¶ added in v1.2.23
func (f *FacadeStub) ValidateTransaction(tx *transaction.Transaction) error
ValidateTransaction -
func (*FacadeStub) ValidateTransactionForSimulation ¶ added in v1.2.23
func (f *FacadeStub) ValidateTransactionForSimulation(tx *transaction.Transaction, bypassSignature bool) error
ValidateTransactionForSimulation -
func (*FacadeStub) ValidatorStatisticsApi ¶ added in v1.2.23
func (f *FacadeStub) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
ValidatorStatisticsApi is the mock implementation of a handler's ValidatorStatisticsApi method
func (*FacadeStub) VerifyProof ¶ added in v1.2.23
VerifyProof -
type HardforkFacade ¶ added in v1.0.102
type HardforkFacade struct { TriggerCalled func(epoch uint32, withEarlyEndOfEpoch bool) error IsSelfTriggerCalled func() bool }
HardforkFacade -
func (*HardforkFacade) IsInterfaceNil ¶ added in v1.0.137
func (hf *HardforkFacade) IsInterfaceNil() bool
IsInterfaceNil -
func (*HardforkFacade) IsSelfTrigger ¶ added in v1.0.102
func (hf *HardforkFacade) IsSelfTrigger() bool
IsSelfTrigger -
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 ThrottlerStub ¶ added in v1.0.137
type ThrottlerStub struct { CanProcessCalled func() bool StartProcessingCalled func() EndProcessingCalled func() StartWasCalled bool EndWasCalled bool }
ThrottlerStub -
func (*ThrottlerStub) CanProcess ¶ added in v1.0.137
func (ts *ThrottlerStub) CanProcess() bool
CanProcess -
func (*ThrottlerStub) EndProcessing ¶ added in v1.0.137
func (ts *ThrottlerStub) EndProcessing()
EndProcessing -
func (*ThrottlerStub) IsInterfaceNil ¶ added in v1.0.137
func (ts *ThrottlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ThrottlerStub) StartProcessing ¶ added in v1.0.137
func (ts *ThrottlerStub) StartProcessing()
StartProcessing -
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 -