Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: remove MinShareCount constant #2566

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pkg/appconsts/global_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ const (
// MinSquareSize is the smallest original square width.
MinSquareSize = 1

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

// MaxShareVersion is the maximum value a share version can be.
MaxShareVersion = 127

Expand Down
5 changes: 4 additions & 1 deletion pkg/square/square.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ func (s Square) IsEmpty() bool {

// EmptySquare returns a 1x1 square with a single tail padding share
func EmptySquare() Square {
return shares.TailPaddingShares(appconsts.MinShareCount)
// minShareCount is the minimum number of shares allowed in the original
// data square.
minShareCount := appconsts.MinSquareSize*appconsts.MinSquareSize
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Optional Suggestion] If we anticipate that the minimum share count might be utilized beyond the scope of the EmptySquare, it could be advantageous to create a dedicated function, such as MinShareCount().

return shares.TailPaddingShares(minShareCount)
}

func WriteSquare(
Expand Down
Loading