Skip to content

Commit

Permalink
opnode/rollup/derive: batch ReadFull and comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
protolambda committed Mar 16, 2022
1 parent 71ae668 commit 67ca957
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opnode/rollup/derive/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
//
// Note: the type system is based on L1 typed transactions.

// encodeBufferPool holds temporary encoder buffers batch encoding
// encodeBufferPool holds temporary encoder buffers for batch encoding
var encodeBufferPool = sync.Pool{
New: func() interface{} { return new(bytes.Buffer) },
}
Expand Down Expand Up @@ -59,7 +59,7 @@ type BatchData struct {

func DecodeBatches(config *rollup.Config, r io.Reader) ([]*BatchData, error) {
var typeData [1]byte
if _, err := r.Read(typeData[:]); err != nil {
if _, err := io.ReadFull(r, typeData[:]); err != nil {
return nil, fmt.Errorf("failed to read batch bundle type byte: %v", err)
}
switch typeData[0] {
Expand Down

0 comments on commit 67ca957

Please sign in to comment.