Documentation
¶
Overview ¶
Package testda provides test implementations of the DA client interface.
Index ¶
- Constants
- type DummyDA
- func (d *DummyDA) Get(_ context.Context, _ []datypes.ID, _ []byte) ([]datypes.Blob, error)
- func (d *DummyDA) GetDataNamespace() []byte
- func (d *DummyDA) GetForcedInclusionNamespace() []byte
- func (d *DummyDA) GetHeaderByHeight(_ context.Context, height uint64) (*Header, error)
- func (d *DummyDA) GetHeaderNamespace() []byte
- func (d *DummyDA) GetProofs(_ context.Context, _ []datypes.ID, _ []byte) ([]datypes.Proof, error)
- func (d *DummyDA) HasForcedInclusionNamespace() bool
- func (d *DummyDA) Height() uint64
- func (d *DummyDA) Reset()
- func (d *DummyDA) Retrieve(_ context.Context, height uint64, namespace []byte) datypes.ResultRetrieve
- func (d *DummyDA) SetHeight(h uint64)
- func (d *DummyDA) SetSubmitFailure(shouldFail bool)
- func (d *DummyDA) StartHeightTicker(interval time.Duration) func()
- func (d *DummyDA) Submit(_ context.Context, data [][]byte, _ float64, namespace []byte, _ []byte) datypes.ResultSubmit
- func (d *DummyDA) Validate(_ context.Context, ids []datypes.ID, _ []datypes.Proof, _ []byte) ([]bool, error)
- type Header
- type Option
Constants ¶
const (
// DefaultMaxBlobSize is the default maximum blob size (7MB).
DefaultMaxBlobSize = 7 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyDA ¶
type DummyDA struct {
// contains filtered or unexported fields
}
DummyDA is a test implementation of the DA client interface. It supports blob storage, height simulation, failure injection, and header retrieval.
func (*DummyDA) GetDataNamespace ¶
GetDataNamespace returns the data namespace.
func (*DummyDA) GetForcedInclusionNamespace ¶
GetForcedInclusionNamespace returns the forced inclusion namespace.
func (*DummyDA) GetHeaderByHeight ¶
GetHeaderByHeight retrieves the header for the given DA height. This mirrors the HeaderAPI.GetByHeight method from the real DA client. Returns nil if no header exists for the given height.
func (*DummyDA) GetHeaderNamespace ¶
GetHeaderNamespace returns the header namespace.
func (*DummyDA) HasForcedInclusionNamespace ¶
HasForcedInclusionNamespace reports whether forced inclusion is configured.
func (*DummyDA) Reset ¶
func (d *DummyDA) Reset()
Reset clears all stored blobs, headers, and resets the height.
func (*DummyDA) Retrieve ¶
func (d *DummyDA) Retrieve(_ context.Context, height uint64, namespace []byte) datypes.ResultRetrieve
Retrieve returns blobs stored at the given height and namespace.
func (*DummyDA) SetSubmitFailure ¶
SetSubmitFailure controls whether Submit should return errors.
func (*DummyDA) StartHeightTicker ¶
StartHeightTicker starts a goroutine that increments the height every interval. It returns a function to stop the ticker.