Skip to content

Commit

Permalink
chore: enhance clarity in comment for function name (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 authored Jan 22, 2024
1 parent fd78256 commit ad044a7
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion blob/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ProtoBlobTxTypeID = "BLOB"
// decoding binaries that are not actually IndexWrappers.
const ProtoIndexWrapperTypeID = "INDX"

// NewBlob creates a new coretypes.Blob from the provided data after performing
// New creates a new coretypes.Blob from the provided data after performing
// basic stateless checks over it.
func New(ns namespace.Namespace, blob []byte, shareVersion uint8) *Blob {
return &Blob{
Expand Down Expand Up @@ -104,6 +104,7 @@ func Sort(blobs []*Blob) {
})
}

// UnmarshalIndexWrapper attempts to unmarshal the provided transaction into an
// IndexWrapper transaction. It returns true if the provided transaction is an
// IndexWrapper transaction. An IndexWrapper transaction is a transaction that contains
// a MsgPayForBlob that has been wrapped with a share index.
Expand Down
2 changes: 1 addition & 1 deletion go.work.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
2 changes: 1 addition & 1 deletion merkle/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (sp *Proof) Verify(rootHash []byte, leaf []byte) error {
return nil
}

// Compute the root hash given a leaf hash. Panics in case of errors.
// ComputeRootHash the root hash given a leaf hash. Panics in case of errors.
func (sp *Proof) ComputeRootHash() []byte {
computedHash, err := sp.computeRootHash()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion merkle/proof_key_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (pth KeyPath) String() string {
return res
}

// Decode a path to a list of keys. Path must begin with `/`.
// KeyPathToKeys Decode a path to a list of keys. Path must begin with `/`.
// Each key must use a known encoding.
func KeyPathToKeys(path string) (keys [][]byte, err error) {
if path == "" || path[0] != '/' {
Expand Down
2 changes: 1 addition & 1 deletion merkle/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func HashFromByteSlices(items [][]byte) []byte {
}
}

// HashFromByteSliceIterative is an iterative alternative to
// HashFromByteSlicesIterative is an iterative alternative to
// HashFromByteSlice motivated by potential performance improvements.
// (#2611) had suggested that an iterative version of
// HashFromByteSlice would be faster, presumably because
Expand Down
4 changes: 2 additions & 2 deletions namespace/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

const (
// NamespaveVersionSize is the size of a namespace version in bytes.
// NamespaceVersionSize is the size of a namespace version in bytes.
NamespaceVersionSize = 1

// NamespaceIDSize is the size of a namespace ID in bytes.
Expand All @@ -21,7 +21,7 @@ const (
// NamespaceVersionMax is the max namespace version.
NamespaceVersionMax = math.MaxUint8

// NamespaceZeroPrefixSize is the number of `0` bytes that are prefixed to
// NamespaceVersionZeroPrefixSize is the number of `0` bytes that are prefixed to
// namespace IDs for version 0.
NamespaceVersionZeroPrefixSize = 18

Expand Down
2 changes: 1 addition & 1 deletion shares/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
// MinSquareSize is the smallest original square width.
MinSquareSize = 1

// MinshareCount is the minimum number of shares allowed in the original
// MinShareCount is the minimum number of shares allowed in the original
// data square.
MinShareCount = MinSquareSize * MinSquareSize

Expand Down
2 changes: 1 addition & 1 deletion shares/padding.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func ReservedPaddingShare() Share {
return share
}

// ReservedPaddingShare returns n reserved padding shares.
// ReservedPaddingShares returns n reserved padding shares.
func ReservedPaddingShares(n int) []Share {
shares, err := NamespacePaddingShares(namespace.PrimaryReservedPaddingNamespace, ShareVersionZero, n)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion shares/powers_of_two.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func RoundDownPowerOfTwo[I constraints.Integer](input I) (I, error) {
return roundedUp / 2, nil
}

// RoundUpPowerOfTwo returns the next power of two that is strictly greater than input.
// RoundUpPowerOfTwoStrict returns the next power of two that is strictly greater than input.
func RoundUpPowerOfTwoStrict[I constraints.Integer](input I) I {
result := RoundUpPowerOfTwo(input)

Expand Down
2 changes: 1 addition & 1 deletion shares/share_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (b *Builder) MaybeWriteReservedBytes() error {
return nil
}

// writeSequenceLen writes the sequence length to the first share.
// WriteSequenceLen writes the sequence length to the first share.
func (b *Builder) WriteSequenceLen(sequenceLen uint32) error {
if b == nil {
return errors.New("the builder object is not initialized (is nil)")
Expand Down
2 changes: 1 addition & 1 deletion shares/shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s *Share) rawDataStartIndex() int {
return index
}

// RawDataWithReserved returns the raw share data while taking reserved bytes into account.
// RawDataUsingReserved returns the raw share data while taking reserved bytes into account.
func (s *Share) RawDataUsingReserved() (rawData []byte, err error) {
rawDataStartIndexUsingReserved, err := s.rawDataStartIndexUsingReserved()
if err != nil {
Expand Down

0 comments on commit ad044a7

Please sign in to comment.