Documentation ¶
Index ¶
- type ApiResolverStub
- type NodeMock
- func (nm *NodeMock) Address() (string, error)
- func (nm *NodeMock) ConnectToAddresses(addresses []string) error
- func (nm *NodeMock) CreateTransaction(nonce uint64, value string, receiverHex string, senderHex string, ...) (*transaction.Transaction, error)
- func (nm *NodeMock) GenerateAndSendBulkTransactions(receiverHex string, value *big.Int, noOfTx uint64) error
- func (nm *NodeMock) GenerateAndSendBulkTransactionsOneByOne(receiverHex string, value *big.Int, noOfTx uint64) error
- func (nm *NodeMock) GenerateTransaction(sender string, receiver string, amount string, code string) (*transaction.Transaction, error)
- func (nm *NodeMock) GetAccount(address string) (*state.Account, error)
- func (nm *NodeMock) GetBalance(address string) (*big.Int, error)
- func (nm *NodeMock) GetCurrentPublicKey() string
- func (nm *NodeMock) GetHeartbeats() []heartbeat.PubKeyHeartbeat
- func (nm *NodeMock) GetTransaction(hash string) (*transaction.Transaction, error)
- func (nm *NodeMock) IsInterfaceNil() bool
- func (nm *NodeMock) IsRunning() bool
- func (nm *NodeMock) P2PBootstrap() error
- func (nm *NodeMock) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
- func (nm *NodeMock) SendTransaction(nonce uint64, sender string, receiver string, value string, gasPrice uint64, ...) (string, error)
- func (nm *NodeMock) Start() error
- func (nm *NodeMock) StartConsensus() error
- func (nm *NodeMock) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
- type SyncTimerMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiResolverStub ¶
type ApiResolverStub struct { ExecuteSCQueryHandler func(query *process.SCQuery) (*vmcommon.VMOutput, error) StatusMetricsHandler func() external.StatusMetricsHandler }
func (*ApiResolverStub) ExecuteSCQuery ¶
func (*ApiResolverStub) IsInterfaceNil ¶
func (ars *ApiResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ApiResolverStub) StatusMetrics ¶
func (ars *ApiResolverStub) StatusMetrics() external.StatusMetricsHandler
type NodeMock ¶
type NodeMock struct { AddressHandler func() (string, error) StartHandler func() error StopHandler func() error P2PBootstrapHandler func() error IsRunningHandler func() bool ConnectToAddressesHandler func([]string) error StartConsensusHandler func() error GetBalanceHandler func(address string) (*big.Int, error) GenerateTransactionHandler func(sender string, receiver string, amount string, code string) (*transaction.Transaction, error) CreateTransactionHandler func(nonce uint64, value string, receiverHex string, senderHex string, gasPrice uint64, gasLimit uint64, data string, signatureHex string) (*transaction.Transaction, error) GetTransactionHandler func(hash string) (*transaction.Transaction, error) SendTransactionHandler func(nonce uint64, sender string, receiver string, amount string, code string, signature []byte) (string, error) SendBulkTransactionsHandler func(txs []*transaction.Transaction) (uint64, error) GetAccountHandler func(address string) (*state.Account, error) GetCurrentPublicKeyHandler func() string GenerateAndSendBulkTransactionsHandler func(destination string, value *big.Int, nrTransactions uint64) error GenerateAndSendBulkTransactionsOneByOneHandler func(destination string, value *big.Int, nrTransactions uint64) error GetHeartbeatsHandler func() []heartbeat.PubKeyHeartbeat ValidatorStatisticsApiCalled func() (map[string]*state.ValidatorApiResponse, error) }
func (*NodeMock) ConnectToAddresses ¶
func (*NodeMock) CreateTransaction ¶
func (*NodeMock) GenerateAndSendBulkTransactions ¶
func (*NodeMock) GenerateAndSendBulkTransactionsOneByOne ¶
func (*NodeMock) GenerateTransaction ¶
func (nm *NodeMock) GenerateTransaction(sender string, receiver string, amount string, code string) (*transaction.Transaction, error)
func (*NodeMock) GetAccount ¶
func (*NodeMock) GetCurrentPublicKey ¶
func (*NodeMock) GetHeartbeats ¶
func (nm *NodeMock) GetHeartbeats() []heartbeat.PubKeyHeartbeat
func (*NodeMock) GetTransaction ¶
func (nm *NodeMock) GetTransaction(hash string) (*transaction.Transaction, error)
func (*NodeMock) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*NodeMock) P2PBootstrap ¶
func (*NodeMock) SendBulkTransactions ¶
func (nm *NodeMock) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
func (*NodeMock) SendTransaction ¶ added in v1.0.3
func (*NodeMock) StartConsensus ¶
func (*NodeMock) ValidatorStatisticsApi ¶
func (nm *NodeMock) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
type SyncTimerMock ¶
type SyncTimerMock struct { StartSyncCalled func() ClockOffsetCalled func() time.Duration FormattedCurrentTimeCalled func() string CurrentTimeCalled func() time.Time }
SyncTimerMock is a mock implementation of SyncTimer interface
func (*SyncTimerMock) ClockOffset ¶
func (s *SyncTimerMock) ClockOffset() time.Duration
ClockOffset is a mock implementation for ClockOffset
func (*SyncTimerMock) CurrentTime ¶
func (s *SyncTimerMock) CurrentTime() time.Time
CurrentTime is a mock implementation for CurrentTime
func (*SyncTimerMock) FormattedCurrentTime ¶
func (s *SyncTimerMock) FormattedCurrentTime() string
FormattedCurrentTime is a mock implementation for FormattedCurrentTime
func (*SyncTimerMock) IsInterfaceNil ¶
func (stm *SyncTimerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SyncTimerMock) StartSync ¶
func (s *SyncTimerMock) StartSync()
StartSync is a mock implementation for StartSync
Click to show internal directories.
Click to hide internal directories.