chain_state

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package chain_state is a generated GoMock package.

Index

Constants

View Source
const (
	STOP   = 0
	INITED = 1
)
View Source
const (
	ConsensusNoCache   = 0
	ConsensusReadCache = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	IterateAccounts(iterateFunc func(addr types.Address, accountId uint64, err error) bool)

	QueryLatestSnapshotBlock() (*ledger.SnapshotBlock, error)

	GetLatestSnapshotBlock() *ledger.SnapshotBlock

	GetSnapshotHeightByHash(hash types.Hash) (uint64, error)

	GetUnconfirmedBlocks(addr types.Address) []*ledger.AccountBlock

	GetAccountBlockByHash(blockHash types.Hash) (*ledger.AccountBlock, error)

	GetSnapshotHeaderBeforeTime(timestamp *time.Time) (*ledger.SnapshotBlock, error)

	GetSnapshotHeadersAfterOrEqualTime(endHashHeight *ledger.HashHeight, startTime *time.Time, producer *types.Address) ([]*ledger.SnapshotBlock, error)

	// header without snapshot content
	GetSnapshotHeaderByHeight(height uint64) (*ledger.SnapshotBlock, error)

	StopWrite()

	RecoverWrite()
}

type Consensus

type Consensus interface {
	VerifyAccountProducer(block *ledger.AccountBlock) (bool, error)
	SBPReader() core.SBPStatReader
}

type FlushingBatch

type FlushingBatch struct {
	Operation byte
	Batch     *leveldb.Batch
}

type LogItem

type LogItem struct {
	Storage      [][2][]byte
	BalanceMap   map[types.TokenTypeId]*big.Int
	Code         []byte
	ContractMeta map[types.Address][]byte
	VmLogList    map[types.Hash][]byte
	CallDepth    map[types.Hash]uint16
	Height       uint64 // account block height
}

type MemPool

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

func NewMemPool

func NewMemPool(byteSliceLimit int, intSliceLimit int) *MemPool

func (*MemPool) GetByteSlice

func (mp *MemPool) GetByteSlice(n int) []byte

func (*MemPool) GetIntSlice

func (mp *MemPool) GetIntSlice(n int) []int

func (*MemPool) Put

func (mp *MemPool) Put(x interface{})

type MockChain added in v2.11.3

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

MockChain is a mock of Chain interface.

func NewMockChain added in v2.11.3

func NewMockChain(ctrl *gomock.Controller) *MockChain

NewMockChain creates a new mock instance.

func (*MockChain) EXPECT added in v2.11.3

func (m *MockChain) EXPECT() *MockChainMockRecorder

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

func (*MockChain) GetAccountBlockByHash added in v2.11.3

func (m *MockChain) GetAccountBlockByHash(blockHash types.Hash) (*core.AccountBlock, error)

GetAccountBlockByHash mocks base method.

func (*MockChain) GetLatestSnapshotBlock added in v2.11.3

func (m *MockChain) GetLatestSnapshotBlock() *core.SnapshotBlock

GetLatestSnapshotBlock mocks base method.

func (*MockChain) GetSnapshotHeaderBeforeTime added in v2.11.3

func (m *MockChain) GetSnapshotHeaderBeforeTime(timestamp *time.Time) (*core.SnapshotBlock, error)

GetSnapshotHeaderBeforeTime mocks base method.

func (*MockChain) GetSnapshotHeaderByHeight added in v2.11.3

func (m *MockChain) GetSnapshotHeaderByHeight(height uint64) (*core.SnapshotBlock, error)

GetSnapshotHeaderByHeight mocks base method.

func (*MockChain) GetSnapshotHeadersAfterOrEqualTime added in v2.11.3

func (m *MockChain) GetSnapshotHeadersAfterOrEqualTime(endHashHeight *core.HashHeight, startTime *time.Time, producer *types.Address) ([]*core.SnapshotBlock, error)

GetSnapshotHeadersAfterOrEqualTime mocks base method.

func (*MockChain) GetSnapshotHeightByHash added in v2.11.3

func (m *MockChain) GetSnapshotHeightByHash(hash types.Hash) (uint64, error)

GetSnapshotHeightByHash mocks base method.

func (*MockChain) GetUnconfirmedBlocks added in v2.11.3

func (m *MockChain) GetUnconfirmedBlocks(addr types.Address) []*core.AccountBlock

GetUnconfirmedBlocks mocks base method.

func (*MockChain) IterateAccounts added in v2.11.3

func (m *MockChain) IterateAccounts(iterateFunc func(types.Address, uint64, error) bool)

IterateAccounts mocks base method.

func (*MockChain) QueryLatestSnapshotBlock added in v2.11.3

func (m *MockChain) QueryLatestSnapshotBlock() (*core.SnapshotBlock, error)

QueryLatestSnapshotBlock mocks base method.

func (*MockChain) RecoverWrite added in v2.11.3

func (m *MockChain) RecoverWrite()

RecoverWrite mocks base method.

func (*MockChain) StopWrite added in v2.11.3

func (m *MockChain) StopWrite()

StopWrite mocks base method.

type MockChainMockRecorder added in v2.11.3

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

MockChainMockRecorder is the mock recorder for MockChain.

func (*MockChainMockRecorder) GetAccountBlockByHash added in v2.11.3

func (mr *MockChainMockRecorder) GetAccountBlockByHash(blockHash interface{}) *gomock.Call

GetAccountBlockByHash indicates an expected call of GetAccountBlockByHash.

func (*MockChainMockRecorder) GetLatestSnapshotBlock added in v2.11.3

func (mr *MockChainMockRecorder) GetLatestSnapshotBlock() *gomock.Call

GetLatestSnapshotBlock indicates an expected call of GetLatestSnapshotBlock.

func (*MockChainMockRecorder) GetSnapshotHeaderBeforeTime added in v2.11.3

