mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
4976461e62
* Fix odd placement of import * Puts all of NewGenesisBlock() into GenesisBlock() Also removes the unneeded TODO * Add error check for db retrieval * Add missing bazel imports * Add back NewGenesisBlock and create GenesisBlock in NewBeaconChian * Fix GenesisBlock() to grab the block from memory db * Fix according to requested changes Fix GenesisBlock() to grab the block from memory db Fix odd placement of import Properly add ParentHash to Block Remove no longer needed if statement condition Puts all of NewGenesisBlock() into GenesisBlock() Also removes the unneeded TODO Add error check for db retrieval Add case for if the beaconChain is missing a genesisBlock Add missing bazel imports Add back NewGenesisBlock and create GenesisBlock in NewBeaconChian Remove duplicate code Change genesis block timestamp to unix 0 Adds info log when a genesis block isn't found * Provide fakeClock to pass tests with a mocked genesisBlock * Fix unexpected log in test from addition of genesis block * Add tests for clock
19 lines
337 B
Go
19 lines
337 B
Go
package utils
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Clock represents a time providing interface that can be mocked for testing.
|
|
type Clock interface {
|
|
Now() time.Time
|
|
}
|
|
|
|
// RealClock represents an unmodified clock.
|
|
type RealClock struct{}
|
|
|
|
// Now represents the standard functionality of time.
|
|
func (RealClock) Now() time.Time {
|
|
return time.Now()
|
|
}
|