Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Staykov committed Oct 29, 2024
1 parent 6f14463 commit bab79a0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions zk/datastream/client/stream_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (c *StreamClient) Stop() {
return
}
if err := c.sendStopCmd(); err != nil {
log.Warn(fmt.Sprintf("send stop command: %w", err))
log.Warn(fmt.Sprintf("send stop command: %v", err))
}
// c.conn.Close()
// c.conn = nil
Expand Down Expand Up @@ -430,10 +430,10 @@ func (c *StreamClient) ReadAllEntriesToChannel() (err error) {

func (c *StreamClient) handleSocketError(socketErr error) bool {
if socketErr != nil {
log.Warn(fmt.Sprintf("Socket error: %w", socketErr))
log.Warn(fmt.Sprintf("Socket error: %v", socketErr))
}
if err := c.tryReConnect(); err != nil {
log.Warn(fmt.Sprintf("try reconnect: %w", err))
log.Warn(fmt.Sprintf("try reconnect: %v", err))
return false
}

Expand Down Expand Up @@ -545,7 +545,7 @@ LOOP:
parsedProto.ForkId = c.currentFork
log.Trace("writing block to channel", "blockNumber", parsedProto.L2BlockNumber, "batchNumber", parsedProto.BatchNumber)
default:
return fmt.Errorf("unexpected entry type: %w", parsedProto)
return fmt.Errorf("unexpected entry type: %v", parsedProto)
}
select {
case c.entryChan <- parsedProto:
Expand All @@ -569,13 +569,13 @@ LOOP:
func (c *StreamClient) tryReConnect() (err error) {
if c.conn != nil {
if err := c.conn.Close(); err != nil {
log.Warn(fmt.Sprintf("close DS connection: %w", err))
log.Warn(fmt.Sprintf("close DS connection: %v", err))
return err
}
c.conn = nil
}
if err = c.Start(); err != nil {
log.Warn(fmt.Sprintf("start DS connection: %w", err))
log.Warn(fmt.Sprintf("start DS connection: %v", err))
}

return err
Expand Down Expand Up @@ -654,7 +654,7 @@ func ReadParsedProto(iterator FileEntryIterator) (
if bookmark.BookmarkType() == datastream.BookmarkType_BOOKMARK_TYPE_L2_BLOCK {
break LOOP
} else {
err = fmt.Errorf("unexpected bookmark type inside block: %w", bookmark.Type())
err = fmt.Errorf("unexpected bookmark type inside block: %v", bookmark.Type())
return
}
} else if innerFile.IsBatchEnd() {
Expand Down Expand Up @@ -792,7 +792,7 @@ func (c *StreamClient) readResultEntry(packet []byte) (re *types.ResultEntry, er
// Read variable field (errStr)
length := binary.BigEndian.Uint32(buffer[1:5])
if length < types.ResultEntryMinSize {
return re, errors.New("Error reading result entry")
return re, errors.New("failed reading result entry")
}

// read the rest of the result
Expand Down

0 comments on commit bab79a0

Please sign in to comment.