func (mr *MockChainMockRecorder) GetSnapshotHeaderBeforeTime(timestamp interface{}) *gomock.Call

GetSnapshotHeaderBeforeTime indicates an expected call of GetSnapshotHeaderBeforeTime.

func (*MockChainMockRecorder) GetSnapshotHeaderByHeight added in v2.11.3

func (mr *MockChainMockRecorder) GetSnapshotHeaderByHeight(height interface{}) *gomock.Call

GetSnapshotHeaderByHeight indicates an expected call of GetSnapshotHeaderByHeight.

func (*MockChainMockRecorder) GetSnapshotHeadersAfterOrEqualTime added in v2.11.3

func (mr *MockChainMockRecorder) GetSnapshotHeadersAfterOrEqualTime(endHashHeight, startTime, producer interface{}) *gomock.Call

GetSnapshotHeadersAfterOrEqualTime indicates an expected call of GetSnapshotHeadersAfterOrEqualTime.

func (*MockChainMockRecorder) GetSnapshotHeightByHash added in v2.11.3

func (mr *MockChainMockRecorder) GetSnapshotHeightByHash(hash interface{}) *gomock.Call

GetSnapshotHeightByHash indicates an expected call of GetSnapshotHeightByHash.

func (*MockChainMockRecorder) GetUnconfirmedBlocks added in v2.11.3

func (mr *MockChainMockRecorder) GetUnconfirmedBlocks(addr interface{}) *gomock.Call

GetUnconfirmedBlocks indicates an expected call of GetUnconfirmedBlocks.

func (*MockChainMockRecorder) IterateAccounts added in v2.11.3

func (mr *MockChainMockRecorder) IterateAccounts(iterateFunc interface{}) *gomock.Call

IterateAccounts indicates an expected call of IterateAccounts.

func (*MockChainMockRecorder) QueryLatestSnapshotBlock added in v2.11.3

func (mr *MockChainMockRecorder) QueryLatestSnapshotBlock() *gomock.Call

QueryLatestSnapshotBlock indicates an expected call of QueryLatestSnapshotBlock.

func (*MockChainMockRecorder) RecoverWrite added in v2.11.3

func (mr *MockChainMockRecorder) RecoverWrite() *gomock.Call

RecoverWrite indicates an expected call of RecoverWrite.

func (*MockChainMockRecorder) StopWrite added in v2.11.3

func (mr *MockChainMockRecorder) StopWrite() *gomock.Call

StopWrite indicates an expected call of StopWrite.

type MockConsensus added in v2.11.3

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

MockConsensus is a mock of Consensus interface.

func NewMockConsensus added in v2.11.3

func NewMockConsensus(ctrl *gomock.Controller) *MockConsensus

NewMockConsensus creates a new mock instance.

func (*MockConsensus) EXPECT added in v2.11.3

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

func (*MockConsensus) SBPReader added in v2.11.3

func (m *MockConsensus) SBPReader() core0.SBPStatReader

SBPReader mocks base method.

func (*MockConsensus) VerifyAccountProducer added in v2.11.3

func (m *MockConsensus) VerifyAccountProducer(block *core.AccountBlock) (bool, error)

VerifyAccountProducer mocks base method.

type MockConsensusMockRecorder added in v2.11.3

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

MockConsensusMockRecorder is the mock recorder for MockConsensus.

func (*MockConsensusMockRecorder) SBPReader added in v2.11.3

func (mr *MockConsensusMockRecorder) SBPReader() *gomock.Call

SBPReader indicates an expected call of SBPReader.

func (*MockConsensusMockRecorder) VerifyAccountProducer added in v2.11.3

func (mr *MockConsensusMockRecorder) VerifyAccountProducer(block interface{}) *gomock.Call

VerifyAccountProducer indicates an expected call of VerifyAccountProducer.

type MockRedoInterface added in v2.11.3

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

MockRedoInterface is a mock of RedoInterface interface.

func NewMockRedoInterface added in v2.11.3

func NewMockRedoInterface(ctrl *gomock.Controller) *MockRedoInterface

NewMockRedoInterface creates a new mock instance.

func (*MockRedoInterface) AddLog added in v2.11.3

func (m *MockRedoInterface) AddLog(addr types.Address, log LogItem)

AddLog mocks base method.

func (*MockRedoInterface) Close added in v2.11.3

func (m *MockRedoInterface) Close() error

Close mocks base method.

func (*MockRedoInterface) EXPECT added in v2.11.3

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

func (*MockRedoInterface) HasRedo added in v2.11.3

func (m *MockRedoInterface) HasRedo(snapshotHeight uint64) (bool, error)

HasRedo mocks base method.

func (*MockRedoInterface) InsertSnapshotBlock added in v2.11.3

func (m *MockRedoInterface) InsertSnapshotBlock(snapshotBlock *core.SnapshotBlock, confirmedBlocks []*core.AccountBlock)

InsertSnapshotBlock mocks base method.

func (*MockRedoInterface) QueryLog added in v2.11.3

func (m *MockRedoInterface) QueryLog(snapshotHeight uint64) (SnapshotLog, bool, error)

QueryLog mocks base method.

func (*MockRedoInterface) Rollback added in v2.11.3

func (m *MockRedoInterface) Rollback(chunks []*core.SnapshotChunk)

Rollback mocks base method.

func (*MockRedoInterface) SetCurrentSnapshot added in v2.11.3

func (m *MockRedoInterface) SetCurrentSnapshot(snapshotHeight uint64, logMap SnapshotLog)

SetCurrentSnapshot mocks base method.

type MockRedoInterfaceMockRecorder added in v2.11.3

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

MockRedoInterfaceMockRecorder is the mock recorder for MockRedoInterface.

func (*MockRedoInterfaceMockRecorder) AddLog added in v2.11.3

func (mr *MockRedoInterfaceMockRecorder) AddLog(addr, log interface{}) *gomock.Call

