mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
state override no precompile
This commit is contained in:
parent
1d6637e808
commit
3def46a6e0
1 changed files with 2 additions and 6 deletions
|
|
@ -813,17 +813,13 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
|
||||||
if state == nil || err != nil {
|
if state == nil || err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
chainContext := NewChainContext(ctx, b)
|
if err := overrides.Apply(state, nil); err != nil {
|
||||||
blockCtx := core.NewEVMBlockContext(header, chainContext, nil)
|
|
||||||
rules := b.ChainConfig().Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time)
|
|
||||||
precompiles := maps.Clone(vm.ActivePrecompiledContracts(rules))
|
|
||||||
if err := overrides.Apply(state, precompiles); err != nil {
|
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
// Construct the gas estimator option from the user input
|
// Construct the gas estimator option from the user input
|
||||||
opts := &gasestimator.Options{
|
opts := &gasestimator.Options{
|
||||||
Config: b.ChainConfig(),
|
Config: b.ChainConfig(),
|
||||||
Chain: chainContext,
|
Chain: NewChainContext(ctx, b),
|
||||||
Header: header,
|
Header: header,
|
||||||
BlockOverrides: blockOverrides,
|
BlockOverrides: blockOverrides,
|
||||||
State: state,
|
State: state,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue