mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
change 7702 prestate tracer test case to use a premerged genesis configuration. remove changes from util.go
This commit is contained in:
parent
a9e3685d44
commit
244af6b07c
2 changed files with 12 additions and 48 deletions
File diff suppressed because one or more lines are too long
|
|
@ -28,7 +28,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
|
||||||
|
|
||||||
// Force-load native and js packages, to trigger registration
|
// Force-load native and js packages, to trigger registration
|
||||||
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
|
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
|
||||||
|
|
@ -68,13 +67,7 @@ func (c *traceContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
|
||||||
context.BaseFee = (*big.Int)(c.BaseFee)
|
context.BaseFee = (*big.Int)(c.BaseFee)
|
||||||
}
|
}
|
||||||
|
|
||||||
isPostMerge := func(config *params.ChainConfig, blockNum uint64, timestamp uint64) bool {
|
if genesis.Config.TerminalTotalDifficulty != nil && genesis.Config.TerminalTotalDifficulty.Sign() == 0 {
|
||||||
mergedAtGenesis := config.TerminalTotalDifficulty != nil && config.TerminalTotalDifficulty.Sign() == 0
|
|
||||||
return mergedAtGenesis ||
|
|
||||||
config.MergeNetsplitBlock != nil && blockNum >= config.MergeNetsplitBlock.Uint64() ||
|
|
||||||
config.ShanghaiTime != nil && timestamp >= *config.ShanghaiTime
|
|
||||||
}
|
|
||||||
if isPostMerge(genesis.Config, uint64(c.Number), uint64(c.Time)) {
|
|
||||||
context.Random = &genesis.Mixhash
|
context.Random = &genesis.Mixhash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue