Skip to content

Commit

Permalink
consistent share naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Jun 26, 2023
1 parent 2282bd2 commit cedb940
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions blob/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ func SharesToBlobs(rawShares []share.Share) ([]*Blob, error) {
}

appShares := make([]shares.Share, 0, len(rawShares))
for _, sh := range rawShares {
bShare, err := shares.NewShare(sh)
for _, shr := range rawShares {
bShare, err := shares.NewShare(shr)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions blob/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (s *Service) getByCommitment(
// reconstruct the `blobShare` from the first rawShare in range
// in order to get blob's length(first share will contain this info)
if blobShare == nil {
for i, sh := range rawShares {
bShare, err := shares.NewShare(sh)
for i, shr := range rawShares {
bShare, err := shares.NewShare(shr)
if err != nil {
return nil, nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions share/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func (ns NamespacedShares) Verify(root *Root, namespace Namespace) error {
func (row *NamespacedRow) verify(rowRoot []byte, namespace Namespace) bool {
// construct nmt leaves from shares by prepending namespace
leaves := make([][]byte, 0, len(row.Shares))
for _, sh := range row.Shares {
leaves = append(leaves, append(GetNamespace(sh), sh...))
for _, shr := range row.Shares {
leaves = append(leaves, append(GetNamespace(shr), shr...))
}

// verify namespace
Expand Down
4 changes: 2 additions & 2 deletions share/ipld/get_shares_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ func TestGetSharesWithProofsByNamespace(t *testing.T) {

// construct nodes from shares by prepending namespace
var leaves [][]byte
for _, sh := range rowShares {
leaves = append(leaves, append(share.GetNamespace(sh), sh...))
for _, shr := range rowShares {
leaves = append(leaves, append(share.GetNamespace(shr), shr...))
}

// verify namespace
Expand Down

0 comments on commit cedb940

Please sign in to comment.