Documentation
¶
Index ¶
- Variables
- type Checkpoint
- type CheckpointStore
- type MockForcedInclusionRetriever
- type MockForcedInclusionRetriever_Expecter
- type MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
- func (_c *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) Return(v *block.ForcedInclusionEvent, err error) *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
- func (_c *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) Run(run func(ctx context.Context, daHeight uint64)) *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
- func (_c *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) RunAndReturn(...) *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
- type MockForcedInclusionRetriever_Stop_Call
- func (_c *MockForcedInclusionRetriever_Stop_Call) Return() *MockForcedInclusionRetriever_Stop_Call
- func (_c *MockForcedInclusionRetriever_Stop_Call) Run(run func()) *MockForcedInclusionRetriever_Stop_Call
- func (_c *MockForcedInclusionRetriever_Stop_Call) RunAndReturn(run func()) *MockForcedInclusionRetriever_Stop_Call
Constants ¶
This section is empty.
Variables ¶
var ErrCheckpointNotFound = errors.New("checkpoint not found")
ErrCheckpointNotFound is returned when no checkpoint exists in the datastore
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
// DAHeight is the DA block height we're currently processing or have just finished
DAHeight uint64
// TxIndex is the index of the next transaction to process within the DA block's forced inclusion batch
// If TxIndex == 0, it means we've finished processing the previous DA block and should fetch the next one
TxIndex uint64
}
Checkpoint tracks the position in the DA where we last processed transactions
type CheckpointStore ¶
type CheckpointStore struct {
// contains filtered or unexported fields
}
CheckpointStore manages persistence of the checkpoint
func NewCheckpointStore ¶
func NewCheckpointStore(db ds.Batching, checkpointkey ds.Key) *CheckpointStore
NewCheckpointStore creates a new checkpoint store
func (*CheckpointStore) Delete ¶
func (cs *CheckpointStore) Delete(ctx context.Context) error
Delete removes the checkpoint from the datastore
func (*CheckpointStore) Load ¶
func (cs *CheckpointStore) Load(ctx context.Context) (*Checkpoint, error)
Load loads the checkpoint from the datastore Returns ErrCheckpointNotFound if no checkpoint exists
func (*CheckpointStore) Save ¶
func (cs *CheckpointStore) Save(ctx context.Context, checkpoint *Checkpoint) error
Save persists the checkpoint to the datastore
type MockForcedInclusionRetriever ¶
MockForcedInclusionRetriever is an autogenerated mock type for the ForcedInclusionRetriever type
func NewMockForcedInclusionRetriever ¶
func NewMockForcedInclusionRetriever(t interface {
mock.TestingT
Cleanup(func())
}) *MockForcedInclusionRetriever
NewMockForcedInclusionRetriever creates a new instance of MockForcedInclusionRetriever. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockForcedInclusionRetriever) EXPECT ¶
func (_m *MockForcedInclusionRetriever) EXPECT() *MockForcedInclusionRetriever_Expecter
func (*MockForcedInclusionRetriever) RetrieveForcedIncludedTxs ¶
func (_mock *MockForcedInclusionRetriever) RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*block.ForcedInclusionEvent, error)
RetrieveForcedIncludedTxs provides a mock function for the type MockForcedInclusionRetriever
func (*MockForcedInclusionRetriever) Stop ¶
func (_mock *MockForcedInclusionRetriever) Stop()
Stop provides a mock function for the type MockForcedInclusionRetriever
type MockForcedInclusionRetriever_Expecter ¶
type MockForcedInclusionRetriever_Expecter struct {
// contains filtered or unexported fields
}
func (*MockForcedInclusionRetriever_Expecter) RetrieveForcedIncludedTxs ¶
func (_e *MockForcedInclusionRetriever_Expecter) RetrieveForcedIncludedTxs(ctx interface{}, daHeight interface{}) *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
RetrieveForcedIncludedTxs is a helper method to define mock.On call
- ctx context.Context
- daHeight uint64
func (*MockForcedInclusionRetriever_Expecter) Stop ¶
func (_e *MockForcedInclusionRetriever_Expecter) Stop() *MockForcedInclusionRetriever_Stop_Call
Stop is a helper method to define mock.On call
type MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call ¶
MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveForcedIncludedTxs'
func (*MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) Run ¶
func (_c *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) Run(run func(ctx context.Context, daHeight uint64)) *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
func (*MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) RunAndReturn ¶
func (_c *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) RunAndReturn(run func(ctx context.Context, daHeight uint64) (*block.ForcedInclusionEvent, error)) *MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call
type MockForcedInclusionRetriever_Stop_Call ¶
MockForcedInclusionRetriever_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
func (*MockForcedInclusionRetriever_Stop_Call) Return ¶
func (_c *MockForcedInclusionRetriever_Stop_Call) Return() *MockForcedInclusionRetriever_Stop_Call
func (*MockForcedInclusionRetriever_Stop_Call) Run ¶
func (_c *MockForcedInclusionRetriever_Stop_Call) Run(run func()) *MockForcedInclusionRetriever_Stop_Call
func (*MockForcedInclusionRetriever_Stop_Call) RunAndReturn ¶
func (_c *MockForcedInclusionRetriever_Stop_Call) RunAndReturn(run func()) *MockForcedInclusionRetriever_Stop_Call