mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
enable hf in tests
This commit is contained in:
parent
c311f3b363
commit
109a0a19a6
6 changed files with 37 additions and 0 deletions
|
|
@ -4672,6 +4672,9 @@ func TestEIP3651(t *testing.T) {
|
|||
gspec.Config.TerminalTotalDifficulty = common.Big0
|
||||
gspec.Config.TerminalTotalDifficultyPassed = true
|
||||
gspec.Config.ShanghaiBlock = common.Big0
|
||||
gspec.Config.CancunBlock = common.Big0
|
||||
gspec.Config.PragueBlock = common.Big0
|
||||
gspec.Config.VerkleBlock = common.Big0
|
||||
signer := types.LatestSigner(gspec.Config)
|
||||
|
||||
_, blocks, _ := GenerateChainWithGenesis(gspec, engine, 1, func(i int, b *BlockGen) {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ func TestGenerateWithdrawalChain(t *testing.T) {
|
|||
config.TerminalTotalDifficultyPassed = true
|
||||
config.TerminalTotalDifficulty = common.Big0
|
||||
config.ShanghaiBlock = common.Big0
|
||||
gspec.Config.CancunBlock = common.Big0
|
||||
gspec.Config.PragueBlock = common.Big0
|
||||
gspec.Config.VerkleBlock = common.Big0
|
||||
|
||||
// init 0xaa with some storage elements
|
||||
storage := make(map[common.Hash]common.Hash)
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@ func TestValidation(t *testing.T) {
|
|||
// Config that has not timestamp enabled
|
||||
legacyConfig := *params.MainnetChainConfig
|
||||
legacyConfig.ShanghaiBlock = nil
|
||||
legacyConfig.CancunBlock = nil
|
||||
legacyConfig.PragueBlock = nil
|
||||
legacyConfig.VerkleBlock = nil
|
||||
|
||||
tests := []struct {
|
||||
config *params.ChainConfig
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ func TestStateProcessorErrors(t *testing.T) {
|
|||
TerminalTotalDifficultyPassed: true,
|
||||
ShanghaiBlock: big.NewInt(0),
|
||||
CancunBlock: big.NewInt(0),
|
||||
PragueBlock: big.NewInt(0),
|
||||
VerkleBlock: big.NewInt(0),
|
||||
Bor: ¶ms.BorConfig{BurntContract: map[string]string{"0": "0x000000000000000000000000000000000000dead"}},
|
||||
}
|
||||
signer = types.LatestSigner(config)
|
||||
|
|
|
|||
|
|
@ -1416,5 +1416,10 @@ func overrideConfig(original *params.ChainConfig, override *params.ChainConfig)
|
|||
canon = false
|
||||
}
|
||||
|
||||
if timestamp := override.VerkleBlock; timestamp != nil {
|
||||
chainConfigCopy.VerkleBlock = timestamp
|
||||
canon = false
|
||||
}
|
||||
|
||||
return chainConfigCopy, canon
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ func TestConfigRules(t *testing.T) {
|
|||
c := &ChainConfig{
|
||||
LondonBlock: new(big.Int),
|
||||
ShanghaiBlock: big.NewInt(10),
|
||||
CancunBlock: big.NewInt(20),
|
||||
PragueBlock: big.NewInt(30),
|
||||
VerkleBlock: big.NewInt(40),
|
||||
}
|
||||
|
||||
block := new(big.Int)
|
||||
|
|
@ -129,6 +132,24 @@ func TestConfigRules(t *testing.T) {
|
|||
t.Errorf("expected %v to be shanghai", 0)
|
||||
}
|
||||
|
||||
block.SetInt64(20)
|
||||
|
||||
if r := c.Rules(block, true, 0); !r.IsCancun {
|
||||
t.Errorf("expected %v to be cancun", 0)
|
||||
}
|
||||
|
||||
block.SetInt64(30)
|
||||
|
||||
if r := c.Rules(block, true, 0); !r.IsPrague {
|
||||
t.Errorf("expected %v to be prague", 0)
|
||||
}
|
||||
|
||||
block.SetInt64(40)
|
||||
|
||||
if r := c.Rules(block, true, 0); !r.IsVerkle {
|
||||
t.Errorf("expected %v to be verkle", 0)
|
||||
}
|
||||
|
||||
block = block.SetInt64(math.MaxInt64)
|
||||
|
||||
if r := c.Rules(block, true, 0); !r.IsShanghai {
|
||||
|
|
|
|||
Loading…
Reference in a new issue