AddLog indicates an expected call of AddLog.

func (*MockRedoInterfaceMockRecorder) Close added in v2.11.3

Close indicates an expected call of Close.

func (*MockRedoInterfaceMockRecorder) HasRedo added in v2.11.3

func (mr *MockRedoInterfaceMockRecorder) HasRedo(snapshotHeight interface{}) *gomock.Call

HasRedo indicates an expected call of HasRedo.

func (*MockRedoInterfaceMockRecorder) InsertSnapshotBlock added in v2.11.3

func (mr *MockRedoInterfaceMockRecorder) InsertSnapshotBlock(snapshotBlock, confirmedBlocks interface{}) *gomock.Call

InsertSnapshotBlock indicates an expected call of InsertSnapshotBlock.

func (*MockRedoInterfaceMockRecorder) QueryLog added in v2.11.3

func (mr *MockRedoInterfaceMockRecorder) QueryLog(snapshotHeight interface{}) *gomock.Call

QueryLog indicates an expected call of QueryLog.

func (*MockRedoInterfaceMockRecorder) Rollback added in v2.11.3

func (mr *MockRedoInterfaceMockRecorder) Rollback(chunks interface{}) *gomock.Call

Rollback indicates an expected call of Rollback.

func (*MockRedoInterfaceMockRecorder) SetCurrentSnapshot added in v2.11.3

func (mr *MockRedoInterfaceMockRecorder) SetCurrentSnapshot(snapshotHeight, logMap interface{}) *gomock.Call

SetCurrentSnapshot indicates an expected call of SetCurrentSnapshot.

type MockRoundCacheInterface added in v2.11.3

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

MockRoundCacheInterface is a mock of RoundCacheInterface interface.

func NewMockRoundCacheInterface added in v2.11.3

func NewMockRoundCacheInterface(ctrl *gomock.Controller) *MockRoundCacheInterface

NewMockRoundCacheInterface creates a new mock instance.

func (*MockRoundCacheInterface) DeleteSnapshotBlocks added in v2.11.3

func (m *MockRoundCacheInterface) DeleteSnapshotBlocks(snapshotBlocks []*core.SnapshotBlock) error

DeleteSnapshotBlocks mocks base method.

func (*MockRoundCacheInterface) EXPECT added in v2.11.3

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

func (*MockRoundCacheInterface) GetSnapshotViteBalanceList added in v2.11.3

func (m *MockRoundCacheInterface) GetSnapshotViteBalanceList(snapshotHash types.Hash, addrList []types.Address) (map[types.Address]*big.Int, []types.Address, error)

GetSnapshotViteBalanceList mocks base method.

func (*MockRoundCacheInterface) Init added in v2.11.3

func (m *MockRoundCacheInterface) Init(timeIndex core0.TimeIndex) error

Init mocks base method.

func (*MockRoundCacheInterface) InsertSnapshotBlock added in v2.11.3

func (m *MockRoundCacheInterface) InsertSnapshotBlock(snapshotBlock *core.SnapshotBlock, snapshotLog SnapshotLog) error

InsertSnapshotBlock mocks base method.

func (*MockRoundCacheInterface) StorageIterator added in v2.11.3

func (m *MockRoundCacheInterface) StorageIterator(snapshotHash types.Hash) interfaces.StorageIterator

StorageIterator mocks base method.

type MockRoundCacheInterfaceMockRecorder added in v2.11.3

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

MockRoundCacheInterfaceMockRecorder is the mock recorder for MockRoundCacheInterface.

func (*MockRoundCacheInterfaceMockRecorder) DeleteSnapshotBlocks added in v2.11.3

func (mr *MockRoundCacheInterfaceMockRecorder) DeleteSnapshotBlocks(snapshotBlocks interface{}) *gomock.Call

DeleteSnapshotBlocks indicates an expected call of DeleteSnapshotBlocks.

func (*MockRoundCacheInterfaceMockRecorder) GetSnapshotViteBalanceList added in v2.11.3

func (mr *MockRoundCacheInterfaceMockRecorder) GetSnapshotViteBalanceList(snapshotHash, addrList interface{}) *gomock.Call

GetSnapshotViteBalanceList indicates an expected call of GetSnapshotViteBalanceList.

func (*MockRoundCacheInterfaceMockRecorder) Init added in v2.11.3

func (mr *MockRoundCacheInterfaceMockRecorder) Init(timeIndex interface{}) *gomock.Call

Init indicates an expected call of Init.

func (*MockRoundCacheInterfaceMockRecorder) InsertSnapshotBlock added in v2.11.3

func (mr *MockRoundCacheInterfaceMockRecorder) InsertSnapshotBlock(snapshotBlock, snapshotLog interface{}) *gomock.Call

InsertSnapshotBlock indicates an expected call of InsertSnapshotBlock.

func (*MockRoundCacheInterfaceMockRecorder) StorageIterator added in v2.11.3

func (mr *MockRoundCacheInterfaceMockRecorder) StorageIterator(snapshotHash interface{}) *gomock.Call

StorageIterator indicates an expected call of StorageIterator.

type MockStateDBInterface added in v2.11.3

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

MockStateDBInterface is a mock of StateDBInterface interface.

func NewMockStateDBInterface added in v2.11.3

func NewMockStateDBInterface(ctrl *gomock.Controller) *MockStateDBInterface

NewMockStateDBInterface creates a new mock instance.

func (*MockStateDBInterface) Close added in v2.11.3

func (m *MockStateDBInterface) Close() error

Close mocks base method.

func (*MockStateDBInterface) EXPECT added in v2.11.3

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

func (*MockStateDBInterface) GetBalance added in v2.11.3

func (m *MockStateDBInterface) GetBalance(addr types.Address, tokenTypeId types.TokenTypeId) (*big.Int, error)

GetBalance mocks base method.

func (*MockStateDBInterface) GetBalanceMap added in v2.11.3

