Skip to content

Commit

Permalink
fix: correct typos in test function names and variables in nmt_wrappe…
Browse files Browse the repository at this point in the history
…r_test.go (#4207)

- Renamed `TestErasureNamespacedMerkleTreePushErrors` to
`TestErasuredNamespacedMerkleTreePushErrors` for consistency.
- Fixed variable name `sqaureSize` to `squareSize`.

These changes enhance code readability and maintainability.
  • Loading branch information
tiendn authored Jan 13, 2025
1 parent 67c5501 commit bf4c4bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/wrapper/nmt_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestErasuredNamespacedMerkleTreeEmptyRoot(t *testing.T) {
assert.True(t, bytes.Equal(r1, r2))
}

func TestErasureNamespacedMerkleTreePushErrors(t *testing.T) {
func TestErasuredNamespacedMerkleTreePushErrors(t *testing.T) {
squareSize := 16

dataOverSquareSize := generateErasuredData(t, squareSize+1, appconsts.DefaultCodec())
Expand Down Expand Up @@ -150,9 +150,9 @@ func generateErasuredData(t *testing.T, numLeaves int, codec rsmt2d.Codec) [][]b

// TestErasuredNamespacedMerkleTree_ProveRange checks that the proof returned by the ProveRange for all the shares within the erasured data is non-empty.
func TestErasuredNamespacedMerkleTree_ProveRange(t *testing.T) {
for sqaureSize := 1; sqaureSize <= 16; sqaureSize++ {
tree := wrapper.NewErasuredNamespacedMerkleTree(uint64(sqaureSize), 0, nmt.IgnoreMaxNamespace(true))
data := generateErasuredData(t, sqaureSize, appconsts.DefaultCodec())
for squareSize := 1; squareSize <= 16; squareSize++ {
tree := wrapper.NewErasuredNamespacedMerkleTree(uint64(squareSize), 0, nmt.IgnoreMaxNamespace(true))
data := generateErasuredData(t, squareSize, appconsts.DefaultCodec())
for _, d := range data {
err := tree.Push(d)
assert.NoError(t, err)
Expand All @@ -168,7 +168,7 @@ func TestErasuredNamespacedMerkleTree_ProveRange(t *testing.T) {
assert.False(t, proof.IsEmptyProof())

var namespaceID nmtnamespace.ID
if i < sqaureSize {
if i < squareSize {
namespaceID = data[i][:share.NamespaceSize]
} else {
namespaceID = share.ParitySharesNamespace.Bytes()
Expand Down

0 comments on commit bf4c4bc

Please sign in to comment.