Skip to content

Commit

Permalink
lint: fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tzdybal committed Oct 11, 2023
1 parent da58c69 commit ed1883b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion da_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package da_test

import (
"bytes"
"github.com/rollkit/go-da/test"
"testing"
"time"

"github.com/rollkit/go-da/test"

"github.com/stretchr/testify/assert"

"github.com/rollkit/go-da"
Expand Down
6 changes: 6 additions & 0 deletions test/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type kvp struct {
key, value []byte
}

// NewDummyDA create new instance of DummyDA
func NewDummyDA() *DummyDA {
da := &DummyDA{
data: make(map[uint64][]kvp),
Expand All @@ -36,6 +37,7 @@ func NewDummyDA() *DummyDA {

var _ da.DA = &DummyDA{}

// Get returns Blobs for given IDs.
func (d *DummyDA) Get(ids []da.ID) ([]da.Blob, error) {
blobs := make([]da.Blob, len(ids))
for i, id := range ids {
Expand All @@ -57,6 +59,7 @@ func (d *DummyDA) Get(ids []da.ID) ([]da.Blob, error) {
return blobs, nil
}

// GetIDs returns IDs of Blobs at given DA height.
func (d *DummyDA) GetIDs(height uint64) ([]da.ID, error) {
kvps := d.data[height]
ids := make([]da.ID, len(kvps))
Expand All @@ -66,6 +69,7 @@ func (d *DummyDA) GetIDs(height uint64) ([]da.ID, error) {
return ids, nil
}

// Commit returns cryptographic Commitments for given blobs.
func (d *DummyDA) Commit(blobs []da.Blob) ([]da.Commitment, error) {
commits := make([]da.Commitment, len(blobs))
for i, blob := range blobs {
Expand All @@ -74,6 +78,7 @@ func (d *DummyDA) Commit(blobs []da.Blob) ([]da.Commitment, error) {
return commits, nil
}

// Submit stores blobs in DA layer.
func (d *DummyDA) Submit(blobs []da.Blob) ([]da.ID, []da.Proof, error) {
ids := make([]da.ID, len(blobs))
proofs := make([]da.Proof, len(blobs))
Expand All @@ -88,6 +93,7 @@ func (d *DummyDA) Submit(blobs []da.Blob) ([]da.ID, []da.Proof, error) {
return ids, proofs, nil
}

// Validate checks the Proofs for given IDs.
func (d *DummyDA) Validate(ids []da.ID, proofs []da.Proof) ([]bool, error) {
if len(ids) != len(proofs) {
return nil, errors.New("number of IDs doesn't equal to number of proofs")
Expand Down

0 comments on commit ed1883b

Please sign in to comment.