func (m *MockStateDBInterface) GetBalanceMap(addr types.Address) (map[types.TokenTypeId]*big.Int, error)

GetBalanceMap mocks base method.

func (*MockStateDBInterface) GetCallDepth added in v2.11.3

func (m *MockStateDBInterface) GetCallDepth(sendBlockHash *types.Hash) (uint16, error)

GetCallDepth mocks base method.

func (*MockStateDBInterface) GetCode added in v2.11.3

func (m *MockStateDBInterface) GetCode(addr types.Address) ([]byte, error)

GetCode mocks base method.

func (*MockStateDBInterface) GetContractList added in v2.11.3

func (m *MockStateDBInterface) GetContractList(gid *types.Gid) ([]types.Address, error)

GetContractList mocks base method.

func (*MockStateDBInterface) GetContractMeta added in v2.11.3

func (m *MockStateDBInterface) GetContractMeta(addr types.Address) (*core.ContractMeta, error)

GetContractMeta mocks base method.

func (*MockStateDBInterface) GetSnapshotBalanceList added in v2.11.3

func (m *MockStateDBInterface) GetSnapshotBalanceList(balanceMap map[types.Address]*big.Int, snapshotBlockHash types.Hash, addrList []types.Address, tokenId types.TokenTypeId) error

GetSnapshotBalanceList mocks base method.

func (*MockStateDBInterface) GetSnapshotValue added in v2.11.3

func (m *MockStateDBInterface) GetSnapshotValue(snapshotBlockHeight uint64, addr types.Address, key []byte) ([]byte, error)

GetSnapshotValue mocks base method.

func (*MockStateDBInterface) GetStatus added in v2.11.3

func (m *MockStateDBInterface) GetStatus() []interfaces.DBStatus

GetStatus mocks base method.

func (*MockStateDBInterface) GetStorageValue added in v2.11.3

func (m *MockStateDBInterface) GetStorageValue(addr *types.Address, key []byte) ([]byte, error)

GetStorageValue mocks base method.

func (*MockStateDBInterface) GetVmLogList added in v2.11.3

func (m *MockStateDBInterface) GetVmLogList(logHash *types.Hash) (core.VmLogList, error)

GetVmLogList mocks base method.

func (*MockStateDBInterface) HasContractMeta added in v2.11.3

func (m *MockStateDBInterface) HasContractMeta(addr types.Address) (bool, error)

HasContractMeta mocks base method.

func (*MockStateDBInterface) Init added in v2.11.3

func (m *MockStateDBInterface) Init() error

Init mocks base method.

func (*MockStateDBInterface) InsertSnapshotBlock added in v2.11.3

func (m *MockStateDBInterface) InsertSnapshotBlock(snapshotBlock *core.SnapshotBlock, confirmedBlocks []*core.AccountBlock) error

InsertSnapshotBlock mocks base method.

func (*MockStateDBInterface) IterateContracts added in v2.11.3

func (m *MockStateDBInterface) IterateContracts(iterateFunc func(types.Address, *core.ContractMeta, error) bool)

IterateContracts mocks base method.

func (*MockStateDBInterface) NewRawSnapshotStorageIteratorByHeight added in v2.11.3

func (m *MockStateDBInterface) NewRawSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr types.Address, prefix []byte) interfaces.StorageIterator

NewRawSnapshotStorageIteratorByHeight mocks base method.

func (*MockStateDBInterface) NewSnapshotStorageIterator added in v2.11.3

func (m *MockStateDBInterface) NewSnapshotStorageIterator(snapshotHash types.Hash, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)

NewSnapshotStorageIterator mocks base method.

func (*MockStateDBInterface) NewSnapshotStorageIteratorByHeight added in v2.11.3

func (m *MockStateDBInterface) NewSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)

NewSnapshotStorageIteratorByHeight mocks base method.

func (*MockStateDBInterface) NewStorageDatabase added in v2.11.3

func (m *MockStateDBInterface) NewStorageDatabase(snapshotHash types.Hash, addr types.Address) (StorageDatabaseInterface, error)

NewStorageDatabase mocks base method.

func (*MockStateDBInterface) NewStorageIterator added in v2.11.3

func (m *MockStateDBInterface) NewStorageIterator(addr types.Address, prefix []byte) interfaces.StorageIterator

NewStorageIterator mocks base method.

func (*MockStateDBInterface) Redo added in v2.11.3

Redo mocks base method.

func (*MockStateDBInterface) RedoStore added in v2.11.3

func (m *MockStateDBInterface) RedoStore() *db.Store

RedoStore mocks base method.

func (*MockStateDBInterface) RollbackAccountBlocks added in v2.11.3

func (m *MockStateDBInterface) RollbackAccountBlocks(accountBlocks []*core.AccountBlock) error

RollbackAccountBlocks mocks base method.

func (*MockStateDBInterface) RollbackSnapshotBlocks added in v2.11.3

func (m *MockStateDBInterface) RollbackSnapshotBlocks(deletedSnapshotSegments []*core.SnapshotChunk, newUnconfirmedBlocks []*core.AccountBlock) error

RollbackSnapshotBlocks mocks base method.

func (*MockStateDBInterface) SetCacheLevelForConsensus added in v2.11.3

func (m *MockStateDBInterface) SetCacheLevelForConsensus(level uint32)

SetCacheLevelForConsensus mocks base method.

func (*MockStateDBInterface) SetTimeIndex added in v2.11.3

func (m *MockStateDBInterface) SetTimeIndex(periodTimeIndex interfaces.TimeIndex) error

SetTimeIndex mocks base method.

func (*MockStateDBInterface) Store added in v2.11.3

func (m *MockStateDBInterface) Store() *db.Store

Store mocks base method.

func (*MockStateDBInterface) Write added in v2.11.3

Write mocks base method.

func (*MockStateDBInterface) WriteByRedo added in v2.11.3

