Skip to content

Commit 47b1ad0

Browse files
Update ledger/chainsync_test.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Chris Gianelloni <wolf31o2@gmail.com>
1 parent d93f575 commit 47b1ad0

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

ledger/chainsync_test.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -366,17 +366,10 @@ func TestCalculateEpochNonce_ZeroActiveSlots(t *testing.T) {
366366
},
367367
}
368368

369-
// Zero active slots coefficient should cause division by zero error
370-
_, err := ls.calculateEpochNonce(nil, 86400)
371-
if err == nil {
372-
t.Error("expected error for zero active slots coefficient, got nil")
373-
}
374-
if !strings.Contains(err.Error(), "divide by zero") &&
375-
!strings.Contains(err.Error(), "ActiveSlotsCoeff") {
376-
t.Errorf(
377-
"expected error about division by zero or ActiveSlotsCoeff, got: %v",
378-
err,
379-
)
369+
// Verify fallback behavior when ActiveSlotsCoeff cannot be used
370+
window := ls.calculateStabilityWindow()
371+
if window != blockfetchBatchSlotThresholdDefault {
372+
t.Fatalf("expected fallback window %d, got %d", blockfetchBatchSlotThresholdDefault, window)
380373
}
381374
}
382375

0 commit comments

Comments
 (0)