Skip to content

Commit

Permalink
chore: rename txLen to unitLen (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp authored Sep 29, 2022
1 parent ee4ab3b commit 1707316
Showing 1 changed file with 9 additions and 6 deletions.
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

0 comments on commit 1707316

Please sign in to comment.