Skip to content

Commit

Permalink
chore(share): remove unused ShareWithProof (#3893)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Oct 28, 2024
1 parent 097fcab commit f5d9d3a
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions share/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package share

import (
"github.com/celestiaorg/celestia-app/v3/pkg/appconsts"
libshare "github.com/celestiaorg/go-square/v2/share"
"github.com/celestiaorg/nmt"
"github.com/celestiaorg/rsmt2d"
)

// DefaultRSMT2DCodec sets the default rsmt2d.Codec for shares.
Expand All @@ -13,28 +10,3 @@ var DefaultRSMT2DCodec = appconsts.DefaultCodec
// MaxSquareSize is currently the maximum size supported for unerasured data in
// rsmt2d.ExtendedDataSquare.
var MaxSquareSize = appconsts.SquareSizeUpperBound(appconsts.LatestVersion)

// ShareWithProof contains data with corresponding Merkle Proof
type ShareWithProof struct { //nolint: revive
// Share is a full data including namespace
libshare.Share
// Proof is a Merkle Proof of current share
Proof *nmt.Proof
// Axis is a type of axis against which the share proof is computed
Axis rsmt2d.Axis
}

// Validate validates inclusion of the share under the given root CID.
func (s *ShareWithProof) Validate(rootHash []byte, x, y, edsSize int) bool {
isParity := x >= edsSize/2 || y >= edsSize/2
namespace := libshare.ParitySharesNamespace
if !isParity {
namespace = s.Share.Namespace()
}
return s.Proof.VerifyInclusion(
NewSHA256Hasher(),
namespace.Bytes(),
[][]byte{s.Share.ToBytes()},
rootHash,
)
}

0 comments on commit f5d9d3a

Please sign in to comment.