From cedb94041280ab9e9be3414f450d8589c0b2d04a Mon Sep 17 00:00:00 2001 From: Wondertan Date: Mon, 26 Jun 2023 13:54:41 +0200 Subject: [PATCH] consistent share naming --- blob/helper.go | 4 ++-- blob/service.go | 4 ++-- share/getter.go | 4 ++-- share/ipld/get_shares_test.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/blob/helper.go b/blob/helper.go index 1fef41dc22..341080f42f 100644 --- a/blob/helper.go +++ b/blob/helper.go @@ -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 } diff --git a/blob/service.go b/blob/service.go index b2181917db..960f8c6c01 100644 --- a/blob/service.go +++ b/blob/service.go @@ -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 } diff --git a/share/getter.go b/share/getter.go index 689dda85c3..7caa954a24 100644 --- a/share/getter.go +++ b/share/getter.go @@ -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 diff --git a/share/ipld/get_shares_test.go b/share/ipld/get_shares_test.go index 2fe197ffff..cd26f759b3 100644 --- a/share/ipld/get_shares_test.go +++ b/share/ipld/get_shares_test.go @@ -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