Documentation
¶
Index ¶
- type AccountsStub
- func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)
- func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) Commit() ([]byte, error)
- func (as *AccountsStub) GetAllLeaves(rootHash []byte) (map[string][]byte, error)
- func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (state.AccountHandler, error)
- func (as *AccountsStub) GetNumCheckpoints() uint32
- func (as *AccountsStub) IsInterfaceNil() bool
- func (as *AccountsStub) IsPruningEnabled() bool
- func (as *AccountsStub) JournalLen() int
- func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
- func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) RecreateAllTries(rootHash []byte) (map[string]data.Trie, error)
- func (as *AccountsStub) RecreateTrie(rootHash []byte) error
- func (as *AccountsStub) RemoveAccount(addressContainer []byte) error
- func (as *AccountsStub) RevertToSnapshot(snapshot int) error
- func (as *AccountsStub) RootHash() ([]byte, error)
- func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
- func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)
- func (as *AccountsStub) SnapshotState(rootHash []byte)
- type ApiResolverStub
- func (ars *ApiResolverStub) ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error)
- func (ars *ApiResolverStub) ExecuteSCQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)
- func (ars *ApiResolverStub) IsInterfaceNil() bool
- func (ars *ApiResolverStub) StatusMetrics() external.StatusMetricsHandler
- type NodeStub
- func (ns *NodeStub) CreateTransaction(nonce uint64, value string, receiverHex string, senderHex string, ...) (*transaction.Transaction, []byte, error)
- func (ns *NodeStub) DecodeAddressPubkey(pk string) ([]byte, error)
- func (ns *NodeStub) DirectTrigger(epoch uint32) error
- func (ns *NodeStub) EncodeAddressPubkey(pk []byte) (string, error)
- func (ns *NodeStub) GetAccount(address string) (state.UserAccountHandler, error)
- func (ns *NodeStub) GetBalance(address string) (*big.Int, error)
- func (ns *NodeStub) GetBlockByHash(hash string, withTxs bool) (*block.APIBlock, error)
- func (ns *NodeStub) GetBlockByNonce(nonce uint64, withTxs bool) (*block.APIBlock, error)
- func (ns *NodeStub) GetHeartbeats() []data.PubKeyHeartbeat
- func (ns *NodeStub) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
- func (ns *NodeStub) GetQueryHandler(name string) (debug.QueryHandler, error)
- func (ns *NodeStub) GetTransaction(hash string) (*transaction.ApiTransactionResult, error)
- func (ns *NodeStub) GetValueForKey(address string, key string) (string, error)
- func (ns *NodeStub) IsInterfaceNil() bool
- func (ns *NodeStub) IsSelfTrigger() bool
- func (ns *NodeStub) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
- func (ns *NodeStub) StartConsensus() error
- func (ns *NodeStub) ValidateTransaction(tx *transaction.Transaction) error
- func (ns *NodeStub) 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 AccountsStub ¶ added in v0.0.2
type AccountsStub struct {
AddJournalEntryCalled func(je state.JournalEntry)
GetExistingAccountCalled func(addressContainer []byte) (state.AccountHandler, error)
LoadAccountCalled func(container []byte) (state.AccountHandler, error)
SaveAccountCalled func(account state.AccountHandler) error
RemoveAccountCalled func(addressContainer []byte) error
CommitCalled func() ([]byte, error)
JournalLenCalled func() int
RevertToSnapshotCalled func(snapshot int) error
RootHashCalled func() ([]byte, error)
RecreateTrieCalled func(rootHash []byte) error
PruneTrieCalled func(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier)
SnapshotStateCalled func(rootHash []byte)
SetStateCheckpointCalled func(rootHash []byte)
IsPruningEnabledCalled func() bool
GetAllLeavesCalled func(rootHash []byte) (map[string][]byte, error)
RecreateAllTriesCalled func(rootHash []byte) (map[string]data.Trie, error)
GetNumCheckpointsCalled func() uint32
}
AccountsStub -
func (*AccountsStub) AddJournalEntry ¶ added in v0.0.2
func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)
AddJournalEntry -
func (*AccountsStub) CancelPrune ¶ added in v0.0.2
func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPrune -
func (*AccountsStub) Commit ¶ added in v0.0.2
func (as *AccountsStub) Commit() ([]byte, error)
Commit -
func (*AccountsStub) GetAllLeaves ¶ added in v0.0.2
func (as *AccountsStub) GetAllLeaves(rootHash []byte) (map[string][]byte, error)
GetAllLeaves -
func (*AccountsStub) GetExistingAccount ¶ added in v0.0.2
func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (state.AccountHandler, error)
GetExistingAccount -
func (*AccountsStub) GetNumCheckpoints ¶ added in v0.0.2
func (as *AccountsStub) GetNumCheckpoints() uint32
GetNumCheckpoints -
func (*AccountsStub) IsInterfaceNil ¶ added in v0.0.2
func (as *AccountsStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountsStub) IsPruningEnabled ¶ added in v0.0.2
func (as *AccountsStub) IsPruningEnabled() bool
IsPruningEnabled -
func (*AccountsStub) JournalLen ¶ added in v0.0.2
func (as *AccountsStub) JournalLen() int
JournalLen -
func (*AccountsStub) LoadAccount ¶ added in v0.0.2
func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
LoadAccount -
func (*AccountsStub) PruneTrie ¶ added in v0.0.2
func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
PruneTrie -
func (*AccountsStub) RecreateAllTries ¶ added in v0.0.2
RecreateAllTries -
func (*AccountsStub) RecreateTrie ¶ added in v0.0.2
func (as *AccountsStub) RecreateTrie(rootHash []byte) error
RecreateTrie -
func (*AccountsStub) RemoveAccount ¶ added in v0.0.2
func (as *AccountsStub) RemoveAccount(addressContainer []byte) error
RemoveAccount -
func (*AccountsStub) RevertToSnapshot ¶ added in v0.0.2
func (as *AccountsStub) RevertToSnapshot(snapshot int) error
RevertToSnapshot -
func (*AccountsStub) RootHash ¶ added in v0.0.2
func (as *AccountsStub) RootHash() ([]byte, error)
RootHash -
func (*AccountsStub) SaveAccount ¶ added in v0.0.2
func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
SaveAccount -
func (*AccountsStub) SetStateCheckpoint ¶ added in v0.0.2
func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)
SetStateCheckpoint -
func (*AccountsStub) SnapshotState ¶ added in v0.0.2
func (as *AccountsStub) SnapshotState(rootHash []byte)
SnapshotState -
type ApiResolverStub ¶
type ApiResolverStub struct {
ExecuteSCQueryHandler func(query *process.SCQuery) (*vmcommon.VMOutput, error)
StatusMetricsHandler func() external.StatusMetricsHandler
ComputeTransactionGasLimitHandler func(tx *transaction.Transaction) (uint64, error)
}
ApiResolverStub -
func (*ApiResolverStub) ComputeTransactionGasLimit ¶
func (ars *ApiResolverStub) ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error)
ComputeTransactionGasLimit -
func (*ApiResolverStub) ExecuteSCQuery ¶
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
StatusMetrics -
type NodeStub ¶
type NodeStub struct {
AddressHandler func() (string, error)
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 []byte, signatureHex string, chainID string, version uint32) (*transaction.Transaction, []byte, error)
ValidateTransactionHandler func(tx *transaction.Transaction) error
GetTransactionHandler func(hash string) (*transaction.ApiTransactionResult, error)
SendBulkTransactionsHandler func(txs []*transaction.Transaction) (uint64, error)
GetAccountHandler func(address string) (state.UserAccountHandler, 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() []data.PubKeyHeartbeat
ValidatorStatisticsApiCalled func() (map[string]*state.ValidatorApiResponse, error)
DirectTriggerCalled func(epoch uint32) error
IsSelfTriggerCalled func() bool
GetQueryHandlerCalled func(name string) (debug.QueryHandler, error)
GetValueForKeyCalled func(address string, key string) (string, error)
GetPeerInfoCalled func(pid string) ([]core.QueryP2PPeerInfo, error)
GetBlockByHashCalled func(hash string, withTxs bool) (*block.APIBlock, error)
GetBlockByNonceCalled func(nonce uint64, withTxs bool) (*block.APIBlock, error)
}
NodeStub -
func (*NodeStub) CreateTransaction ¶
func (ns *NodeStub) CreateTransaction(nonce uint64, value string, receiverHex string, senderHex string, gasPrice uint64, gasLimit uint64, data []byte, signatureHex string, chainID string, version uint32) (*transaction.Transaction, []byte, error)
CreateTransaction -
func (*NodeStub) DecodeAddressPubkey ¶
DecodeAddressPubkey -
func (*NodeStub) DirectTrigger ¶
DirectTrigger -
func (*NodeStub) EncodeAddressPubkey ¶
EncodeAddressPubkey -
func (*NodeStub) GetAccount ¶
func (ns *NodeStub) GetAccount(address string) (state.UserAccountHandler, error)
GetAccount -
func (*NodeStub) GetBalance ¶
GetBalance -
func (*NodeStub) GetBlockByHash ¶ added in v0.0.2
GetBlockByHash -
func (*NodeStub) GetBlockByNonce ¶ added in v0.0.2
GetBlockByNonce -
func (*NodeStub) GetHeartbeats ¶
func (ns *NodeStub) GetHeartbeats() []data.PubKeyHeartbeat
GetHeartbeats -
func (*NodeStub) GetPeerInfo ¶
func (ns *NodeStub) GetPeerInfo(pid string) ([]core.QueryP2PPeerInfo, error)
GetPeerInfo -
func (*NodeStub) GetQueryHandler ¶
func (ns *NodeStub) GetQueryHandler(name string) (debug.QueryHandler, error)
GetQueryHandler -
func (*NodeStub) GetTransaction ¶
func (ns *NodeStub) GetTransaction(hash string) (*transaction.ApiTransactionResult, error)
GetTransaction -
func (*NodeStub) GetValueForKey ¶
GetValueForKey -
func (*NodeStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*NodeStub) SendBulkTransactions ¶
func (ns *NodeStub) SendBulkTransactions(txs []*transaction.Transaction) (uint64, error)
SendBulkTransactions -
func (*NodeStub) ValidateTransaction ¶
func (ns *NodeStub) ValidateTransaction(tx *transaction.Transaction) error
ValidateTransaction --
func (*NodeStub) ValidatorStatisticsApi ¶
func (ns *NodeStub) ValidatorStatisticsApi() (map[string]*state.ValidatorApiResponse, error)
ValidatorStatisticsApi -
type SyncTimerMock ¶
type SyncTimerMock struct {
StartSyncingTimeCalled func()
ClockOffsetCalled func() time.Duration
FormattedCurrentTimeCalled func() string
CurrentTimeCalled func() time.Time
}
SyncTimerMock is a mock implementation of SyncTimer interface
func (*SyncTimerMock) ClockOffset ¶
func (stm *SyncTimerMock) ClockOffset() time.Duration
ClockOffset is a mock implementation for ClockOffset
func (*SyncTimerMock) CurrentTime ¶
func (stm *SyncTimerMock) CurrentTime() time.Time
CurrentTime is a mock implementation for CurrentTime
func (*SyncTimerMock) FormattedCurrentTime ¶
func (stm *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) StartSyncingTime ¶
func (stm *SyncTimerMock) StartSyncingTime()
StartSyncingTime is a mock implementation for StartSyncingTime