state
Package state is a generated GoMock package.
import "github.com/luxfi/node/vms/proposervm/state"Package state is a generated GoMock package.
Functions
ScanBlocks
func ScanBlocks(db *versiondb.Database, visit func(block.Block) error) errorScanBlocks visits every OUTER proposervm block persisted in the block store of [db], in key order.
It is a REPAIR-PATH reader, deliberately kept OUT of the State interface: the hot path addresses blocks by id, and only the boot-time index rebuild (proposervm.rebuildOuterIndexFromStore) needs to enumerate them. Keeping it a free function over the same [blockStatePrefix] the store writes under means the prefix stays defined exactly once, and no mock/interface churn is imposed on callers that will never scan.
Records that fail to decode are SKIPPED, not fatal: a rebuild must extract every usable wrapper from a store that may be partially damaged — that is the whole point of running it. Only an iterator-level error aborts the scan.
Types
BlockState
func NewBlockState(db database.Database) BlockStatefunc NewMeteredBlockState(db database.Database, namespace string, metrics metric.Registerer) (BlockState, error)ChainState
func NewChainState(db database.Database) ChainStateHeightIndex
HeightIndex contains mapping of blockHeights to accepted proposer block IDs along with some metadata (fork height and checkpoint).
func NewHeightIndex(db database.Database, commitable versiondb.Commitable) HeightIndexHeightIndexGetter
HeightIndexWriter
MockState
MockState is a mock of State interface.
func NewMockState(ctrl *gomock.Controller) *MockStatefunc (m *MockState) Commit() errorfunc (m *MockState) DeleteBlock(arg0 ids.ID) errorfunc (m *MockState) DeleteBlockIDAtHeight(arg0 uint64) errorfunc (m *MockState) DeleteCheckpoint() errorfunc (m *MockState) DeleteLastAccepted() errorfunc (m *MockState) EXPECT() *MockStateMockRecorderfunc (m *MockState) GetBlock(arg0 ids.ID) (block.Block, choices.Status, error)func (m *MockState) GetBlockIDAtHeight(arg0 uint64) (ids.ID, error)func (m *MockState) GetCheckpoint() (ids.ID, error)func (m *MockState) GetForkHeight() (uint64, error)func (m *MockState) GetLastAccepted() (ids.ID, error)func (m *MockState) GetMinimumHeight() (uint64, error)func (m *MockState) PutBlock(arg0 block.Block, arg1 choices.Status) errorfunc (m *MockState) SetBlockIDAtHeight(arg0 uint64, arg1 ids.ID) errorfunc (m *MockState) SetCheckpoint(arg0 ids.ID) errorfunc (m *MockState) SetForkHeight(arg0 uint64) errorfunc (m *MockState) SetLastAccepted(arg0 ids.ID) errorMockStateMockRecorder
MockStateMockRecorder is the mock recorder for MockState.
func (mr *MockStateMockRecorder) Commit() *gomock.Callfunc (mr *MockStateMockRecorder) DeleteBlock(arg0 any) *gomock.Callfunc (mr *MockStateMockRecorder) DeleteBlockIDAtHeight(arg0 any) *gomock.Callfunc (mr *MockStateMockRecorder) DeleteCheckpoint() *gomock.Callfunc (mr *MockStateMockRecorder) DeleteLastAccepted() *gomock.Callfunc (mr *MockStateMockRecorder) GetBlock(arg0 any) *gomock.Callfunc (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 any) *gomock.Callfunc (mr *MockStateMockRecorder) GetCheckpoint() *gomock.Callfunc (mr *MockStateMockRecorder) GetForkHeight() *gomock.Callfunc (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Callfunc (mr *MockStateMockRecorder) GetMinimumHeight() *gomock.Callfunc (mr *MockStateMockRecorder) PutBlock(arg0, arg1 any) *gomock.Callfunc (mr *MockStateMockRecorder) SetBlockIDAtHeight(arg0, arg1 any) *gomock.Callfunc (mr *MockStateMockRecorder) SetCheckpoint(arg0 any) *gomock.Callfunc (mr *MockStateMockRecorder) SetForkHeight(arg0 any) *gomock.Callfunc (mr *MockStateMockRecorder) SetLastAccepted(arg0 any) *gomock.CallState
func New(db *versiondb.Database) Statefunc NewMetered(db *versiondb.Database, namespace string, metrics metric.Registerer) (State, error)