func (m *MockStateDBInterface) WriteByRedo(blockHash types.Hash, addr types.Address, redoLog LogItem)

WriteByRedo mocks base method.

type MockStateDBInterfaceMockRecorder added in v2.11.3

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

MockStateDBInterfaceMockRecorder is the mock recorder for MockStateDBInterface.

func (*MockStateDBInterfaceMockRecorder) Close added in v2.11.3

Close indicates an expected call of Close.

func (*MockStateDBInterfaceMockRecorder) GetBalance added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetBalance(addr, tokenTypeId interface{}) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockStateDBInterfaceMockRecorder) GetBalanceMap added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetBalanceMap(addr interface{}) *gomock.Call

GetBalanceMap indicates an expected call of GetBalanceMap.

func (*MockStateDBInterfaceMockRecorder) GetCallDepth added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetCallDepth(sendBlockHash interface{}) *gomock.Call

GetCallDepth indicates an expected call of GetCallDepth.

func (*MockStateDBInterfaceMockRecorder) GetCode added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetCode(addr interface{}) *gomock.Call

GetCode indicates an expected call of GetCode.

func (*MockStateDBInterfaceMockRecorder) GetContractList added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetContractList(gid interface{}) *gomock.Call

GetContractList indicates an expected call of GetContractList.

func (*MockStateDBInterfaceMockRecorder) GetContractMeta added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetContractMeta(addr interface{}) *gomock.Call

GetContractMeta indicates an expected call of GetContractMeta.

func (*MockStateDBInterfaceMockRecorder) GetSnapshotBalanceList added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetSnapshotBalanceList(balanceMap, snapshotBlockHash, addrList, tokenId interface{}) *gomock.Call

GetSnapshotBalanceList indicates an expected call of GetSnapshotBalanceList.

func (*MockStateDBInterfaceMockRecorder) GetSnapshotValue added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetSnapshotValue(snapshotBlockHeight, addr, key interface{}) *gomock.Call

GetSnapshotValue indicates an expected call of GetSnapshotValue.

func (*MockStateDBInterfaceMockRecorder) GetStatus added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetStatus() *gomock.Call

GetStatus indicates an expected call of GetStatus.

func (*MockStateDBInterfaceMockRecorder) GetStorageValue added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetStorageValue(addr, key interface{}) *gomock.Call

GetStorageValue indicates an expected call of GetStorageValue.

func (*MockStateDBInterfaceMockRecorder) GetVmLogList added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) GetVmLogList(logHash interface{}) *gomock.Call

GetVmLogList indicates an expected call of GetVmLogList.

func (*MockStateDBInterfaceMockRecorder) HasContractMeta added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) HasContractMeta(addr interface{}) *gomock.Call

HasContractMeta indicates an expected call of HasContractMeta.

func (*MockStateDBInterfaceMockRecorder) Init added in v2.11.3

Init indicates an expected call of Init.

func (*MockStateDBInterfaceMockRecorder) InsertSnapshotBlock added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) InsertSnapshotBlock(snapshotBlock, confirmedBlocks interface{}) *gomock.Call

InsertSnapshotBlock indicates an expected call of InsertSnapshotBlock.

func (*MockStateDBInterfaceMockRecorder) IterateContracts added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) IterateContracts(iterateFunc interface{}) *gomock.Call

IterateContracts indicates an expected call of IterateContracts.

func (*MockStateDBInterfaceMockRecorder) NewRawSnapshotStorageIteratorByHeight added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) NewRawSnapshotStorageIteratorByHeight(snapshotHeight, addr, prefix interface{}) *gomock.Call

NewRawSnapshotStorageIteratorByHeight indicates an expected call of NewRawSnapshotStorageIteratorByHeight.

func (*MockStateDBInterfaceMockRecorder) NewSnapshotStorageIterator added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) NewSnapshotStorageIterator(snapshotHash, addr, prefix interface{}) *gomock.Call

NewSnapshotStorageIterator indicates an expected call of NewSnapshotStorageIterator.

func (*MockStateDBInterfaceMockRecorder) NewSnapshotStorageIteratorByHeight added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) NewSnapshotStorageIteratorByHeight(snapshotHeight, addr, prefix interface{}) *gomock.Call

NewSnapshotStorageIteratorByHeight indicates an expected call of NewSnapshotStorageIteratorByHeight.

func (*MockStateDBInterfaceMockRecorder) NewStorageDatabase added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) NewStorageDatabase(snapshotHash, addr interface{}) *gomock.Call

NewStorageDatabase indicates an expected call of NewStorageDatabase.

func (*MockStateDBInterfaceMockRecorder) NewStorageIterator added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) NewStorageIterator(addr, prefix interface{}) *gomock.Call

NewStorageIterator indicates an expected call of NewStorageIterator.

func (*MockStateDBInterfaceMockRecorder) Redo added in v2.11.3

Redo indicates an expected call of Redo.

func (*MockStateDBInterfaceMockRecorder) RedoStore added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) RedoStore() *gomock.Call

RedoStore indicates an expected call of RedoStore.

func (*MockStateDBInterfaceMockRecorder) RollbackAccountBlocks added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) RollbackAccountBlocks(accountBlocks interface{}) *gomock.Call

RollbackAccountBlocks indicates an expected call of RollbackAccountBlocks.

func (*MockStateDBInterfaceMockRecorder) RollbackSnapshotBlocks added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) RollbackSnapshotBlocks(deletedSnapshotSegments, newUnconfirmedBlocks interface{}) *gomock.Call

RollbackSnapshotBlocks indicates an expected call of RollbackSnapshotBlocks.

func (*MockStateDBInterfaceMockRecorder) SetCacheLevelForConsensus added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) SetCacheLevelForConsensus(level interface{}) *gomock.Call

SetCacheLevelForConsensus indicates an expected call of SetCacheLevelForConsensus.

