Skip to content

Commit f797214

Browse files
committed
fix after review
1 parent 5245d0c commit f797214

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

process/errors.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,3 +1490,6 @@ var ErrInvalidShardInfo = errors.New("invalid shard info")
14901490

14911491
// ErrNilClosingNodeStartedFlag signals that the closing node started flag is nil
14921492
var ErrNilClosingNodeStartedFlag = errors.New("closing node started flag is nil")
1493+
1494+
// ErrInvalidRound signals that an invalid round has been provided
1495+
var ErrInvalidRound = errors.New("invalid round")

process/track/baseBlockTrack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ func (bbt *baseBlockTrack) checkAgainstRoundHandler(round uint64) error {
505505
timeLeftToAcceptProof := bbt.roundHandler.RemainingTime(roundTimestamp, maxTimeToAcceptProof)
506506
if timeLeftToAcceptProof <= 0 {
507507
return fmt.Errorf("%w header round: %d, current round timestamp: %d, time left to accept proof: %d",
508-
process.ErrHigherRoundInBlock,
508+
process.ErrInvalidRound,
509509
round,
510510
roundTimestamp.UnixMilli(),
511511
timeLeftToAcceptProof.Milliseconds())

process/track/baseBlockTrack_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ func TestBaseBlockTrack_CheckBlockAgainstRoundHandlerShouldFailOnInvalidWindow(t
24152415
timeToSleep := roundDuration + time.Duration(float64(roundDuration)*0.6)
24162416
time.Sleep(timeToSleep)
24172417
err := bbt.CheckBlockAgainstRoundHandler(hdr)
2418-
require.ErrorIs(t, err, process.ErrHigherRoundInBlock)
2418+
require.ErrorIs(t, err, process.ErrInvalidRound)
24192419
require.Contains(t, err.Error(), "current round timestamp")
24202420
}
24212421

0 commit comments

Comments
 (0)