fix DoEstimateGas

This commit is contained in:
Monkey 2025-05-10 00:15:04 +08:00
parent 0db99f4e40
commit a53e59b279

View file

@ -818,7 +818,10 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
if state == nil || err != nil {
return 0, err
}
if err := overrides.Apply(state, nil); err != nil {
blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil)
rules := b.ChainConfig().Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time)
precompiles := vm.ActivePrecompiledContracts(rules)
if err := overrides.Apply(state, precompiles); err != nil {
return 0, err
}
// Construct the gas estimator option from the user input