Documentation ¶
Index ¶
- Constants
- func PutContractBytecodeIntoStore(store *BlockchainStoreMock, name string, bytecode []byte)
- func PutContractIdIntoStore(store *BlockchainStoreMock, name string, pbContract *commonPb.Contract) error
- type BlockchainStoreMock
- func (b *BlockchainStoreMock) ArchiveBlock(archiveHeight uint64) error
- func (b *BlockchainStoreMock) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (b *BlockchainStoreMock) BlockExists(blockHash []byte) (bool, error)
- func (b *BlockchainStoreMock) Close() error
- func (b *BlockchainStoreMock) CommitDbTransaction(txName string) error
- func (b *BlockchainStoreMock) CreateDatabase(contractName string) error
- func (b *BlockchainStoreMock) DoHotColdDataSeparation(startHeight uint64, endHeight uint64) (string, error)
- func (b *BlockchainStoreMock) DropDatabase(contractName string) error
- func (b *BlockchainStoreMock) ExecDdlSql(contractName, sql, version string) error
- func (b *BlockchainStoreMock) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
- func (b *BlockchainStoreMock) GetArchiveStatus() (*store.ArchiveStatus, error)
- func (b *BlockchainStoreMock) GetArchivedPivot() uint64
- func (b *BlockchainStoreMock) GetBlock(height uint64) (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetBlockByTx(txId string) (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
- func (b *BlockchainStoreMock) GetBlockWithRWSets(height uint64) (*store.BlockWithRWSet, error)
- func (b *BlockchainStoreMock) GetContractByName(name string) (*commonPb.Contract, error)
- func (b *BlockchainStoreMock) GetContractBytecode(name string) ([]byte, error)
- func (b *BlockchainStoreMock) GetContractDbName(contractName string) string
- func (b *BlockchainStoreMock) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
- func (b *BlockchainStoreMock) GetDBHandle(dbName string) protocol.DBHandle
- func (b *BlockchainStoreMock) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (b *BlockchainStoreMock) GetHeightByHash(blockHash []byte) (uint64, error)
- func (b *BlockchainStoreMock) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
- func (b *BlockchainStoreMock) GetHotColdDataSeparationJobByID(jobID string) (store.ArchiveJob, error)
- func (b *BlockchainStoreMock) GetHotColdDataSeparationMaxHeight() (uint64, error)
- func (b *BlockchainStoreMock) GetLastBlock() (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetLastChainConfig() (*config.ChainConfig, error)
- func (b *BlockchainStoreMock) GetLastConfigBlock() (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetLastHeight() (uint64, error)
- func (b *BlockchainStoreMock) GetMemberExtraData(member *pbac.Member) (*pbac.MemberExtraData, error)
- func (b *BlockchainStoreMock) GetSnapshotStatus() uint64
- func (b *BlockchainStoreMock) GetTx(txId string) (*commonPb.Transaction, error)
- func (b *BlockchainStoreMock) GetTxConfirmedTime(txId string) (int64, error)
- func (b *BlockchainStoreMock) GetTxHeight(txId string) (uint64, error)
- func (b *BlockchainStoreMock) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
- func (b *BlockchainStoreMock) GetTxInfoWithRWSet(txId string) (*commonPb.TransactionInfoWithRWSet, error)
- func (b *BlockchainStoreMock) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
- func (b *BlockchainStoreMock) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
- func (b *BlockchainStoreMock) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
- func (b *BlockchainStoreMock) GetTxWithRWSet(txId string) (*commonPb.TransactionWithRWSet, error)
- func (b *BlockchainStoreMock) InitGenesis(genesisBlock *store.BlockWithRWSet) error
- func (b *BlockchainStoreMock) MakeSnapshot(snapshotHeight uint64) error
- func (b *BlockchainStoreMock) PrintDebugInfo()
- func (b *BlockchainStoreMock) PutBlock(block *commonPb.Block, txRWSets []*commonPb.TxRWSet) error
- func (b *BlockchainStoreMock) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
- func (b *BlockchainStoreMock) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
- func (b *BlockchainStoreMock) ReadObject(contractName string, key []byte) ([]byte, error)
- func (b *BlockchainStoreMock) ReadObjects(string, [][]byte) ([][]byte, error)
- func (b *BlockchainStoreMock) RestoreBlocks(serializedBlocks [][]byte) error
- func (b *BlockchainStoreMock) RollbackDbTransaction(txName string) error
- func (b *BlockchainStoreMock) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
- func (b *BlockchainStoreMock) TxExists(txId string) (bool, error)
- func (b *BlockchainStoreMock) TxExistsInFullDB(string) (bool, uint64, error)
- func (b *BlockchainStoreMock) TxExistsInIncrementDB(txId string, startHeight uint64) (bool, error)
- func (b *BlockchainStoreMock) TxExistsInIncrementDBState(txId string, startHeight uint64) (bool, bool, error)
- type SnapshotMock
- func (s SnapshotMock) ApplyBlock(block *commonPb.Block, txRWSetMap map[string]*commonPb.TxRWSet)
- func (s SnapshotMock) ApplyTxSimContext(context protocol.TxSimContext, txType protocol.ExecOrderTxType, b bool, ...) (bool, int)
- func (s SnapshotMock) BuildDAG(isSql bool, txRWSetTable []*commonPb.TxRWSet) *commonPb.DAG
- func (s SnapshotMock) GetBlockFingerprint() string
- func (s SnapshotMock) GetBlockHeight() uint64
- func (s SnapshotMock) GetBlockProposer() *accessPb.Member
- func (s SnapshotMock) GetBlockTimestamp() int64
- func (s SnapshotMock) GetBlockchainStore() protocol.BlockchainStore
- func (s SnapshotMock) GetKey(txExecSeq int, contractName string, key []byte) ([]byte, error)
- func (s SnapshotMock) GetKeys(txExecSeq int, keys []*vmPb.BatchKey) ([]*vmPb.BatchKey, error)
- func (s SnapshotMock) GetLastChainConfig() *config.ChainConfig
- func (s SnapshotMock) GetPreSnapshot() protocol.Snapshot
- func (s SnapshotMock) GetSnapshotSize() int
- func (s SnapshotMock) GetSpecialTxTable() []*commonPb.Transaction
- func (s SnapshotMock) GetTxRWSetTable() []*commonPb.TxRWSet
- func (s SnapshotMock) GetTxResultMap() map[string]*commonPb.Result
- func (s SnapshotMock) GetTxTable() []*commonPb.Transaction
- func (s SnapshotMock) IsSealed() bool
- func (s SnapshotMock) Seal()
- func (s SnapshotMock) SetPreSnapshot(snapshot protocol.Snapshot)
- type VmManagerMock
- func (v VmManagerMock) AfterSchedule(blockFingerprint string, blockHeight uint64)
- func (v VmManagerMock) BeforeSchedule(blockFingerprint string, blockHeight uint64)
- func (v VmManagerMock) GetAccessControl() protocol.AccessControlProvider
- func (v VmManagerMock) GetChainNodesInfoProvider() protocol.ChainNodesInfoProvider
- func (v VmManagerMock) GetConsensusStateWrapper() protocol.ConsensusStateWrapper
- func (v VmManagerMock) OnMessage(message *msgbus.Message)
- func (v VmManagerMock) OnQuit()
- func (v VmManagerMock) RunContract(contract *commonPb.Contract, method string, byteCode []byte, ...) (contractResult *commonPb.ContractResult, ...)
- func (v VmManagerMock) Start() error
- func (v VmManagerMock) Stop() error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func PutContractBytecodeIntoStore ¶
func PutContractBytecodeIntoStore(store *BlockchainStoreMock, name string, bytecode []byte)
PutContractBytecodeIntoStore put contract bytecode into blockchain store
Types ¶
type BlockchainStoreMock ¶
type BlockchainStoreMock struct { sync.RWMutex Cache map[string][]byte // contains filtered or unexported fields }
BlockchainStoreMock mock a BlockchainStore interface
func NewBlockchainStore ¶
func NewBlockchainStore() *BlockchainStoreMock
NewBlockchainStore create a blockchain store object
func (*BlockchainStoreMock) ArchiveBlock ¶
func (b *BlockchainStoreMock) ArchiveBlock(archiveHeight uint64) error
ArchiveBlock implements interface
func (*BlockchainStoreMock) BeginDbTransaction ¶
func (b *BlockchainStoreMock) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
BeginDbTransaction implements interface
func (*BlockchainStoreMock) BlockExists ¶
func (b *BlockchainStoreMock) BlockExists(blockHash []byte) (bool, error)
BlockExists implements interface
func (*BlockchainStoreMock) Close ¶
func (b *BlockchainStoreMock) Close() error
Close implements interface
func (*BlockchainStoreMock) CommitDbTransaction ¶
func (b *BlockchainStoreMock) CommitDbTransaction(txName string) error
CommitDbTransaction implements interface
func (*BlockchainStoreMock) CreateDatabase ¶
func (b *BlockchainStoreMock) CreateDatabase(contractName string) error
CreateDatabase implements interface
func (*BlockchainStoreMock) DoHotColdDataSeparation ¶
func (b *BlockchainStoreMock) DoHotColdDataSeparation(startHeight uint64, endHeight uint64) (string, error)
DoHotColdDataSeparation do something unknown
func (*BlockchainStoreMock) DropDatabase ¶
func (b *BlockchainStoreMock) DropDatabase(contractName string) error
DropDatabase implements interface
func (*BlockchainStoreMock) ExecDdlSql ¶
func (b *BlockchainStoreMock) ExecDdlSql(contractName, sql, version string) error
ExecDdlSql implements interface
func (*BlockchainStoreMock) GetAccountTxHistory ¶
func (b *BlockchainStoreMock) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
GetAccountTxHistory implements interface
func (*BlockchainStoreMock) GetArchiveStatus ¶
func (b *BlockchainStoreMock) GetArchiveStatus() (*store.ArchiveStatus, error)
GetArchiveStatus mock a BlockchainStore interface
func (*BlockchainStoreMock) GetArchivedPivot ¶
func (b *BlockchainStoreMock) GetArchivedPivot() uint64
GetArchivedPivot implements interface
func (*BlockchainStoreMock) GetBlock ¶
func (b *BlockchainStoreMock) GetBlock(height uint64) (*commonPb.Block, error)
GetBlock implements interface
func (*BlockchainStoreMock) GetBlockByHash ¶
func (b *BlockchainStoreMock) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
GetBlockByHash implements interface
func (*BlockchainStoreMock) GetBlockByTx ¶
func (b *BlockchainStoreMock) GetBlockByTx(txId string) (*commonPb.Block, error)
GetBlockByTx implements interface
func (*BlockchainStoreMock) GetBlockHeaderByHeight ¶
func (b *BlockchainStoreMock) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
GetBlockHeaderByHeight implements interface
func (*BlockchainStoreMock) GetBlockWithRWSets ¶
func (b *BlockchainStoreMock) GetBlockWithRWSets(height uint64) (*store.BlockWithRWSet, error)
GetBlockWithRWSets implements interface
func (*BlockchainStoreMock) GetContractByName ¶
func (b *BlockchainStoreMock) GetContractByName(name string) (*commonPb.Contract, error)
GetContractByName implements interface
func (*BlockchainStoreMock) GetContractBytecode ¶
func (b *BlockchainStoreMock) GetContractBytecode(name string) ([]byte, error)
GetContractBytecode implements interface
func (*BlockchainStoreMock) GetContractDbName ¶
func (b *BlockchainStoreMock) GetContractDbName(contractName string) string
GetContractDbName implements interface
func (*BlockchainStoreMock) GetContractTxHistory ¶
func (b *BlockchainStoreMock) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
GetContractTxHistory implements interface
func (*BlockchainStoreMock) GetDBHandle ¶
func (b *BlockchainStoreMock) GetDBHandle(dbName string) protocol.DBHandle
GetDBHandle implements interface
func (*BlockchainStoreMock) GetDbTransaction ¶
func (b *BlockchainStoreMock) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
GetDbTransaction get db transaction
func (*BlockchainStoreMock) GetHeightByHash ¶
func (b *BlockchainStoreMock) GetHeightByHash(blockHash []byte) (uint64, error)
GetHeightByHash implements interface
func (*BlockchainStoreMock) GetHistoryForKey ¶
func (b *BlockchainStoreMock) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
GetHistoryForKey implements interface
func (*BlockchainStoreMock) GetHotColdDataSeparationJobByID ¶
func (b *BlockchainStoreMock) GetHotColdDataSeparationJobByID(jobID string) (store.ArchiveJob, error)
GetHotColdDataSeparationJobByID return something unknown
func (*BlockchainStoreMock) GetHotColdDataSeparationMaxHeight ¶
func (b *BlockchainStoreMock) GetHotColdDataSeparationMaxHeight() (uint64, error)
GetHotColdDataSeparationMaxHeight return something unknown
func (*BlockchainStoreMock) GetLastBlock ¶
func (b *BlockchainStoreMock) GetLastBlock() (*commonPb.Block, error)
GetLastBlock implements interface
func (*BlockchainStoreMock) GetLastChainConfig ¶
func (b *BlockchainStoreMock) GetLastChainConfig() (*config.ChainConfig, error)
GetLastChainConfig implements interface
func (*BlockchainStoreMock) GetLastConfigBlock ¶
func (b *BlockchainStoreMock) GetLastConfigBlock() (*commonPb.Block, error)
GetLastConfigBlock implements interface
func (*BlockchainStoreMock) GetLastHeight ¶
func (b *BlockchainStoreMock) GetLastHeight() (uint64, error)
GetLastHeight return a height of blockchain
func (*BlockchainStoreMock) GetMemberExtraData ¶
func (b *BlockchainStoreMock) GetMemberExtraData(member *pbac.Member) (*pbac.MemberExtraData, error)
GetMemberExtraData implements interface
func (*BlockchainStoreMock) GetSnapshotStatus ¶
func (b *BlockchainStoreMock) GetSnapshotStatus() uint64
GetSnapshotStatus return a status of snapshot
func (*BlockchainStoreMock) GetTx ¶
func (b *BlockchainStoreMock) GetTx(txId string) (*commonPb.Transaction, error)
GetTx implements interface
func (*BlockchainStoreMock) GetTxConfirmedTime ¶
func (b *BlockchainStoreMock) GetTxConfirmedTime(txId string) (int64, error)
GetTxConfirmedTime implements interface
func (*BlockchainStoreMock) GetTxHeight ¶
func (b *BlockchainStoreMock) GetTxHeight(txId string) (uint64, error)
GetTxHeight implements interface
func (*BlockchainStoreMock) GetTxInfoOnly ¶
func (b *BlockchainStoreMock) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
GetTxInfoOnly implements interface
func (*BlockchainStoreMock) GetTxInfoWithRWSet ¶
func (b *BlockchainStoreMock) GetTxInfoWithRWSet(txId string) (*commonPb.TransactionInfoWithRWSet, error)
GetTxInfoWithRWSet implements interface
func (*BlockchainStoreMock) GetTxRWSet ¶
func (b *BlockchainStoreMock) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
GetTxRWSet implements interface
func (*BlockchainStoreMock) GetTxRWSetsByHeight ¶
func (b *BlockchainStoreMock) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
GetTxRWSetsByHeight implements interface
func (*BlockchainStoreMock) GetTxWithInfo ¶
func (b *BlockchainStoreMock) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
GetTxWithInfo implements interface
func (*BlockchainStoreMock) GetTxWithRWSet ¶
func (b *BlockchainStoreMock) GetTxWithRWSet(txId string) (*commonPb.TransactionWithRWSet, error)
GetTxWithRWSet implements interface
func (*BlockchainStoreMock) InitGenesis ¶
func (b *BlockchainStoreMock) InitGenesis(genesisBlock *store.BlockWithRWSet) error
InitGenesis implements interface
func (*BlockchainStoreMock) MakeSnapshot ¶
func (b *BlockchainStoreMock) MakeSnapshot(snapshotHeight uint64) error
MakeSnapshot make a snapshot
func (*BlockchainStoreMock) PrintDebugInfo ¶
func (b *BlockchainStoreMock) PrintDebugInfo()
PrintDebugInfo implements interface
func (*BlockchainStoreMock) PutBlock ¶
PutBlock implements interface
func (*BlockchainStoreMock) QueryMulti ¶
func (b *BlockchainStoreMock) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
QueryMulti implements interface
func (*BlockchainStoreMock) QuerySingle ¶
func (b *BlockchainStoreMock) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
QuerySingle implements interface
func (*BlockchainStoreMock) ReadObject ¶
func (b *BlockchainStoreMock) ReadObject(contractName string, key []byte) ([]byte, error)
ReadObject implements interface
func (*BlockchainStoreMock) ReadObjects ¶
func (b *BlockchainStoreMock) ReadObjects(string, [][]byte) ([][]byte, error)
ReadObjects read objects indexed by keys
func (*BlockchainStoreMock) RestoreBlocks ¶
func (b *BlockchainStoreMock) RestoreBlocks(serializedBlocks [][]byte) error
RestoreBlocks implements interface
func (*BlockchainStoreMock) RollbackDbTransaction ¶
func (b *BlockchainStoreMock) RollbackDbTransaction(txName string) error
RollbackDbTransaction implements interface
func (*BlockchainStoreMock) SelectObject ¶
func (b *BlockchainStoreMock) SelectObject( contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
SelectObject implements interface
func (*BlockchainStoreMock) TxExists ¶
func (b *BlockchainStoreMock) TxExists(txId string) (bool, error)
TxExists implements interface
func (*BlockchainStoreMock) TxExistsInFullDB ¶
func (b *BlockchainStoreMock) TxExistsInFullDB(string) (bool, uint64, error)
TxExistsInFullDB implements interface
type SnapshotMock ¶
type SnapshotMock struct { Store *BlockchainStoreMock LastChainConfig *config.ChainConfig // contains filtered or unexported fields }
SnapshotMock mock a Snapshot interface
func (SnapshotMock) ApplyBlock ¶
ApplyBlock implements interface
func (SnapshotMock) ApplyTxSimContext ¶
func (s SnapshotMock) ApplyTxSimContext( context protocol.TxSimContext, txType protocol.ExecOrderTxType, b bool, b2 bool) (bool, int)
ApplyTxSimContext implements interface
func (SnapshotMock) BuildDAG ¶
BuildDAG implements interface
func (SnapshotMock) GetBlockFingerprint ¶
func (s SnapshotMock) GetBlockFingerprint() string
GetBlockFingerprint implements interface
func (SnapshotMock) GetBlockHeight ¶
func (s SnapshotMock) GetBlockHeight() uint64
GetBlockHeight implements interface
func (SnapshotMock) GetBlockProposer ¶
func (s SnapshotMock) GetBlockProposer() *accessPb.Member
GetBlockProposer implements interface
func (SnapshotMock) GetBlockTimestamp ¶
func (s SnapshotMock) GetBlockTimestamp() int64
GetBlockTimestamp implements interface
func (SnapshotMock) GetBlockchainStore ¶
func (s SnapshotMock) GetBlockchainStore() protocol.BlockchainStore
GetBlockchainStore implements interface
func (SnapshotMock) GetKey ¶
GetKey implements interface
func (SnapshotMock) GetKeys ¶
GetKeys implements interface
func (SnapshotMock) GetLastChainConfig ¶
func (s SnapshotMock) GetLastChainConfig() *config.ChainConfig
GetLastChainConfig implements interface
func (SnapshotMock) GetPreSnapshot ¶
func (s SnapshotMock) GetPreSnapshot() protocol.Snapshot
GetPreSnapshot implements interface
func (SnapshotMock) GetSnapshotSize ¶
func (s SnapshotMock) GetSnapshotSize() int
GetSnapshotSize implements interface
func (SnapshotMock) GetSpecialTxTable ¶
func (s SnapshotMock) GetSpecialTxTable() []*commonPb.Transaction
GetSpecialTxTable implements interface
func (SnapshotMock) GetTxRWSetTable ¶
func (s SnapshotMock) GetTxRWSetTable() []*commonPb.TxRWSet
GetTxRWSetTable implements interface
func (SnapshotMock) GetTxResultMap ¶
func (s SnapshotMock) GetTxResultMap() map[string]*commonPb.Result
GetTxResultMap implements interface
func (SnapshotMock) GetTxTable ¶
func (s SnapshotMock) GetTxTable() []*commonPb.Transaction
GetTxTable implements interface
func (SnapshotMock) SetPreSnapshot ¶
func (s SnapshotMock) SetPreSnapshot(snapshot protocol.Snapshot)
SetPreSnapshot implements interface
type VmManagerMock ¶
type VmManagerMock struct { ChainId string InstanceManagers map[commonPb.RuntimeType]protocol.VmInstancesManager Logger protocol.Logger Ac protocol.AccessControlProvider }
VmManagerMock mock a VmManager interface
func (VmManagerMock) AfterSchedule ¶
func (v VmManagerMock) AfterSchedule(blockFingerprint string, blockHeight uint64)
AfterSchedule implements interface
func (VmManagerMock) BeforeSchedule ¶
func (v VmManagerMock) BeforeSchedule(blockFingerprint string, blockHeight uint64)
BeforeSchedule implements interface
func (VmManagerMock) GetAccessControl ¶
func (v VmManagerMock) GetAccessControl() protocol.AccessControlProvider
GetAccessControl implements interface
func (VmManagerMock) GetChainNodesInfoProvider ¶
func (v VmManagerMock) GetChainNodesInfoProvider() protocol.ChainNodesInfoProvider
GetChainNodesInfoProvider implements interface
func (VmManagerMock) GetConsensusStateWrapper ¶
func (v VmManagerMock) GetConsensusStateWrapper() protocol.ConsensusStateWrapper
GetConsensusStateWrapper return consensus state wrapper
func (VmManagerMock) OnMessage ¶
func (v VmManagerMock) OnMessage(message *msgbus.Message)
OnMessage on message
func (VmManagerMock) RunContract ¶
func (v VmManagerMock) RunContract( contract *commonPb.Contract, method string, byteCode []byte, parameters map[string][]byte, txContext protocol.TxSimContext, gasUsed uint64, refTxType commonPb.TxType) ( contractResult *commonPb.ContractResult, specialTxType protocol.ExecOrderTxType, code commonPb.TxStatusCode)
RunContract implements interface