resultdb

package
v3.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

结果(收据)数据库

保存了合约执行的结果集,包括:

  • 结果状态
  • 读写集
  • 事件日志

结果对象

主键为txId

事件日志

SQL DB

数据库名: chainId+"_resultdb"

Documentation

Overview

Package resultdb is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockResultDB added in v3.0.1

type MockResultDB struct {
	// contains filtered or unexported fields
}

MockResultDB is a mock of ResultDB interface.

func NewMockResultDB added in v3.0.1

func NewMockResultDB(ctrl *gomock.Controller) *MockResultDB

NewMockResultDB creates a new mock instance.

func (*MockResultDB) Close added in v3.0.1

func (m *MockResultDB) Close()

Close mocks base method.

func (*MockResultDB) CommitBlock added in v3.0.1

func (m *MockResultDB) CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error

CommitBlock mocks base method.

func (*MockResultDB) EXPECT added in v3.0.1

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockResultDB) GetLastSavepoint added in v3.0.1

func (m *MockResultDB) GetLastSavepoint() (uint64, error)

GetLastSavepoint mocks base method.

func (*MockResultDB) GetRWSetIndex added in v3.0.1

func (m *MockResultDB) GetRWSetIndex(txId string) (*store.StoreInfo, error)

GetRWSetIndex mocks base method.

func (*MockResultDB) GetTxRWSet added in v3.0.1

func (m *MockResultDB) GetTxRWSet(txid string) (*common.TxRWSet, error)

GetTxRWSet mocks base method.

func (*MockResultDB) InitGenesis added in v3.0.1

func (m *MockResultDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error

InitGenesis mocks base method.

func (*MockResultDB) RestoreBlocks added in v3.0.1

func (m *MockResultDB) RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error

RestoreBlocks mocks base method.

func (*MockResultDB) ShrinkBlocks added in v3.0.1

func (m *MockResultDB) ShrinkBlocks(txIdsMap map[uint64][]string, height uint64, bfdbPath string) error

ShrinkBlocks mocks base method.

type MockResultDBMockRecorder added in v3.0.1

type MockResultDBMockRecorder struct {
	// contains filtered or unexported fields
}

MockResultDBMockRecorder is the mock recorder for MockResultDB.

func (*MockResultDBMockRecorder) Close added in v3.0.1

func (mr *MockResultDBMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockResultDBMockRecorder) CommitBlock added in v3.0.1

func (mr *MockResultDBMockRecorder) CommitBlock(blockInfo, isCache interface{}) *gomock.Call

CommitBlock indicates an expected call of CommitBlock.

func (*MockResultDBMockRecorder) GetLastSavepoint added in v3.0.1

func (mr *MockResultDBMockRecorder) GetLastSavepoint() *gomock.Call

GetLastSavepoint indicates an expected call of GetLastSavepoint.

func (*MockResultDBMockRecorder) GetRWSetIndex added in v3.0.1

func (mr *MockResultDBMockRecorder) GetRWSetIndex(txId interface{}) *gomock.Call

GetRWSetIndex indicates an expected call of GetRWSetIndex.

func (*MockResultDBMockRecorder) GetTxRWSet added in v3.0.1

func (mr *MockResultDBMockRecorder) GetTxRWSet(txid interface{}) *gomock.Call

GetTxRWSet indicates an expected call of GetTxRWSet.

func (*MockResultDBMockRecorder) InitGenesis added in v3.0.1

func (mr *MockResultDBMockRecorder) InitGenesis(genesisBlock interface{}) *gomock.Call

InitGenesis indicates an expected call of InitGenesis.

func (*MockResultDBMockRecorder) RestoreBlocks added in v3.0.1

func (mr *MockResultDBMockRecorder) RestoreBlocks(blockInfos interface{}) *gomock.Call

RestoreBlocks indicates an expected call of RestoreBlocks.

func (*MockResultDBMockRecorder) ShrinkBlocks added in v3.0.1

func (mr *MockResultDBMockRecorder) ShrinkBlocks(txIdsMap, height, bfdbPath interface{}) *gomock.Call

ShrinkBlocks indicates an expected call of ShrinkBlocks.

type ResultDB

type ResultDB interface {
	InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error

	// CommitBlock commits the block rwsets in an atomic operation
	CommitBlock(blockInfo *serialization.BlockWithSerializedInfo, isCache bool) error

	// ShrinkBlocks archive old blocks rwsets in an atomic operation
	ShrinkBlocks(txIdsMap map[uint64][]string, height uint64, bfdbPath string) error

	// RestoreBlocks restore blocks from outside serialized block data
	RestoreBlocks(blockInfos []*serialization.BlockWithSerializedInfo) error

	// GetTxRWSet returns an txRWSet for given txId, or returns nil if none exists.
	GetTxRWSet(txid string) (*commonPb.TxRWSet, error)

	// GetRWSetIndex returns the offset of the rwset in the file
	GetRWSetIndex(txId string) (*storePb.StoreInfo, error)

	// GetLastSavepoint returns the last block height
	GetLastSavepoint() (uint64, error)

	// Close is used to close database
	Close()
}

ResultDB provides handle to rwSets instances

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL