From 8dd358561b281638d27f88e2d45bd33d96c32091 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Thu, 27 Apr 2023 08:37:56 -0700 Subject: [PATCH] Add tolerance test --- time/slots/slottime_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/time/slots/slottime_test.go b/time/slots/slottime_test.go index b76b168ee07e..dd49b160c98d 100644 --- a/time/slots/slottime_test.go +++ b/time/slots/slottime_test.go @@ -353,6 +353,14 @@ func TestVerifySlotTime(t *testing.T) { }, wantedErr: "could not process slot from the future", }, + { + name: "future slot but ok given 2s tolerance", + args: args{ + genesisTime: prysmTime.Now().Add(-1*time.Duration(params.BeaconConfig().SecondsPerSlot) - 10*time.Second).Unix(), + slot: 1, + timeTolerance: 2 * time.Second, + }, + }, { name: "max future slot", args: args{