mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-07 10:12:19 +00:00
74101612ce
* first working implementation * assertions tests * adds to requires * merges assert and require tests into a single suite * gazelle * Merge branch 'merge-assert-require-tests' into assert-logs-contains-move-to-assertions * gazelle * updates references * fixes build issue * Merge branch 'master' into assert-logs-contains-move-to-assertions * Merge refs/heads/master into assert-logs-contains-move-to-assertions * Merge branch 'master' into assert-logs-contains-move-to-assertions * fixes build issue * Merge branch 'assert-logs-contains-move-to-assertions' of github.com:prysmaticlabs/prysm into assert-logs-contains-move-to-assertions * Merge refs/heads/master into assert-logs-contains-move-to-assertions * Merge refs/heads/master into assert-logs-contains-move-to-assertions
31 lines
837 B
Go
31 lines
837 B
Go
package slotutil
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/params"
|
|
"github.com/prysmaticlabs/prysm/shared/roughtime"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
|
logTest "github.com/sirupsen/logrus/hooks/test"
|
|
)
|
|
|
|
func TestCountdownToGenesis(t *testing.T) {
|
|
hook := logTest.NewGlobal()
|
|
params.SetupTestConfigCleanup(t)
|
|
config := params.BeaconConfig()
|
|
config.GenesisCountdownInterval = time.Millisecond * 500
|
|
params.OverrideBeaconConfig(config)
|
|
|
|
firstStringResult := "1s until chain genesis"
|
|
genesisReached := "Chain genesis time reached"
|
|
CountdownToGenesis(
|
|
context.Background(),
|
|
roughtime.Now().Add(2*time.Second),
|
|
params.BeaconConfig().MinGenesisActiveValidatorCount,
|
|
)
|
|
require.LogsContain(t, hook, firstStringResult)
|
|
require.LogsContain(t, hook, genesisReached)
|
|
}
|