From ce0616b88e9b769ac3e3abc3fc53a4b1ecff87f6 Mon Sep 17 00:00:00 2001 From: terencechain Date: Thu, 27 Apr 2023 08:53:28 -0700 Subject: [PATCH] Add verify slot tolerance test (#12344) Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- 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 b76b168ee..dd49b160c 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{