fix Block overrides case

This commit is contained in:
Monkey 2025-05-17 13:40:11 +08:00
parent a53e59b279
commit b4f1640675

View file

@ -819,6 +819,11 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
return 0, err return 0, err
} }
blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil) blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil)
if blockOverrides != nil {
if err := blockOverrides.Apply(&blockCtx); err != nil {
return 0, err
}
}
rules := b.ChainConfig().Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time) rules := b.ChainConfig().Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time)
precompiles := vm.ActivePrecompiledContracts(rules) precompiles := vm.ActivePrecompiledContracts(rules)
if err := overrides.Apply(state, precompiles); err != nil { if err := overrides.Apply(state, precompiles); err != nil {