Documentation ¶
Index ¶
- Constants
- func InitVmManager(store protocol.BlockchainStore, chainConfig *chainconf.ChainConf) (protocol.VmManager, error)
- func InitWasmContract(contractName string, contractVersion string, wasmFilePath string, orgId string, ...) (*commonPb.Contract, []byte, error)
- func InvokeContractWithParameters(method string, pbContract *commonPb.Contract, wasmByteCode []byte, ...) *commonPb.ContractResult
- func PrepareMember(orgId string, certBytes []byte) (*accessPb.Member, error)
- func PrepareTx(sender *accessPb.Member, chainId string, contractName string, method string, ...) *commonPb.Transaction
- 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) 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) 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) GetLastBlock() (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetLastChainConfig() (*config.ChainConfig, error)
- func (b *BlockchainStoreMock) GetLastConfigBlock() (*commonPb.Block, error)
- func (b *BlockchainStoreMock) GetMemberExtraData(member *pbac.Member) (*pbac.MemberExtraData, error)
- 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 (s *BlockchainStoreMock) Lock()
- func (s *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 (s *BlockchainStoreMock) RLock()
- func (s *BlockchainStoreMock) RUnlock()
- func (b BlockchainStoreMock) ReadObject(contractName string, key []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 (s *BlockchainStoreMock) Unlock()
- type SnapshotMock
- func (s *SnapshotMock) ApplyTxSimContext(txSimContext protocol.TxSimContext, txType protocol.ExecOrderTxType, b bool, ...) (bool, int)
- func (s *SnapshotMock) BuildDAG(isSql bool) *common.DAG
- func (s *SnapshotMock) GetBlockHeight() uint64
- func (s *SnapshotMock) GetBlockProposer() *pbac.Member
- func (s *SnapshotMock) GetBlockTimestamp() int64
- func (s *SnapshotMock) GetBlockchainStore() protocol.BlockchainStore
- func (s *SnapshotMock) GetBlockchainStoreMock() *BlockchainStoreMock
- func (s *SnapshotMock) GetKey(_txExecSeq int, contractName string, key []byte) ([]byte, error)
- func (s *SnapshotMock) GetPreSnapshot() protocol.Snapshot
- func (s *SnapshotMock) GetSnapshotSize() int
- func (s *SnapshotMock) GetSpecialTxTable() []*common.Transaction
- func (s *SnapshotMock) GetTxRWSetTable() []*common.TxRWSet
- func (s *SnapshotMock) GetTxResultMap() map[string]*common.Result
- func (s *SnapshotMock) GetTxTable() []*common.Transaction
- func (s *SnapshotMock) IsSealed() bool
- func (s *SnapshotMock) Seal()
- func (s *SnapshotMock) SetPreSnapshot(snapshot protocol.Snapshot)
Constants ¶
View Source
const ( OrgId = "lh-org1.hercules.org" ChainId = "chain1" BlockVersion = uint32(1) )
Variables ¶
This section is empty.
Functions ¶
func InitVmManager ¶
func InitWasmContract ¶
func PutContractBytecodeIntoStore ¶
func PutContractBytecodeIntoStore(store *BlockchainStoreMock, name string, bytecode []byte)
func PutContractIdIntoStore ¶
func PutContractIdIntoStore(store *BlockchainStoreMock, name string, pbContract *commonPb.Contract) error
Types ¶
type BlockchainStoreMock ¶
type BlockchainStoreMock struct { Cache map[string][]byte // contains filtered or unexported fields }
func (BlockchainStoreMock) ArchiveBlock ¶
func (b BlockchainStoreMock) ArchiveBlock(archiveHeight uint64) error
func (*BlockchainStoreMock) BeginDbTransaction ¶
func (b *BlockchainStoreMock) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
func (*BlockchainStoreMock) BlockExists ¶
func (b *BlockchainStoreMock) BlockExists(blockHash []byte) (bool, error)
func (BlockchainStoreMock) Close ¶
func (b BlockchainStoreMock) Close() error
func (*BlockchainStoreMock) CommitDbTransaction ¶
func (b *BlockchainStoreMock) CommitDbTransaction(txName string) error
func (*BlockchainStoreMock) CreateDatabase ¶
func (b *BlockchainStoreMock) CreateDatabase(contractName string) error
func (*BlockchainStoreMock) DropDatabase ¶
func (b *BlockchainStoreMock) DropDatabase(contractName string) error
func (*BlockchainStoreMock) ExecDdlSql ¶
func (b *BlockchainStoreMock) ExecDdlSql(contractName, sql, version string) error
func (BlockchainStoreMock) GetAccountTxHistory ¶
func (b BlockchainStoreMock) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
func (BlockchainStoreMock) GetArchivedPivot ¶
func (b BlockchainStoreMock) GetArchivedPivot() uint64
func (*BlockchainStoreMock) GetBlock ¶
func (b *BlockchainStoreMock) GetBlock(height uint64) (*commonPb.Block, error)
func (*BlockchainStoreMock) GetBlockByHash ¶
func (b *BlockchainStoreMock) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
func (BlockchainStoreMock) GetBlockByTx ¶
func (b BlockchainStoreMock) GetBlockByTx(txId string) (*commonPb.Block, error)
func (*BlockchainStoreMock) GetBlockHeaderByHeight ¶
func (b *BlockchainStoreMock) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
func (BlockchainStoreMock) GetBlockWithRWSets ¶
func (b BlockchainStoreMock) GetBlockWithRWSets(height uint64) (*store.BlockWithRWSet, error)
func (*BlockchainStoreMock) GetContractByName ¶
func (b *BlockchainStoreMock) GetContractByName(name string) (*commonPb.Contract, error)
func (*BlockchainStoreMock) GetContractBytecode ¶
func (b *BlockchainStoreMock) GetContractBytecode(name string) ([]byte, error)
func (*BlockchainStoreMock) GetContractDbName ¶
func (b *BlockchainStoreMock) GetContractDbName(contractName string) string
func (BlockchainStoreMock) GetContractTxHistory ¶
func (b BlockchainStoreMock) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
func (BlockchainStoreMock) GetDBHandle ¶
func (b BlockchainStoreMock) GetDBHandle(dbName string) protocol.DBHandle
func (*BlockchainStoreMock) GetDbTransaction ¶
func (b *BlockchainStoreMock) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
func (*BlockchainStoreMock) GetHeightByHash ¶
func (b *BlockchainStoreMock) GetHeightByHash(blockHash []byte) (uint64, error)
func (BlockchainStoreMock) GetHistoryForKey ¶
func (b BlockchainStoreMock) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
func (BlockchainStoreMock) GetLastBlock ¶
func (b BlockchainStoreMock) GetLastBlock() (*commonPb.Block, error)
func (*BlockchainStoreMock) GetLastChainConfig ¶
func (b *BlockchainStoreMock) GetLastChainConfig() (*config.ChainConfig, error)
func (*BlockchainStoreMock) GetLastConfigBlock ¶
func (b *BlockchainStoreMock) GetLastConfigBlock() (*commonPb.Block, error)
func (*BlockchainStoreMock) GetMemberExtraData ¶
func (b *BlockchainStoreMock) GetMemberExtraData(member *pbac.Member) (*pbac.MemberExtraData, error)
func (BlockchainStoreMock) GetTx ¶
func (b BlockchainStoreMock) GetTx(txId string) (*commonPb.Transaction, error)
func (BlockchainStoreMock) GetTxConfirmedTime ¶
func (b BlockchainStoreMock) GetTxConfirmedTime(txId string) (int64, error)
func (BlockchainStoreMock) GetTxHeight ¶
func (b BlockchainStoreMock) GetTxHeight(txId string) (uint64, error)
func (BlockchainStoreMock) GetTxInfoOnly ¶
func (b BlockchainStoreMock) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
func (BlockchainStoreMock) GetTxInfoWithRWSet ¶
func (b BlockchainStoreMock) GetTxInfoWithRWSet(txId string) (*commonPb.TransactionInfoWithRWSet, error)
func (BlockchainStoreMock) GetTxRWSet ¶
func (b BlockchainStoreMock) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
func (BlockchainStoreMock) GetTxRWSetsByHeight ¶
func (b BlockchainStoreMock) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
func (BlockchainStoreMock) GetTxWithInfo ¶
func (b BlockchainStoreMock) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
func (BlockchainStoreMock) GetTxWithRWSet ¶
func (b BlockchainStoreMock) GetTxWithRWSet(txId string) (*commonPb.TransactionWithRWSet, error)
func (*BlockchainStoreMock) InitGenesis ¶
func (b *BlockchainStoreMock) InitGenesis(genesisBlock *store.BlockWithRWSet) error
func (*BlockchainStoreMock) Lock ¶
func (s *BlockchainStoreMock) Lock()
func (*BlockchainStoreMock) PrintDebugInfo ¶
func (s *BlockchainStoreMock) PrintDebugInfo()
func (BlockchainStoreMock) QueryMulti ¶
func (b BlockchainStoreMock) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
func (*BlockchainStoreMock) QuerySingle ¶
func (b *BlockchainStoreMock) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
func (*BlockchainStoreMock) RLock ¶
func (s *BlockchainStoreMock) RLock()
func (*BlockchainStoreMock) RUnlock ¶
func (s *BlockchainStoreMock) RUnlock()
func (BlockchainStoreMock) ReadObject ¶
func (b BlockchainStoreMock) ReadObject(contractName string, key []byte) ([]byte, error)
func (BlockchainStoreMock) RestoreBlocks ¶
func (b BlockchainStoreMock) RestoreBlocks(serializedBlocks [][]byte) error
func (*BlockchainStoreMock) RollbackDbTransaction ¶
func (b *BlockchainStoreMock) RollbackDbTransaction(txName string) error
func (BlockchainStoreMock) SelectObject ¶
func (b BlockchainStoreMock) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
func (BlockchainStoreMock) TxExists ¶
func (b BlockchainStoreMock) TxExists(txId string) (bool, error)
func (*BlockchainStoreMock) Unlock ¶
func (s *BlockchainStoreMock) Unlock()
type SnapshotMock ¶
type SnapshotMock struct {
// contains filtered or unexported fields
}
func BeforeCmdExecute ¶
func (*SnapshotMock) ApplyTxSimContext ¶
func (s *SnapshotMock) ApplyTxSimContext(txSimContext protocol.TxSimContext, txType protocol.ExecOrderTxType, b bool, txSuccess bool) (bool, int)
func (*SnapshotMock) GetBlockHeight ¶
func (s *SnapshotMock) GetBlockHeight() uint64
func (*SnapshotMock) GetBlockProposer ¶
func (s *SnapshotMock) GetBlockProposer() *pbac.Member
func (*SnapshotMock) GetBlockTimestamp ¶
func (s *SnapshotMock) GetBlockTimestamp() int64
func (*SnapshotMock) GetBlockchainStore ¶
func (s *SnapshotMock) GetBlockchainStore() protocol.BlockchainStore
func (*SnapshotMock) GetBlockchainStoreMock ¶
func (s *SnapshotMock) GetBlockchainStoreMock() *BlockchainStoreMock
func (*SnapshotMock) GetPreSnapshot ¶
func (s *SnapshotMock) GetPreSnapshot() protocol.Snapshot
func (*SnapshotMock) GetSnapshotSize ¶
func (s *SnapshotMock) GetSnapshotSize() int
func (*SnapshotMock) GetSpecialTxTable ¶
func (s *SnapshotMock) GetSpecialTxTable() []*common.Transaction
func (*SnapshotMock) GetTxRWSetTable ¶
func (s *SnapshotMock) GetTxRWSetTable() []*common.TxRWSet
func (*SnapshotMock) GetTxResultMap ¶
func (s *SnapshotMock) GetTxResultMap() map[string]*common.Result
func (*SnapshotMock) GetTxTable ¶
func (s *SnapshotMock) GetTxTable() []*common.Transaction
func (*SnapshotMock) IsSealed ¶
func (s *SnapshotMock) IsSealed() bool
func (*SnapshotMock) Seal ¶
func (s *SnapshotMock) Seal()
func (*SnapshotMock) SetPreSnapshot ¶
func (s *SnapshotMock) SetPreSnapshot(snapshot protocol.Snapshot)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.