Documentation ¶
Overview ¶
Package statedb is a generated GoMock package.
Index ¶
- type MockStateDB
- func (m *MockStateDB) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (m *MockStateDB) Close()
- func (m *MockStateDB) CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error
- func (m *MockStateDB) CommitDbTransaction(txName string) error
- func (m *MockStateDB) CreateDatabase(contractName string) error
- func (m *MockStateDB) DropDatabase(contractName string) error
- func (m *MockStateDB) EXPECT() *MockStateDBMockRecorder
- func (m *MockStateDB) ExecDdlSql(contractName, sql, version string) error
- func (m *MockStateDB) GetChainConfig() (*config.ChainConfig, error)
- func (m *MockStateDB) GetContractDbName(contractName string) string
- func (m *MockStateDB) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (m *MockStateDB) GetLastSavepoint() (uint64, error)
- func (m *MockStateDB) GetMemberExtraData(member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error)
- func (m *MockStateDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
- func (m *MockStateDB) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
- func (m *MockStateDB) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
- func (m *MockStateDB) ReadObject(contractName string, key []byte) ([]byte, error)
- func (m *MockStateDB) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)
- func (m *MockStateDB) RollbackDbTransaction(txName string) error
- func (m *MockStateDB) SelectObject(contractName string, startKey, limit []byte) (protocol.StateIterator, error)
- type MockStateDBMockRecorder
- func (mr *MockStateDBMockRecorder) BeginDbTransaction(txName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) Close() *gomock.Call
- func (mr *MockStateDBMockRecorder) CommitBlock(blockWithRWSet, isCache interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) CommitDbTransaction(txName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) CreateDatabase(contractName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) DropDatabase(contractName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) ExecDdlSql(contractName, sql, version interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) GetChainConfig() *gomock.Call
- func (mr *MockStateDBMockRecorder) GetContractDbName(contractName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) GetDbTransaction(txName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) GetLastSavepoint() *gomock.Call
- func (mr *MockStateDBMockRecorder) GetMemberExtraData(member interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) InitGenesis(genesisBlock interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) QueryMulti(contractName, sql interface{}, values ...interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) QuerySingle(contractName, sql interface{}, values ...interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) ReadObject(contractName, key interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) ReadObjects(contractName, keys interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) RollbackDbTransaction(txName interface{}) *gomock.Call
- func (mr *MockStateDBMockRecorder) SelectObject(contractName, startKey, limit interface{}) *gomock.Call
- type StateDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockStateDB ¶ added in v2.3.0
type MockStateDB struct {
// contains filtered or unexported fields
}
MockStateDB is a mock of StateDB interface.
func NewMockStateDB ¶ added in v2.3.0
func NewMockStateDB(ctrl *gomock.Controller) *MockStateDB
NewMockStateDB creates a new mock instance.
func (*MockStateDB) BeginDbTransaction ¶ added in v2.3.0
func (m *MockStateDB) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
BeginDbTransaction mocks base method.
func (*MockStateDB) CommitBlock ¶ added in v2.3.0
func (m *MockStateDB) CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error
CommitBlock mocks base method.
func (*MockStateDB) CommitDbTransaction ¶ added in v2.3.0
func (m *MockStateDB) CommitDbTransaction(txName string) error
CommitDbTransaction mocks base method.
func (*MockStateDB) CreateDatabase ¶ added in v2.3.0
func (m *MockStateDB) CreateDatabase(contractName string) error
CreateDatabase mocks base method.
func (*MockStateDB) DropDatabase ¶ added in v2.3.0
func (m *MockStateDB) DropDatabase(contractName string) error
DropDatabase mocks base method.
func (*MockStateDB) EXPECT ¶ added in v2.3.0
func (m *MockStateDB) EXPECT() *MockStateDBMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStateDB) ExecDdlSql ¶ added in v2.3.0
func (m *MockStateDB) ExecDdlSql(contractName, sql, version string) error
ExecDdlSql mocks base method.
func (*MockStateDB) GetChainConfig ¶ added in v2.3.0
func (m *MockStateDB) GetChainConfig() (*config.ChainConfig, error)
GetChainConfig mocks base method.
func (*MockStateDB) GetContractDbName ¶ added in v2.3.0
func (m *MockStateDB) GetContractDbName(contractName string) string
GetContractDbName mocks base method.
func (*MockStateDB) GetDbTransaction ¶ added in v2.3.0
func (m *MockStateDB) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
GetDbTransaction mocks base method.
func (*MockStateDB) GetLastSavepoint ¶ added in v2.3.0
func (m *MockStateDB) GetLastSavepoint() (uint64, error)
GetLastSavepoint mocks base method.
func (*MockStateDB) GetMemberExtraData ¶ added in v2.3.0
func (m *MockStateDB) GetMemberExtraData(member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error)
GetMemberExtraData mocks base method.
func (*MockStateDB) InitGenesis ¶ added in v2.3.0
func (m *MockStateDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
InitGenesis mocks base method.
func (*MockStateDB) QueryMulti ¶ added in v2.3.0
func (m *MockStateDB) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
QueryMulti mocks base method.
func (*MockStateDB) QuerySingle ¶ added in v2.3.0
func (m *MockStateDB) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
QuerySingle mocks base method.
func (*MockStateDB) ReadObject ¶ added in v2.3.0
func (m *MockStateDB) ReadObject(contractName string, key []byte) ([]byte, error)
ReadObject mocks base method.
func (*MockStateDB) ReadObjects ¶ added in v2.3.0
func (m *MockStateDB) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)
ReadObjects mocks base method.
func (*MockStateDB) RollbackDbTransaction ¶ added in v2.3.0
func (m *MockStateDB) RollbackDbTransaction(txName string) error
RollbackDbTransaction mocks base method.
func (*MockStateDB) SelectObject ¶ added in v2.3.0
func (m *MockStateDB) SelectObject(contractName string, startKey, limit []byte) (protocol.StateIterator, error)
SelectObject mocks base method.
type MockStateDBMockRecorder ¶ added in v2.3.0
type MockStateDBMockRecorder struct {
// contains filtered or unexported fields
}
MockStateDBMockRecorder is the mock recorder for MockStateDB.
func (*MockStateDBMockRecorder) BeginDbTransaction ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) BeginDbTransaction(txName interface{}) *gomock.Call
BeginDbTransaction indicates an expected call of BeginDbTransaction.
func (*MockStateDBMockRecorder) Close ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockStateDBMockRecorder) CommitBlock ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) CommitBlock(blockWithRWSet, isCache interface{}) *gomock.Call
CommitBlock indicates an expected call of CommitBlock.
func (*MockStateDBMockRecorder) CommitDbTransaction ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) CommitDbTransaction(txName interface{}) *gomock.Call
CommitDbTransaction indicates an expected call of CommitDbTransaction.
func (*MockStateDBMockRecorder) CreateDatabase ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) CreateDatabase(contractName interface{}) *gomock.Call
CreateDatabase indicates an expected call of CreateDatabase.
func (*MockStateDBMockRecorder) DropDatabase ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) DropDatabase(contractName interface{}) *gomock.Call
DropDatabase indicates an expected call of DropDatabase.
func (*MockStateDBMockRecorder) ExecDdlSql ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) ExecDdlSql(contractName, sql, version interface{}) *gomock.Call
ExecDdlSql indicates an expected call of ExecDdlSql.
func (*MockStateDBMockRecorder) GetChainConfig ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) GetChainConfig() *gomock.Call
GetChainConfig indicates an expected call of GetChainConfig.
func (*MockStateDBMockRecorder) GetContractDbName ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) GetContractDbName(contractName interface{}) *gomock.Call
GetContractDbName indicates an expected call of GetContractDbName.
func (*MockStateDBMockRecorder) GetDbTransaction ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) GetDbTransaction(txName interface{}) *gomock.Call
GetDbTransaction indicates an expected call of GetDbTransaction.
func (*MockStateDBMockRecorder) GetLastSavepoint ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) GetLastSavepoint() *gomock.Call
GetLastSavepoint indicates an expected call of GetLastSavepoint.
func (*MockStateDBMockRecorder) GetMemberExtraData ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) GetMemberExtraData(member interface{}) *gomock.Call
GetMemberExtraData indicates an expected call of GetMemberExtraData.
func (*MockStateDBMockRecorder) InitGenesis ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) InitGenesis(genesisBlock interface{}) *gomock.Call
InitGenesis indicates an expected call of InitGenesis.
func (*MockStateDBMockRecorder) QueryMulti ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) QueryMulti(contractName, sql interface{}, values ...interface{}) *gomock.Call
QueryMulti indicates an expected call of QueryMulti.
func (*MockStateDBMockRecorder) QuerySingle ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) QuerySingle(contractName, sql interface{}, values ...interface{}) *gomock.Call
QuerySingle indicates an expected call of QuerySingle.
func (*MockStateDBMockRecorder) ReadObject ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) ReadObject(contractName, key interface{}) *gomock.Call
ReadObject indicates an expected call of ReadObject.
func (*MockStateDBMockRecorder) ReadObjects ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) ReadObjects(contractName, keys interface{}) *gomock.Call
ReadObjects indicates an expected call of ReadObjects.
func (*MockStateDBMockRecorder) RollbackDbTransaction ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) RollbackDbTransaction(txName interface{}) *gomock.Call
RollbackDbTransaction indicates an expected call of RollbackDbTransaction.
func (*MockStateDBMockRecorder) SelectObject ¶ added in v2.3.0
func (mr *MockStateDBMockRecorder) SelectObject(contractName, startKey, limit interface{}) *gomock.Call
SelectObject indicates an expected call of SelectObject.
type StateDB ¶
type StateDB interface { // InitGenesis 创世块写入 // @Description: // @param genesisBlock // @return error InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error // CommitBlock commits the state in an atomic operation // @Description: // @param blockWithRWSet // @param isCache // @return error CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error // GetChainConfig get last chain config // @Description: // @return *configPb.ChainConfig // @return error GetChainConfig() (*configPb.ChainConfig, error) // ReadObject returns the state value for given contract name and key, or returns nil if none exists. // @Description: // @param contractName // @param key // @return []byte // @return error ReadObject(contractName string, key []byte) ([]byte, error) // ReadObjects returns the state values for given contract name and keys ReadObjects(contractName string, keys [][]byte) ([][]byte, error) // SelectObject returns an iterator that contains all the key-values between given key ranges. // @Description: // startKey is included in the results and limit is excluded. // @param contractName // @param startKey // @param limit // @return protocol.StateIterator // @return error SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error) // GetLastSavepoint returns the last block height // @Description: // @return uint64 // @return error GetLastSavepoint() (uint64, error) // Close Close is used to close database // @Description: Close() // QuerySingle 不在事务中,直接查询状态数据库,返回一行结果 // @Description: // @param contractName // @param sql // @param values // @return protocol.SqlRow // @return error QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error) // QueryMulti 不在事务中,直接查询状态数据库,返回多行结果 // @Description: // @param contractName // @param sql // @param values // @return protocol.SqlRows // @return error QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error) // ExecDdlSql // @Description: 执行DDL语句 // @param contractName // @param sql // @param version // @return error ExecDdlSql(contractName, sql, version string) error // BeginDbTransaction // @Description: 启用一个事务 // @param txName // @return protocol.SqlDBTransaction // @return error BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error) // GetDbTransaction // @Description: 根据事务名,获得一个已经启用的事务 // @param txName // @return protocol.SqlDBTransaction // @return error GetDbTransaction(txName string) (protocol.SqlDBTransaction, error) // CommitDbTransaction // @Description: 提交一个事务 // @param txName // @return error CommitDbTransaction(txName string) error // RollbackDbTransaction // @Description: 回滚一个事务 // @param txName // @return error RollbackDbTransaction(txName string) error // CreateDatabase // @Description: 创建database // @param contractName // @return error CreateDatabase(contractName string) error // DropDatabase // @Description: 删除一个合约对应的数据库 // @param contractName // @return error DropDatabase(contractName string) error // GetContractDbName // @Description: 获得一个合约对应的状态数据库名 // @param contractName // @return string GetContractDbName(contractName string) string // GetMemberExtraData // @Description: // @param member // @return *accesscontrol.MemberExtraData // @return error GetMemberExtraData(member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error) }
StateDB provides handle to world state instances @Description: