Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
vgonkivs and Wondertan committed Oct 13, 2023
1 parent b0ce766 commit 209e1cb
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions blob/service.go
Original file line number Diff line number Diff line change
@@ -197,13 +197,6 @@ func (s *Service) getByCommitment(
return nil, nil, err
}

var (
rawShares = make([]shares.Share, 0)
proofs = make(Proof, 0)
// expanded specifies whether blob is expanded into multiple rows
spansMultipleRows bool
)

namespacedShares, err := s.shareGetter.GetSharesByNamespace(ctx, header, namespace)
if err != nil {
if errors.Is(err, share.ErrNotFound) {
@@ -212,6 +205,13 @@ func (s *Service) getByCommitment(
return nil, nil, err
}

var (
rawShares = make([]shares.Share, 0)
proofs = make(Proof, 0)
// expanded specifies whether blob is expanded into multiple rows
spansMultipleRows bool
)

for _, row := range namespacedShares {
appShares, err := toAppShares(row.Shares...)
if err != nil {
@@ -250,8 +250,7 @@ func (s *Service) getByCommitment(

err = ErrBlobNotFound
if len(rawShares) > 0 {
reportErr := fmt.Errorf("THIS IS A BUG: INCOMPLETE BLOB DETECTED at: %d height", height)
err = errors.Join(err, reportErr)
err = fmt.Errorf("incomplete blob detected at %d: %w", height, err)
log.Error(err)
}
return nil, nil, err

0 comments on commit 209e1cb

Please sign in to comment.