diff --git a/extendeddatasquare.go b/extendeddatasquare.go index 3f79f5e..5e6af6c 100644 --- a/extendeddatasquare.go +++ b/extendeddatasquare.go @@ -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. diff --git a/extendeddatasquare_test.go b/extendeddatasquare_test.go index 84c366e..caccadb 100644 --- a/extendeddatasquare_test.go +++ b/extendeddatasquare_test.go @@ -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, @@ -302,7 +305,7 @@ func TestFlattenedEDS(t *testing.T) { zeros, thirteens, fives, eights, } - got := example.FlattenedEDS() + got := example.Flattened() assert.Equal(t, want, got) }