mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
5983d0a397
* Allow requests for next sync committee * fix deepsource and variable rename * Minor cleanup * Potuz's comments Co-authored-by: terence tsao <terence@prysmaticlabs.com>
22 lines
516 B
Go
22 lines
516 B
Go
package testutil
|
|
|
|
import (
|
|
"time"
|
|
|
|
types "github.com/prysmaticlabs/eth2-types"
|
|
"github.com/prysmaticlabs/prysm/config/params"
|
|
)
|
|
|
|
// MockGenesisTimeFetcher is a fake implementation of the blockchain.TimeFetcher
|
|
type MockGenesisTimeFetcher struct {
|
|
Genesis time.Time
|
|
}
|
|
|
|
func (m *MockGenesisTimeFetcher) GenesisTime() time.Time {
|
|
return m.Genesis
|
|
}
|
|
|
|
func (m *MockGenesisTimeFetcher) CurrentSlot() types.Slot {
|
|
return types.Slot(uint64(time.Now().Unix()-m.Genesis.Unix()) / params.BeaconConfig().SecondsPerSlot)
|
|
}
|