prysm-pulse/beacon-chain/db/kv/check_historical_test_test.go
Victor Farazdagi fecbec2342
Applies assertion funcs to beacon-chain/db tests (#6938)
* part1
* go tidy
* Merge branch 'go-tidy' into apply-testutils-assertions-to-beaconchain-db
* updated beacon-chain/db/kv tests
* Merge branch 'master' into apply-testutils-assertions-to-beaconchain-db
* Merge refs/heads/master into apply-testutils-assertions-to-beaconchain-db
* Merge refs/heads/master into apply-testutils-assertions-to-beaconchain-db
2020-08-08 18:39:01 +00:00

29 lines
762 B
Go

package kv
import (
"testing"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
)
func TestVerifySlotsPerArchivePoint(t *testing.T) {
db := setupDB(t)
// This should set default to 2048.
require.NoError(t, db.verifySlotsPerArchivePoint())
// This should not fail with default 2048.
require.NoError(t, db.verifySlotsPerArchivePoint())
params.SetupTestConfigCleanup(t)
config := params.BeaconConfig()
config.SlotsPerArchivedPoint = 256
params.OverrideBeaconConfig(config)
// This should fail.
msg := "could not update --slots-per-archive-point after it has been set"
assert.ErrorContains(t, msg, db.verifySlotsPerArchivePoint())
}