common

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type MockForcedInclusionRetriever struct {
	mock.Mock
}

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 (*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

Stop is a helper method to define mock.On call

type MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call

type MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call struct {
	*mock.Call
}

MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveForcedIncludedTxs'

func (*MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) Return

func (*MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) Run

func (*MockForcedInclusionRetriever_RetrieveForcedIncludedTxs_Call) RunAndReturn

type MockForcedInclusionRetriever_Stop_Call

type MockForcedInclusionRetriever_Stop_Call struct {
	*mock.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 (*MockForcedInclusionRetriever_Stop_Call) Run

func (*MockForcedInclusionRetriever_Stop_Call) RunAndReturn

Jump to

Keyboard shortcuts

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