Skip to content

Commit

Permalink
fix readBlock to parse new fields
Browse files Browse the repository at this point in the history
  • Loading branch information
colindickson committed Aug 30, 2024
1 parent 74c2fed commit 83a448b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codec/consolereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ func (r *ConsoleReader) buildScanner(reader io.Reader) *bufio.Scanner {
}

// Formats
// FIRE BLOCK <NUM> <HASH> <PROTO_HEX>
// FIRE BLOCK {height} {hash} {parent_height} {parent_hash} {lib} {timestamp} {hex}
func (ctx *parseCtx) readBlock(line string) (*pbnear.Block, error) {
chunks, err := SplitInChunks(line, 4)
chunks, err := SplitInChunks(line, 8)
if err != nil {
return nil, fmt.Errorf("split: %s", err)
}
Expand All @@ -167,7 +167,7 @@ func (ctx *parseCtx) readBlock(line string) (*pbnear.Block, error) {
}

// We skip block hash for now
protoBytes, err := hex.DecodeString(chunks[2])
protoBytes, err := hex.DecodeString(chunks[7])
if err != nil {
return nil, fmt.Errorf("invalid block bytes: %w", err)
}
Expand Down

0 comments on commit 83a448b

Please sign in to comment.