func (*MockStateDBInterfaceMockRecorder) SetTimeIndex added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) SetTimeIndex(periodTimeIndex interface{}) *gomock.Call

SetTimeIndex indicates an expected call of SetTimeIndex.

func (*MockStateDBInterfaceMockRecorder) Store added in v2.11.3

Store indicates an expected call of Store.

func (*MockStateDBInterfaceMockRecorder) Write added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) Write(block interface{}) *gomock.Call

Write indicates an expected call of Write.

func (*MockStateDBInterfaceMockRecorder) WriteByRedo added in v2.11.3

func (mr *MockStateDBInterfaceMockRecorder) WriteByRedo(blockHash, addr, redoLog interface{}) *gomock.Call

WriteByRedo indicates an expected call of WriteByRedo.

type MockStorageDatabaseInterface added in v2.11.3

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

MockStorageDatabaseInterface is a mock of StorageDatabaseInterface interface.

func NewMockStorageDatabaseInterface added in v2.11.3

func NewMockStorageDatabaseInterface(ctrl *gomock.Controller) *MockStorageDatabaseInterface

NewMockStorageDatabaseInterface creates a new mock instance.

func (*MockStorageDatabaseInterface) Address added in v2.11.3

Address mocks base method.

func (*MockStorageDatabaseInterface) EXPECT added in v2.11.3

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

func (*MockStorageDatabaseInterface) GetValue added in v2.11.3

func (m *MockStorageDatabaseInterface) GetValue(key []byte) ([]byte, error)

GetValue mocks base method.

func (*MockStorageDatabaseInterface) NewStorageIterator added in v2.11.3

func (m *MockStorageDatabaseInterface) NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error)

NewStorageIterator mocks base method.

type MockStorageDatabaseInterfaceMockRecorder added in v2.11.3

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

MockStorageDatabaseInterfaceMockRecorder is the mock recorder for MockStorageDatabaseInterface.

func (*MockStorageDatabaseInterfaceMockRecorder) Address added in v2.11.3

Address indicates an expected call of Address.

func (*MockStorageDatabaseInterfaceMockRecorder) GetValue added in v2.11.3

func (mr *MockStorageDatabaseInterfaceMockRecorder) GetValue(key interface{}) *gomock.Call

GetValue indicates an expected call of GetValue.

func (*MockStorageDatabaseInterfaceMockRecorder) NewStorageIterator added in v2.11.3

func (mr *MockStorageDatabaseInterfaceMockRecorder) NewStorageIterator(prefix interface{}) *gomock.Call

NewStorageIterator indicates an expected call of NewStorageIterator.

type MockTimeIndex added in v2.11.3

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

MockTimeIndex is a mock of TimeIndex interface.

func NewMockTimeIndex added in v2.11.3

func NewMockTimeIndex(ctrl *gomock.Controller) *MockTimeIndex

NewMockTimeIndex creates a new mock instance.

func (*MockTimeIndex) EXPECT added in v2.11.3

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

func (*MockTimeIndex) Index2Time added in v2.11.3

func (m *MockTimeIndex) Index2Time(index uint64) (time.Time, time.Time)

Index2Time mocks base method.

func (*MockTimeIndex) Time2Index added in v2.11.3

func (m *MockTimeIndex) Time2Index(t time.Time) uint64

Time2Index mocks base method.

type MockTimeIndexMockRecorder added in v2.11.3

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

MockTimeIndexMockRecorder is the mock recorder for MockTimeIndex.

func (*MockTimeIndexMockRecorder) Index2Time added in v2.11.3

func (mr *MockTimeIndexMockRecorder) Index2Time(index interface{}) *gomock.Call

Index2Time indicates an expected call of Index2Time.

func (*MockTimeIndexMockRecorder) Time2Index added in v2.11.3

func (mr *MockTimeIndexMockRecorder) Time2Index(t interface{}) *gomock.Call

Time2Index indicates an expected call of Time2Index.

type Redo

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

func NewStorageRedoWithStore

func NewStorageRedoWithStore(chain Chain, store *chain_db.Store) (*Redo, error)

func (*Redo) AddLog

func (redo *Redo) AddLog(addr types.Address, log LogItem)

func (*Redo) Close

func (redo *Redo) Close() error

func (*Redo) HasRedo

func (redo *Redo) HasRedo(snapshotHeight uint64) (bool, error)

func (*Redo) InsertSnapshotBlock

func (redo *Redo) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock)

func (*Redo) QueryLog

func (redo *Redo) QueryLog(snapshotHeight uint64) (SnapshotLog, bool, error)

func (*Redo) Rollback

func (redo *Redo) Rollback(chunks []*ledger.SnapshotChunk)

func (*Redo) SetCurrentSnapshot

func (redo *Redo) SetCurrentSnapshot(snapshotHeight uint64, logMap SnapshotLog)

type RedoCache

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

func NewRedoCache

func NewRedoCache() *RedoCache

func (*RedoCache) AddLog

func (redoCache *RedoCache) AddLog(addr types.Address, log LogItem)

func (*RedoCache) Current

func (redoCache *RedoCache) Current() SnapshotLog

func (*RedoCache) Delete

func (redoCache *RedoCache) Delete(snapshotHeight uint64)

func (*RedoCache) Get

func (redoCache *RedoCache) Get(snapshotHeight uint64) (SnapshotLog, bool)

func (*RedoCache) Init

func (redoCache *RedoCache) Init(currentHeight uint64)

func (*RedoCache) Set

func (redoCache *RedoCache) Set(snapshotHeight uint64, snapshotLog SnapshotLog)

func (*RedoCache) SetCurrent

func (redoCache *RedoCache) SetCurrent(snapshotHeight uint64, snapshotLog SnapshotLog)

type RedoCacheData

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

func NewRedoCacheData

