Skip to content

Commit

Permalink
cmd, core: fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Mar 5, 2024
1 parent c04c1c4 commit a31c044
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions cmd/geth/testdata/clique.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"terminalTotalDifficultyPassed": true,
"clique": {
"period": 5,
"epoch": 30000
Expand Down
6 changes: 0 additions & 6 deletions core/block_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func testHeaderVerificationForMerging(t *testing.T, isClique bool) {
preBlocks []*types.Block
postBlocks []*types.Block
engine consensus.Engine
merger = consensus.NewMerger(rawdb.NewMemoryDatabase())
)
if isClique {
var (
Expand Down Expand Up @@ -186,11 +185,6 @@ func testHeaderVerificationForMerging(t *testing.T, isClique bool) {
}
chain.InsertChain(preBlocks[i : i+1])
}

// Make the transition
merger.ReachTTD()
merger.FinalizePoS()

// Verify the blocks after the merging
for i := 0; i < len(postBlocks); i++ {
_, results := engine.VerifyHeaders(chain, []*types.Header{postHeaders[i]})
Expand Down
5 changes: 0 additions & 5 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,6 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
// Generate a canonical chain to act as the main dataset
chainConfig := *params.TestChainConfig
var (
merger = consensus.NewMerger(rawdb.NewMemoryDatabase())
engine = beacon.New(ethash.NewFaker())
key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
addr = crypto.PubkeyToAddress(key.PublicKey)
Expand All @@ -2153,8 +2152,6 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
// Activate the transition since genesis if required
if mergePoint == 0 {
mergeBlock = 0
merger.ReachTTD()
merger.FinalizePoS()

// Set the terminal total difficulty in the config
gspec.Config.TerminalTotalDifficulty = big.NewInt(0)
Expand Down Expand Up @@ -2189,8 +2186,6 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon

// Activate the transition in the middle of the chain
if mergePoint == 1 {
merger.ReachTTD()
merger.FinalizePoS()
// Set the terminal total difficulty in the config
ttd := big.NewInt(int64(len(blocks)))
ttd.Mul(ttd, params.GenesisDifficulty)
Expand Down

0 comments on commit a31c044

Please sign in to comment.