graphql: fix race in withdrawals test (#27706)

graphql: fix race in test
pull/27717/head
Sina Mahmoodi 1 year ago committed by GitHub
parent 714f75943b
commit 4f0d8f0d15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      graphql/graphql_test.go

@ -445,19 +445,21 @@ func newGQLService(t *testing.T, stack *node.Node, shanghai bool, gspec *core.Ge
TrieTimeout: 60 * time.Minute, TrieTimeout: 60 * time.Minute,
SnapshotCache: 5, SnapshotCache: 5,
} }
ethBackend, err := eth.New(stack, ethConf)
if err != nil {
t.Fatalf("could not create eth backend: %v", err)
}
var engine consensus.Engine = ethash.NewFaker() var engine consensus.Engine = ethash.NewFaker()
if shanghai { if shanghai {
engine = beacon.NewFaker() engine = beacon.NewFaker()
chainCfg := gspec.Config chainCfg := gspec.Config
chainCfg.TerminalTotalDifficultyPassed = true chainCfg.TerminalTotalDifficultyPassed = true
chainCfg.TerminalTotalDifficulty = common.Big0 chainCfg.TerminalTotalDifficulty = common.Big0
shanghaiTime := uint64(0) // GenerateChain will increment timestamps by 10.
// Shanghai upgrade at block 1.
shanghaiTime := uint64(5)
chainCfg.ShanghaiTime = &shanghaiTime chainCfg.ShanghaiTime = &shanghaiTime
} }
ethBackend, err := eth.New(stack, ethConf)
if err != nil {
t.Fatalf("could not create eth backend: %v", err)
}
// Create some blocks and import them // Create some blocks and import them
chain, _ := core.GenerateChain(params.AllEthashProtocolChanges, ethBackend.BlockChain().Genesis(), chain, _ := core.GenerateChain(params.AllEthashProtocolChanges, ethBackend.BlockChain().Genesis(),
engine, ethBackend.ChainDb(), genBlocks, genfunc) engine, ethBackend.ChainDb(), genBlocks, genfunc)

Loading…
Cancel
Save