func NewRedoCacheData(roundIndex uint64, lastSnapshotBlock *ledger.SnapshotBlock, currentData *memdb.DB, redoLogs *RoundCacheRedoLogs) *RedoCacheData

type RedoInterface

type RedoInterface interface {
	Close() error
	InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock)
	HasRedo(snapshotHeight uint64) (bool, error)
	QueryLog(snapshotHeight uint64) (SnapshotLog, bool, error)
	SetCurrentSnapshot(snapshotHeight uint64, logMap SnapshotLog)
	AddLog(addr types.Address, log LogItem)
	Rollback(chunks []*ledger.SnapshotChunk)
	// contains filtered or unexported methods
}

type RoundCache

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

func NewRoundCache

func NewRoundCache(chain Chain, stateDB StateDBInterface, roundCount uint8) *RoundCache

func (*RoundCache) DeleteSnapshotBlocks

func (cache *RoundCache) DeleteSnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) error

panic when return error

func (*RoundCache) GetSnapshotViteBalanceList

func (cache *RoundCache) GetSnapshotViteBalanceList(snapshotHash types.Hash, addrList []types.Address) (map[types.Address]*big.Int, []types.Address, error)

tokenId is viteTokenID

func (*RoundCache) Init

func (cache *RoundCache) Init(timeIndex interfaces.TimeIndex) (returnErr error)

build data

func (*RoundCache) InsertSnapshotBlock

func (cache *RoundCache) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, snapshotLog SnapshotLog) (returnErr error)

panic when return error

func (*RoundCache) StorageIterator

func (cache *RoundCache) StorageIterator(snapshotHash types.Hash) interfaces.StorageIterator

type RoundCacheInterface

type RoundCacheInterface interface {
	Init(timeIndex core.TimeIndex) (returnErr error)
	InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, snapshotLog SnapshotLog) (returnErr error)
	DeleteSnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) error
	GetSnapshotViteBalanceList(snapshotHash types.Hash, addrList []types.Address) (map[types.Address]*big.Int, []types.Address, error)
	StorageIterator(snapshotHash types.Hash) interfaces.StorageIterator
	// contains filtered or unexported methods
}

type RoundCacheLogItem

type RoundCacheLogItem struct {
	Storage    [][2][]byte
	BalanceMap map[types.TokenTypeId]*big.Int
}

type RoundCacheRedoLogs

type RoundCacheRedoLogs struct {
	Logs []*RoundCacheSnapshotLog
}

func NewRoundCacheRedoLogs

func NewRoundCacheRedoLogs() *RoundCacheRedoLogs

func (*RoundCacheRedoLogs) Add

func (redoLogs *RoundCacheRedoLogs) Add(snapshotHeight uint64, snapshotLog SnapshotLog)

type RoundCacheSnapshotLog

type RoundCacheSnapshotLog struct {
	LogMap map[types.Address][]RoundCacheLogItem

	SnapshotHeight uint64
}

type SnapshotLog

type SnapshotLog map[types.Address][]LogItem

func (*SnapshotLog) Deserialize

func (sl *SnapshotLog) Deserialize(buf []byte) error

func (*SnapshotLog) Serialize

func (sl *SnapshotLog) Serialize() ([]byte, error)

type StateDB

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

func NewStateDB

func NewStateDB(chain Chain, chainCfg *config.Chain, chainDir string) (*StateDB, error)

func NewStateDBWithStore

func NewStateDBWithStore(chain Chain, chainCfg *config.Chain, store *chain_db.Store, redoStore *chain_db.Store) (*StateDB, error)

func (*StateDB) Close

func (sDB *StateDB) Close() error

func (*StateDB) GetBalance

func (sDB *StateDB) GetBalance(addr types.Address, tokenTypeId types.TokenTypeId) (*big.Int, error)

func (*StateDB) GetBalanceMap

func (sDB *StateDB) GetBalanceMap(addr types.Address) (map[types.TokenTypeId]*big.Int, error)

func (*StateDB) GetCallDepth

func (sDB *StateDB) GetCallDepth(sendBlockHash *types.Hash) (uint16, error)

func (*StateDB) GetCode

func (sDB *StateDB) GetCode(addr types.Address) ([]byte, error)

func (*StateDB) GetContractList

func (sDB *StateDB) GetContractList(gid *types.Gid) ([]types.Address, error)

func (*StateDB) GetContractMeta

func (sDB *StateDB) GetContractMeta(addr types.Address) (*ledger.ContractMeta, error)

func (*StateDB) GetSnapshotBalanceList

func (sDB *StateDB) GetSnapshotBalanceList(balanceMap map[types.Address]*big.Int, snapshotBlockHash types.Hash, addrList []types.Address, tokenId types.TokenTypeId) error

func (*StateDB) GetSnapshotValue

func (sDB *StateDB) GetSnapshotValue(snapshotBlockHeight uint64, addr types.Address, key []byte) ([]byte, error)

func (*StateDB) GetStatus

func (sDB *StateDB) GetStatus() []interfaces.DBStatus

func (*StateDB) GetStorageValue

func (sDB *StateDB) GetStorageValue(addr *types.Address, key []byte) ([]byte, error)

func (*StateDB) GetVmLogList

func (sDB *StateDB) GetVmLogList(logHash *types.Hash) (ledger.VmLogList, error)

func (*StateDB) HasContractMeta

func (sDB *StateDB) HasContractMeta(addr types.Address) (bool, error)

func (*StateDB) Init

func (sDB *StateDB) Init() error

func (*StateDB) InsertSnapshotBlock

func (sDB *StateDB) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock) error

func (*StateDB) IterateContracts

func (sDB *StateDB) IterateContracts(iterateFunc func(addr types.Address, meta *ledger.ContractMeta, err error) bool)

func (*StateDB) NewRawSnapshotStorageIteratorByHeight

func (sDB *StateDB) NewRawSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr types.Address, prefix []byte) interfaces.StorageIterator

