mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Use current slot helper whenever possible (#15301)
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
ethpb "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
|
||||
validatorpb "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1/validator-client"
|
||||
"github.com/OffchainLabs/prysm/v6/runtime/version"
|
||||
prysmTime "github.com/OffchainLabs/prysm/v6/time"
|
||||
"github.com/OffchainLabs/prysm/v6/time/slots"
|
||||
"github.com/OffchainLabs/prysm/v6/validator/client/iface"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
@@ -320,8 +319,7 @@ func ProposeExit(
|
||||
}
|
||||
|
||||
func CurrentEpoch(genesisTime *timestamp.Timestamp) (primitives.Epoch, error) {
|
||||
totalSecondsPassed := prysmTime.Now().Unix() - genesisTime.Seconds
|
||||
currentSlot := primitives.Slot((uint64(totalSecondsPassed)) / params.BeaconConfig().SecondsPerSlot)
|
||||
currentSlot := slots.CurrentSlot(uint64(genesisTime.Seconds))
|
||||
currentEpoch := slots.ToEpoch(currentSlot)
|
||||
return currentEpoch, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user