Skip to content

Commit

Permalink
chore: rename FlattenedEDS to Flattened
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Jul 11, 2023
1 parent b3ddfaa commit 74da9a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions extendeddatasquare.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ func (eds *ExtendedDataSquare) Width() uint {
}

// FlattenedEDS returns the extended data square as a flattened slice of bytes.
func (eds *ExtendedDataSquare) FlattenedEDS() [][]byte {
return eds.Flattened()
func (eds *ExtendedDataSquare) Flattened() [][]byte {
return eds.dataSquare.Flattened()
}

// FlattenedODS returns the original data square as a flattened slice of bytes.
Expand Down
7 changes: 5 additions & 2 deletions extendeddatasquare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ func genRandDS(width int, chunkSize int) [][]byte {
return ds
}

func TestFlattenedEDS(t *testing.T) {
// TestFlattened_EDS tests that eds.Flattened() returns all the shares in the
// EDS. This function has the `_EDS` suffix to avoid a name collision with the
// TestFlattened.
func TestFlattened_EDS(t *testing.T) {
example := createExampleEds(t, shareSize)
want := [][]byte{
ones, twos, zeros, threes,
Expand All @@ -302,7 +305,7 @@ func TestFlattenedEDS(t *testing.T) {
zeros, thirteens, fives, eights,
}

got := example.FlattenedEDS()
got := example.Flattened()
assert.Equal(t, want, got)
}

Expand Down

0 comments on commit 74da9a2

Please sign in to comment.