Documentation ¶
Index ¶
- type ApiResolverStub
- type NodeMock
- func (nm *NodeMock) Address() (string, error)
- func (nm *NodeMock) ConnectToAddresses(addresses []string) 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 *big.Int, 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) IsRunning() bool
- func (nm *NodeMock) P2PBootstrap() error
- func (nm *NodeMock) SendTransaction(nonce uint64, sender string, receiver string, value *big.Int, gasPrice uint64, ...) (string, error)
- func (nm *NodeMock) Start() error
- func (nm *NodeMock) StartConsensus() error
- func (nm *NodeMock) Stop() error
- type SyncTimerMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiResolverStub ¶
type ApiResolverStub struct {
GetVmValueHandler func(address string, funcName string, argsBuff ...[]byte) ([]byte, error)
}
func (*ApiResolverStub) GetVmValue ¶ added in v1.0.11
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 *big.Int, code string) (*transaction.Transaction, error) GetTransactionHandler func(hash string) (*transaction.Transaction, error) SendTransactionHandler func(nonce uint64, sender string, receiver string, amount *big.Int, code string, signature []byte) (string, 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 }
func (*NodeMock) ConnectToAddresses ¶
func (*NodeMock) GenerateAndSendBulkTransactions ¶
func (*NodeMock) GenerateAndSendBulkTransactionsOneByOne ¶
func (*NodeMock) GenerateTransaction ¶
func (nm *NodeMock) GenerateTransaction(sender string, receiver string, amount *big.Int, 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) P2PBootstrap ¶
func (*NodeMock) SendTransaction ¶ added in v1.0.3
func (*NodeMock) StartConsensus ¶
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) StartSync ¶
func (s *SyncTimerMock) StartSync()
StartSync is a mock implementation for StartSync
Click to show internal directories.
Click to hide internal directories.