mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Create time Package for Shared/timeutil, mclock and slotutil (#9594)
* add time pkg * Go fmt
This commit is contained in:
@@ -13,8 +13,8 @@ import (
|
||||
validatorpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/validator-client"
|
||||
"github.com/prysmaticlabs/prysm/shared/bls"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"github.com/prysmaticlabs/prysm/shared/slotutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/timeutils"
|
||||
prysmTime "github.com/prysmaticlabs/prysm/time"
|
||||
"github.com/prysmaticlabs/prysm/time/slots"
|
||||
"go.opencensus.io/trace"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@@ -149,13 +149,13 @@ func (v *validator) waitToSlotTwoThirds(ctx context.Context, slot types.Slot) {
|
||||
ctx, span := trace.StartSpan(ctx, "validator.waitToSlotTwoThirds")
|
||||
defer span.End()
|
||||
|
||||
oneThird := slotutil.DivideSlotBy(3 /* one third of slot duration */)
|
||||
oneThird := slots.DivideSlotBy(3 /* one third of slot duration */)
|
||||
twoThird := oneThird + oneThird
|
||||
delay := twoThird
|
||||
|
||||
startTime := slotutil.SlotStartTime(v.genesisTime, slot)
|
||||
startTime := slots.SlotStartTime(v.genesisTime, slot)
|
||||
finalTime := startTime.Add(delay)
|
||||
wait := timeutils.Until(finalTime)
|
||||
wait := prysmTime.Until(finalTime)
|
||||
if wait <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user