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

docs: godoc for rebuildShares #183

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all 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
8 changes: 7 additions & 1 deletion extendeddatacrossword.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,19 @@ func (eds *ExtendedDataSquare) solveCrosswordCol(
return true, true, nil
}

// rebuildShares attempts to rebuild a row or column of shares.
// Returns
// 1. An entire row or column of shares so original + parity shares.
// 2. Whether the original shares could be decoded from the shares parameter.
// 3. [Optional] an error.
func (eds *ExtendedDataSquare) rebuildShares(
isExtendedPartIncomplete bool,
shares [][]byte,
) ([][]byte, bool, error) {
rebuiltShares, err := eds.codec.Decode(shares)
if err != nil {
// repair unsuccessful
// Decode was unsuccessful but don't propagate the error because that
// would halt the progress of solveCrosswordRow or solveCrosswordCol.
return nil, false, nil
}

Expand Down