Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Jun 27, 2024
1 parent 4b88424 commit 734d185
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blob/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (s *Service) GetAll(ctx context.Context, height uint64, namespaces []share.
blobs, err := s.getBlobs(ctx, namespace, header)
switch {
case err == nil:
log.Debugw("receiving blobs", "height", height, "total", len(blobs))
log.Infow("retrieved blobs", "height", height, "total", len(blobs))
resultBlobs[i] = blobs
case errors.Is(err, ErrBlobNotFound):
default:
Expand Down
11 changes: 7 additions & 4 deletions blob/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import (
tmrand "github.com/tendermint/tendermint/libs/rand"

"github.com/celestiaorg/celestia-app/pkg/appconsts"
appns "github.com/celestiaorg/celestia-app/pkg/namespace"
"github.com/celestiaorg/celestia-app/pkg/shares"
"github.com/celestiaorg/go-header/store"


"github.com/celestiaorg/celestia-node/blob/blobtest"
"github.com/celestiaorg/celestia-node/header"
"github.com/celestiaorg/celestia-node/header/headertest"
Expand Down Expand Up @@ -294,9 +296,9 @@ func TestBlobService_Get(t *testing.T) {
},
},
{
name: "empty result and err when blobs wer not found ",
name: "empty result and err when blobs were not found ",
doFn: func() (interface{}, error) {
nid, err := share.NewBlobNamespaceV0(tmrand.Bytes(7))
nid, err := share.NewBlobNamespaceV0(tmrand.Bytes(appns.NamespaceVersionZeroIDSize))
require.NoError(t, err)
return service.GetAll(ctx, 1, []share.Namespace{nid})
},
Expand Down Expand Up @@ -523,8 +525,9 @@ func TestAllPaddingSharesInEDS(t *testing.T) {
}

service := NewService(nil, getters.NewIPLDGetter(bs), fn)
_, err = service.GetAll(ctx, 1, []share.Namespace{nid})
require.Error(t, err)
newBlobs, err := service.GetAll(ctx, 1, []share.Namespace{nid})
require.NoError(t, err)
assert.Empty(t, newBlobs)
}

func TestSkipPaddingsAndRetrieveBlob(t *testing.T) {
Expand Down
10 changes: 9 additions & 1 deletion nodebuilder/blob/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ type Module interface {
Submit(_ context.Context, _ []*blob.Blob, _ blob.GasPrice) (height uint64, _ error)
// Get retrieves the blob by commitment under the given namespace and height.
Get(_ context.Context, height uint64, _ share.Namespace, _ blob.Commitment) (*blob.Blob, error)
// GetAll returns all blobs at the given height under the given namespaces.
// GetAll returns all blobs under the given namespaces at the given height.
// If all blobs were found without any errors, the user will receive a list of blobs.
// If the BlobService couldn't find any blobs under the requested namespaces,
// the user will receive an empty list of blobs along with an empty error.
// If some of the requested namespaces were not found, the user will receive all the found blobs and an empty error.
// If there were internal errors during some of the requests,
// the user will receive all found blobs along with a combined error message.
//
// All blobs will preserve the order of the namespaces that were requested.
GetAll(_ context.Context, height uint64, _ []share.Namespace) ([]*blob.Blob, error)
// GetProof retrieves proofs in the given namespaces at the given height by commitment.
GetProof(_ context.Context, height uint64, _ share.Namespace, _ blob.Commitment) (*blob.Proof, error)
Expand Down

0 comments on commit 734d185

Please sign in to comment.