mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Refactor: move functions beacon-chain/core/time -> time/slots (#9719)
* Move necessary functions beacon-chain/core/time -> time/slots * Fix fuzz * Fix build * Update slot_epoch.go
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
types "github.com/prysmaticlabs/eth2-types"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/signing"
|
||||
coreTime "github.com/prysmaticlabs/prysm/beacon-chain/core/time"
|
||||
"github.com/prysmaticlabs/prysm/config/params"
|
||||
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
|
||||
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/time/slots"
|
||||
)
|
||||
|
||||
// IsForkNextEpoch checks if an alloted fork is in the following epoch.
|
||||
@@ -23,8 +23,8 @@ func IsForkNextEpoch(genesisTime time.Time, genesisValidatorsRoot []byte) (bool,
|
||||
if len(genesisValidatorsRoot) == 0 {
|
||||
return false, errors.New("genesis validators root is not set")
|
||||
}
|
||||
currentSlot := coreTime.SlotsSince(genesisTime)
|
||||
currentEpoch := coreTime.SlotToEpoch(currentSlot)
|
||||
currentSlot := slots.Since(genesisTime)
|
||||
currentEpoch := slots.ToEpoch(currentSlot)
|
||||
fSchedule := params.BeaconConfig().ForkVersionSchedule
|
||||
scheduledForks := SortedForkVersions(fSchedule)
|
||||
isForkEpoch := false
|
||||
@@ -64,8 +64,8 @@ func CreateForkDigest(
|
||||
if len(genesisValidatorsRoot) == 0 {
|
||||
return [4]byte{}, errors.New("genesis validators root is not set")
|
||||
}
|
||||
currentSlot := coreTime.SlotsSince(genesisTime)
|
||||
currentEpoch := coreTime.SlotToEpoch(currentSlot)
|
||||
currentSlot := slots.Since(genesisTime)
|
||||
currentEpoch := slots.ToEpoch(currentSlot)
|
||||
|
||||
forkData, err := Fork(currentEpoch)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user