Some test improvements (#10928)

* extract DeterministicGenesisStateWithGenesisBlock

(cherry picked from commit a5e3a9c9bbbacb23a644f5c68c92839a315f66a1)

# Conflicts:
#	testing/util/state.go

* part 1

* part 2

* part 3

* fix errors

* db interface public visibility

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2022-06-24 19:22:39 +02:00
committed by GitHub
parent 4e604ee22b
commit 2b6e86ec1b
61 changed files with 482 additions and 1330 deletions

View File

@@ -17,7 +17,6 @@ import (
"github.com/prysmaticlabs/prysm/cmd/beacon-chain/flags"
"github.com/prysmaticlabs/prysm/config/params"
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/consensus-types/wrapper"
eth "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/testing/assert"
"github.com/prysmaticlabs/prysm/testing/require"
@@ -378,10 +377,7 @@ func TestService_Resync(t *testing.T) {
}, p.Peers())
cache.initializeRootCache(makeSequence(1, 160), t)
beaconDB := dbtest.SetupDB(t)
wsb, err := wrapper.WrappedSignedBeaconBlock(util.NewBeaconBlock())
require.NoError(t, err)
err = beaconDB.SaveBlock(context.Background(), wsb)
require.NoError(t, err)
util.SaveBlock(t, context.Background(), beaconDB, util.NewBeaconBlock())
cache.RLock()
genesisRoot := cache.rootCache[0]
cache.RUnlock()