test

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMaxBlobSize = 64 * 64 * 482

DefaultMaxBlobSize is the default max blob size

Variables

This section is empty.

Functions

func BasicDATest

func BasicDATest(t *testing.T, d da.DA)

BasicDATest tests round trip of messages to DA and back.

func CheckErrors

func CheckErrors(t *testing.T, d da.DA)

CheckErrors ensures that errors are handled properly by DA.

func ConcurrentReadWriteTest

func ConcurrentReadWriteTest(t *testing.T, d da.DA)

ConcurrentReadWriteTest tests the use of mutex lock in DummyDA by calling separate methods that use `d.data` and making sure there's no race conditions

func GetIDsTest

func GetIDsTest(t *testing.T, d da.DA)

GetIDsTest tests iteration over DA

func HeightFromFutureTest added in v0.5.2

func HeightFromFutureTest(t *testing.T, d da.DA)

HeightFromFutureTest tests the case when the given height is from the future

func RunDATestSuite

func RunDATestSuite(t *testing.T, d da.DA)

RunDATestSuite runs all tests against given DA

Types

type DummyDA

type DummyDA struct {
	// contains filtered or unexported fields
}

DummyDA is a simple implementation of in-memory DA. Not production ready! Intended only for testing!

Data is stored in a map, where key is a serialized sequence number. This key is returned as ID. Commitments are simply hashes, and proofs are ED25519 signatures.

func NewDummyDA

func NewDummyDA(opts ...func(*DummyDA) *DummyDA) *DummyDA

NewDummyDA create new instance of DummyDA

func (*DummyDA) Commit

func (d *DummyDA) Commit(ctx context.Context, blobs []da.Blob, _ da.Namespace) ([]da.Commitment, error)

Commit returns cryptographic Commitments for given blobs.

func (*DummyDA) Get

func (d *DummyDA) Get(ctx context.Context, ids []da.ID, _ da.Namespace) ([]da.Blob, error)

Get returns Blobs for given IDs.

func (*DummyDA) GetIDs

func (d *DummyDA) GetIDs(ctx context.Context, height uint64, _ da.Namespace) (*da.GetIDsResult, error)

GetIDs returns IDs of Blobs at given DA height.

func (*DummyDA) GetProofs added in v0.4.0

func (d *DummyDA) GetProofs(ctx context.Context, ids []da.ID, _ da.Namespace) ([]da.Proof, error)

GetProofs returns inclusion Proofs for all Blobs located in DA at given height.

func (*DummyDA) MaxBlobSize

func (d *DummyDA) MaxBlobSize(ctx context.Context) (uint64, error)

MaxBlobSize returns the max blob size in bytes.

func (*DummyDA) Submit

func (d *DummyDA) Submit(ctx context.Context, blobs []da.Blob, gasPrice float64, ns da.Namespace) ([]da.ID, error)

Submit stores blobs in DA layer.

func (*DummyDA) SubmitWithOptions added in v0.6.1

func (d *DummyDA) SubmitWithOptions(ctx context.Context, blobs []da.Blob, gasPrice float64, _ da.Namespace, _ []byte) ([]da.ID, error)

SubmitWithOptions stores blobs in DA layer (options are ignored).

func (*DummyDA) Validate

func (d *DummyDA) Validate(ctx context.Context, ids []da.ID, proofs []da.Proof, _ da.Namespace) ([]bool, error)

Validate checks the Proofs for given IDs.

Jump to

Keyboard shortcuts

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