Skip to content

Commit c35fed9

Browse files
committed
use previous behavior on tests
1 parent 246ea4f commit c35fed9

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

core/consensus/qbft/qbft_internal_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,8 @@ func TestInstanceIO_MaybeStart(t *testing.T) {
520520
c.deadliner = deadliner
521521
c.gaterFunc = func(core.Duty) bool { return true }
522522
c.mutable.instances = make(map[core.Duty]*instance.IO[Msg])
523-
// Use dummy genesis time and slot duration for testing
524-
genesisTime := time.Unix(1606824023, 0) // Mainnet genesis time
525-
slotDuration := 12 * time.Second
526-
c.timerFunc = timer.GetRoundTimerFunc(genesisTime, slotDuration)
523+
// Use zero values for tests to use default clock.Now() behavior
524+
c.timerFunc = timer.GetRoundTimerFunc(time.Time{}, 0)
527525

528526
// Generate a p2p private key pair.
529527
p2pKey := testutil.GenerateInsecureK1Key(t, 0)

core/consensus/timer/roundtimer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ func TestLinearRoundTimer(t *testing.T) {
164164
}
165165

166166
func TestGetTimerFunc(t *testing.T) {
167-
// Use dummy genesis time and slot duration for testing
168-
genesisTime := time.Unix(1606824023, 0) // Mainnet genesis time
169-
slotDuration := 12 * time.Second
167+
// Use zero values for tests to use default clock.Now() behavior
168+
genesisTime := time.Time{}
169+
slotDuration := time.Duration(0)
170170

171171
timerFunc := timer.GetRoundTimerFunc(genesisTime, slotDuration)
172172
require.Equal(t, timer.TimerEagerDoubleLinear, timerFunc(core.NewAttesterDuty(0)).Type())

0 commit comments

Comments
 (0)