Documentation ¶
Overview ¶
Package state is a generated GoMock package.
Index ¶
- type BlockState
- type ChainState
- type HeightIndex
- type HeightIndexBatchSupport
- type HeightIndexGetter
- type HeightIndexWriter
- type MockState
- func (m *MockState) Commit() error
- func (m *MockState) DeleteCheckpoint() error
- func (m *MockState) DeleteLastAccepted() error
- func (m *MockState) EXPECT() *MockStateMockRecorder
- func (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) HasIndexReset() (bool, error)
- func (m *MockState) IsIndexEmpty() (bool, error)
- func (m *MockState) PutBlock(arg0 block.Block, arg1 choices.Status) error
- func (m *MockState) ResetHeightIndex(arg0 logging.Logger, arg1 versiondb.Commitable) error
- func (m *MockState) SetBlockIDAtHeight(arg0 uint64, arg1 ids.ID) error
- func (m *MockState) SetCheckpoint(arg0 ids.ID) error
- func (m *MockState) SetForkHeight(arg0 uint64) error
- func (m *MockState) SetIndexHasReset() error
- func (m *MockState) SetLastAccepted(arg0 ids.ID) error
- type MockStateMockRecorder
- func (mr *MockStateMockRecorder) Commit() *gomock.Call
- func (mr *MockStateMockRecorder) DeleteCheckpoint() *gomock.Call
- func (mr *MockStateMockRecorder) DeleteLastAccepted() *gomock.Call
- func (mr *MockStateMockRecorder) GetBlock(arg0 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetCheckpoint() *gomock.Call
- func (mr *MockStateMockRecorder) GetForkHeight() *gomock.Call
- func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call
- func (mr *MockStateMockRecorder) HasIndexReset() *gomock.Call
- func (mr *MockStateMockRecorder) IsIndexEmpty() *gomock.Call
- func (mr *MockStateMockRecorder) PutBlock(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) ResetHeightIndex(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetBlockIDAtHeight(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetCheckpoint(arg0 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetForkHeight(arg0 interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetIndexHasReset() *gomock.Call
- func (mr *MockStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockState ¶
type BlockState interface { GetBlock(blkID ids.ID) (block.Block, choices.Status, error) PutBlock(blk block.Block, status choices.Status) error }
func NewBlockState ¶
func NewBlockState(db database.Database) BlockState
func NewMeteredBlockState ¶
func NewMeteredBlockState(db database.Database, namespace string, metrics prometheus.Registerer) (BlockState, error)
type ChainState ¶
type ChainState interface { SetLastAccepted(blkID ids.ID) error DeleteLastAccepted() error GetLastAccepted() (ids.ID, error) }
func NewChainState ¶
func NewChainState(db database.Database) ChainState
type HeightIndex ¶ added in v1.7.5
type HeightIndex interface { HeightIndexWriter HeightIndexGetter HeightIndexBatchSupport // ResetHeightIndex deletes all index DB entries ResetHeightIndex(logging.Logger, versiondb.Commitable) error }
HeightIndex contains mapping of blockHeights to accepted proposer block IDs along with some metadata (fork height and checkpoint).
func NewHeightIndex ¶ added in v1.7.5
func NewHeightIndex(db database.Database, commitable versiondb.Commitable) HeightIndex
type HeightIndexBatchSupport ¶ added in v1.7.5
type HeightIndexBatchSupport interface { versiondb.Commitable GetCheckpoint() (ids.ID, error) SetCheckpoint(blkID ids.ID) error DeleteCheckpoint() error }
A checkpoint is the blockID of the next block to be considered for height indexing. We store checkpoints to be able to duly resume long-running re-indexing ops.
type HeightIndexGetter ¶ added in v1.7.5
type HeightIndexWriter ¶ added in v1.7.5
type MockState ¶ added in v1.8.3
type MockState struct {
// contains filtered or unexported fields
}
MockState is a mock of State interface.
func NewMockState ¶ added in v1.8.3
func NewMockState(ctrl *gomock.Controller) *MockState
NewMockState creates a new mock instance.
func (*MockState) DeleteCheckpoint ¶ added in v1.8.3
DeleteCheckpoint mocks base method.
func (*MockState) DeleteLastAccepted ¶ added in v1.8.3
DeleteLastAccepted mocks base method.
func (*MockState) EXPECT ¶ added in v1.8.3
func (m *MockState) EXPECT() *MockStateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockState) GetBlockIDAtHeight ¶ added in v1.8.3
GetBlockIDAtHeight mocks base method.
func (*MockState) GetCheckpoint ¶ added in v1.8.3
GetCheckpoint mocks base method.
func (*MockState) GetForkHeight ¶ added in v1.8.3
GetForkHeight mocks base method.
func (*MockState) GetLastAccepted ¶ added in v1.8.3
GetLastAccepted mocks base method.
func (*MockState) HasIndexReset ¶ added in v1.8.3
HasIndexReset mocks base method.
func (*MockState) IsIndexEmpty ¶ added in v1.8.3
IsIndexEmpty mocks base method.
func (*MockState) ResetHeightIndex ¶ added in v1.8.3
ResetHeightIndex mocks base method.
func (*MockState) SetBlockIDAtHeight ¶ added in v1.8.3
SetBlockIDAtHeight mocks base method.
func (*MockState) SetCheckpoint ¶ added in v1.8.3
SetCheckpoint mocks base method.
func (*MockState) SetForkHeight ¶ added in v1.8.3
SetForkHeight mocks base method.
func (*MockState) SetIndexHasReset ¶ added in v1.8.3
SetIndexHasReset mocks base method.
type MockStateMockRecorder ¶ added in v1.8.3
type MockStateMockRecorder struct {
// contains filtered or unexported fields
}
MockStateMockRecorder is the mock recorder for MockState.
func (*MockStateMockRecorder) Commit ¶ added in v1.8.3
func (mr *MockStateMockRecorder) Commit() *gomock.Call
Commit indicates an expected call of Commit.
func (*MockStateMockRecorder) DeleteCheckpoint ¶ added in v1.8.3
func (mr *MockStateMockRecorder) DeleteCheckpoint() *gomock.Call
DeleteCheckpoint indicates an expected call of DeleteCheckpoint.
func (*MockStateMockRecorder) DeleteLastAccepted ¶ added in v1.8.3
func (mr *MockStateMockRecorder) DeleteLastAccepted() *gomock.Call
DeleteLastAccepted indicates an expected call of DeleteLastAccepted.
func (*MockStateMockRecorder) GetBlock ¶ added in v1.8.3
func (mr *MockStateMockRecorder) GetBlock(arg0 interface{}) *gomock.Call
GetBlock indicates an expected call of GetBlock.
func (*MockStateMockRecorder) GetBlockIDAtHeight ¶ added in v1.8.3
func (mr *MockStateMockRecorder) GetBlockIDAtHeight(arg0 interface{}) *gomock.Call
GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight.
func (*MockStateMockRecorder) GetCheckpoint ¶ added in v1.8.3
func (mr *MockStateMockRecorder) GetCheckpoint() *gomock.Call
GetCheckpoint indicates an expected call of GetCheckpoint.
func (*MockStateMockRecorder) GetForkHeight ¶ added in v1.8.3
func (mr *MockStateMockRecorder) GetForkHeight() *gomock.Call
GetForkHeight indicates an expected call of GetForkHeight.
func (*MockStateMockRecorder) GetLastAccepted ¶ added in v1.8.3
func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call
GetLastAccepted indicates an expected call of GetLastAccepted.
func (*MockStateMockRecorder) HasIndexReset ¶ added in v1.8.3
func (mr *MockStateMockRecorder) HasIndexReset() *gomock.Call
HasIndexReset indicates an expected call of HasIndexReset.
func (*MockStateMockRecorder) IsIndexEmpty ¶ added in v1.8.3
func (mr *MockStateMockRecorder) IsIndexEmpty() *gomock.Call
IsIndexEmpty indicates an expected call of IsIndexEmpty.
func (*MockStateMockRecorder) PutBlock ¶ added in v1.8.3
func (mr *MockStateMockRecorder) PutBlock(arg0, arg1 interface{}) *gomock.Call
PutBlock indicates an expected call of PutBlock.
func (*MockStateMockRecorder) ResetHeightIndex ¶ added in v1.8.3
func (mr *MockStateMockRecorder) ResetHeightIndex(arg0, arg1 interface{}) *gomock.Call
ResetHeightIndex indicates an expected call of ResetHeightIndex.
func (*MockStateMockRecorder) SetBlockIDAtHeight ¶ added in v1.8.3
func (mr *MockStateMockRecorder) SetBlockIDAtHeight(arg0, arg1 interface{}) *gomock.Call
SetBlockIDAtHeight indicates an expected call of SetBlockIDAtHeight.
func (*MockStateMockRecorder) SetCheckpoint ¶ added in v1.8.3
func (mr *MockStateMockRecorder) SetCheckpoint(arg0 interface{}) *gomock.Call
SetCheckpoint indicates an expected call of SetCheckpoint.
func (*MockStateMockRecorder) SetForkHeight ¶ added in v1.8.3
func (mr *MockStateMockRecorder) SetForkHeight(arg0 interface{}) *gomock.Call
SetForkHeight indicates an expected call of SetForkHeight.
func (*MockStateMockRecorder) SetIndexHasReset ¶ added in v1.8.3
func (mr *MockStateMockRecorder) SetIndexHasReset() *gomock.Call
SetIndexHasReset indicates an expected call of SetIndexHasReset.
func (*MockStateMockRecorder) SetLastAccepted ¶ added in v1.8.3
func (mr *MockStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call
SetLastAccepted indicates an expected call of SetLastAccepted.
type State ¶
type State interface { ChainState BlockState HeightIndex }
func NewMetered ¶
func NewMetered(db *versiondb.Database, namespace string, metrics prometheus.Registerer) (State, error)