mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
84916672c6
* replace eth2 types * replace protos * regen proto * replace * gaz * deps * amend * regen proto * mod * gaz * gaz * ensure build * ssz * add dep * no more eth2 types * no more eth2 * remg * all builds * buidl * tidy * clean * fmt * val serv * gaz Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
22 lines
538 B
Go
22 lines
538 B
Go
package testutil
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/prysmaticlabs/prysm/config/params"
|
|
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
|
|
)
|
|
|
|
// 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)
|
|
}
|