func (*StateDB) NewSnapshotStorageIterator

func (sDB *StateDB) NewSnapshotStorageIterator(snapshotHash types.Hash, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)

func (*StateDB) NewSnapshotStorageIteratorByHeight

func (sDB *StateDB) NewSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)

func (*StateDB) NewStorageDatabase

func (sDB *StateDB) NewStorageDatabase(snapshotHash types.Hash, addr types.Address) (StorageDatabaseInterface, error)

func (*StateDB) NewStorageIterator

func (sDB *StateDB) NewStorageIterator(addr types.Address, prefix []byte) interfaces.StorageIterator

func (*StateDB) Redo

func (sDB *StateDB) Redo() RedoInterface

func (*StateDB) RedoStore

func (sDB *StateDB) RedoStore() *chain_db.Store

func (*StateDB) RollbackAccountBlocks

func (sDB *StateDB) RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error

func (*StateDB) RollbackSnapshotBlocks

func (sDB *StateDB) RollbackSnapshotBlocks(deletedSnapshotSegments []*ledger.SnapshotChunk, newUnconfirmedBlocks []*ledger.AccountBlock) error

func (*StateDB) SetCacheLevelForConsensus

func (sDB *StateDB) SetCacheLevelForConsensus(level uint32)

func (*StateDB) SetTimeIndex added in v2.11.3

func (sDB *StateDB) SetTimeIndex(periodTimeIndex interfaces.TimeIndex) error

func (*StateDB) Store

func (sDB *StateDB) Store() *chain_db.Store

func (*StateDB) Write

func (sDB *StateDB) Write(block *interfaces.VmAccountBlock) error

func (*StateDB) WriteByRedo

func (sDB *StateDB) WriteByRedo(blockHash types.Hash, addr types.Address, redoLog LogItem)

type StateDBInterface

type StateDBInterface interface {
	NewStorageIterator(addr types.Address, prefix []byte) interfaces.StorageIterator
	NewSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)
	NewSnapshotStorageIterator(snapshotHash types.Hash, addr types.Address, prefix []byte) (interfaces.StorageIterator, error)
	NewRawSnapshotStorageIteratorByHeight(snapshotHeight uint64, addr types.Address, prefix []byte) interfaces.StorageIterator
	RollbackSnapshotBlocks(deletedSnapshotSegments []*ledger.SnapshotChunk, newUnconfirmedBlocks []*ledger.AccountBlock) error
	RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error

	Init() error
	Close() error
	SetTimeIndex(periodTimeIndex interfaces.TimeIndex) error
	GetStorageValue(addr *types.Address, key []byte) ([]byte, error)
	GetBalance(addr types.Address, tokenTypeId types.TokenTypeId) (*big.Int, error)
	GetBalanceMap(addr types.Address) (map[types.TokenTypeId]*big.Int, error)
	GetCode(addr types.Address) ([]byte, error)
	GetContractMeta(addr types.Address) (*ledger.ContractMeta, error)
	IterateContracts(iterateFunc func(addr types.Address, meta *ledger.ContractMeta, err error) bool)
	HasContractMeta(addr types.Address) (bool, error)
	GetContractList(gid *types.Gid) ([]types.Address, error)
	GetVmLogList(logHash *types.Hash) (ledger.VmLogList, error)
	GetCallDepth(sendBlockHash *types.Hash) (uint16, error)
	GetSnapshotBalanceList(balanceMap map[types.Address]*big.Int, snapshotBlockHash types.Hash, addrList []types.Address, tokenId types.TokenTypeId) error
	GetSnapshotValue(snapshotBlockHeight uint64, addr types.Address, key []byte) ([]byte, error)
	SetCacheLevelForConsensus(level uint32)
	Store() *chain_db.Store
	RedoStore() *chain_db.Store
	Redo() RedoInterface
	GetStatus() []interfaces.DBStatus

	NewStorageDatabase(snapshotHash types.Hash, addr types.Address) (StorageDatabaseInterface, error)

	Write(block *interfaces.VmAccountBlock) error
	WriteByRedo(blockHash types.Hash, addr types.Address, redoLog LogItem)
	InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock) error
	// contains filtered or unexported methods
}

type StorageDatabase

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

func (*StorageDatabase) Address

func (sd *StorageDatabase) Address() *types.Address

func (*StorageDatabase) GetValue

func (sd *StorageDatabase) GetValue(key []byte) ([]byte, error)

func (*StorageDatabase) NewStorageIterator

func (sd *StorageDatabase) NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error)

type StorageDatabaseInterface

type StorageDatabaseInterface interface {
	GetValue(key []byte) ([]byte, error)
	NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error)
	Address() *types.Address
}

func NewStorageDatabase

func NewStorageDatabase(stateDb *StateDB, hashHeight ledger.HashHeight, addr types.Address) StorageDatabaseInterface

type TimeIndex

type TimeIndex interface {
	Index2Time(index uint64) (time.Time, time.Time)
	Time2Index(t time.Time) uint64
}

type TransformIterator

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

func NewTransformIterator

func NewTransformIterator(iter iterator.Iterator, keyPrefixLength int) *TransformIterator

func (*TransformIterator) Error

func (rcIter *TransformIterator) Error() error

func (*TransformIterator) Key

func (rcIter *TransformIterator) Key() []byte

func (*TransformIterator) Last

func (rcIter *TransformIterator) Last() bool

func (*TransformIterator) Next

func (rcIter *TransformIterator) Next() bool

func (*TransformIterator) Prev

func (rcIter *TransformIterator) Prev() bool

func (*TransformIterator) Release

func (rcIter *TransformIterator) Release()

func (*TransformIterator) Seek

func (rcIter *TransformIterator) Seek(key []byte) bool

func (*TransformIterator) Value

func (rcIter *TransformIterator) Value() []byte

Jump to

Keyboard shortcuts

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