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: rename txLen to unitLen #814

Merged
merged 1 commit into from
Sep 29, 2022
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
15 changes: 9 additions & 6 deletions pkg/shares/parse_compact_shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,22 @@ func (ss *shareStack) resolve() ([][]byte, error) {
return ss.data, err
}

// peel recursively parses each chunk of data (either a transaction,
// intermediate state root, or evidence) and adds it to the underlying slice of data.
// peel recursively parses each unit of data (either a transaction, intermediate
// state root, or evidence) and adds it to the underlying slice of data.
// delimited should be `true` if this is the start of the next unit of data (in
// other words the data contains a unitLen delimiter prefixed to the unit).
// delimited should be `false` if calling peel on an in-progress unit.
func (ss *shareStack) peel(share []byte, delimited bool) (err error) {
if delimited {
var txLen uint64
share, txLen, err = ParseDelimiter(share)
var unitLen uint64
share, unitLen, err = ParseDelimiter(share)
if err != nil {
return err
}
if txLen == 0 {
if unitLen == 0 {
return nil
}
ss.dataLen = txLen
ss.dataLen = unitLen
}
// safeLen describes the point in the share where it can be safely split. If
// split beyond this point, it is possible to break apart a length
Expand Down