mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd, core: fix some tests
This commit is contained in:
parent
c04c1c44fb
commit
a31c0443b1
3 changed files with 1 additions and 11 deletions
1
cmd/geth/testdata/clique.json
vendored
1
cmd/geth/testdata/clique.json
vendored
|
|
@ -8,6 +8,7 @@
|
||||||
"byzantiumBlock": 0,
|
"byzantiumBlock": 0,
|
||||||
"constantinopleBlock": 0,
|
"constantinopleBlock": 0,
|
||||||
"petersburgBlock": 0,
|
"petersburgBlock": 0,
|
||||||
|
"terminalTotalDifficultyPassed": true,
|
||||||
"clique": {
|
"clique": {
|
||||||
"period": 5,
|
"period": 5,
|
||||||
"epoch": 30000
|
"epoch": 30000
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ func testHeaderVerificationForMerging(t *testing.T, isClique bool) {
|
||||||
preBlocks []*types.Block
|
preBlocks []*types.Block
|
||||||
postBlocks []*types.Block
|
postBlocks []*types.Block
|
||||||
engine consensus.Engine
|
engine consensus.Engine
|
||||||
merger = consensus.NewMerger(rawdb.NewMemoryDatabase())
|
|
||||||
)
|
)
|
||||||
if isClique {
|
if isClique {
|
||||||
var (
|
var (
|
||||||
|
|
@ -186,11 +185,6 @@ func testHeaderVerificationForMerging(t *testing.T, isClique bool) {
|
||||||
}
|
}
|
||||||
chain.InsertChain(preBlocks[i : i+1])
|
chain.InsertChain(preBlocks[i : i+1])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the transition
|
|
||||||
merger.ReachTTD()
|
|
||||||
merger.FinalizePoS()
|
|
||||||
|
|
||||||
// Verify the blocks after the merging
|
// Verify the blocks after the merging
|
||||||
for i := 0; i < len(postBlocks); i++ {
|
for i := 0; i < len(postBlocks); i++ {
|
||||||
_, results := engine.VerifyHeaders(chain, []*types.Header{postHeaders[i]})
|
_, results := engine.VerifyHeaders(chain, []*types.Header{postHeaders[i]})
|
||||||
|
|
|
||||||
|
|
@ -2129,7 +2129,6 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
|
||||||
// Generate a canonical chain to act as the main dataset
|
// Generate a canonical chain to act as the main dataset
|
||||||
chainConfig := *params.TestChainConfig
|
chainConfig := *params.TestChainConfig
|
||||||
var (
|
var (
|
||||||
merger = consensus.NewMerger(rawdb.NewMemoryDatabase())
|
|
||||||
engine = beacon.New(ethash.NewFaker())
|
engine = beacon.New(ethash.NewFaker())
|
||||||
key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
addr = crypto.PubkeyToAddress(key.PublicKey)
|
addr = crypto.PubkeyToAddress(key.PublicKey)
|
||||||
|
|
@ -2153,8 +2152,6 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
|
||||||
// Activate the transition since genesis if required
|
// Activate the transition since genesis if required
|
||||||
if mergePoint == 0 {
|
if mergePoint == 0 {
|
||||||
mergeBlock = 0
|
mergeBlock = 0
|
||||||
merger.ReachTTD()
|
|
||||||
merger.FinalizePoS()
|
|
||||||
|
|
||||||
// Set the terminal total difficulty in the config
|
// Set the terminal total difficulty in the config
|
||||||
gspec.Config.TerminalTotalDifficulty = big.NewInt(0)
|
gspec.Config.TerminalTotalDifficulty = big.NewInt(0)
|
||||||
|
|
@ -2189,8 +2186,6 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
|
||||||
|
|
||||||
// Activate the transition in the middle of the chain
|
// Activate the transition in the middle of the chain
|
||||||
if mergePoint == 1 {
|
if mergePoint == 1 {
|
||||||
merger.ReachTTD()
|
|
||||||
merger.FinalizePoS()
|
|
||||||
// Set the terminal total difficulty in the config
|
// Set the terminal total difficulty in the config
|
||||||
ttd := big.NewInt(int64(len(blocks)))
|
ttd := big.NewInt(int64(len(blocks)))
|
||||||
ttd.Mul(ttd, params.GenesisDifficulty)
|
ttd.Mul(ttd, params.GenesisDifficulty)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue