diff --git a/datasquare.go b/datasquare.go index b321385..0c16f59 100644 --- a/datasquare.go +++ b/datasquare.go @@ -64,7 +64,7 @@ func newDataSquare(data [][]byte, treeCreator TreeConstructorFn, chunkSize uint) squareRow: squareRow, squareCol: squareCol, width: uint(width), - chunkSize: uint(chunkSize), + chunkSize: chunkSize, createTreeFn: treeCreator, }, nil } diff --git a/extendeddatasquare.go b/extendeddatasquare.go index f684020..d076dd1 100644 --- a/extendeddatasquare.go +++ b/extendeddatasquare.go @@ -57,7 +57,7 @@ func ComputeExtendedDataSquare( } chunkSize := getChunkSize(data) - err := codec.ValidateChunkSize(int(chunkSize)) + err := codec.ValidateChunkSize(chunkSize) if err != nil { return nil, err } @@ -86,7 +86,7 @@ func ImportExtendedDataSquare( } chunkSize := getChunkSize(data) - err := codec.ValidateChunkSize(int(chunkSize)) + err := codec.ValidateChunkSize(chunkSize) if err != nil { return nil, err } diff --git a/extendeddatasquare_test.go b/extendeddatasquare_test.go index 2cad1b2..057e78f 100644 --- a/extendeddatasquare_test.go +++ b/extendeddatasquare_test.go @@ -151,7 +151,7 @@ func TestNewExtendedDataSquare(t *testing.T) { got, err := NewExtendedDataSquare(NewLeoRSCodec(), NewDefaultTree, edsWidth, shareSize) assert.NoError(t, err) - chunk := bytes.Repeat([]byte{1}, int(incorrectChunkSize)) + chunk := bytes.Repeat([]byte{1}, incorrectChunkSize) err = got.SetCell(0, 0, chunk) assert.Error(t, err) })