forked from cerc-io/plugeth
Merge pull request #2461 from karalabe/fix-simulator-estimates
accounts/abi/bind/backends: estimate needed gas, not used
This commit is contained in:
commit
16d10aae0c
@ -152,7 +152,7 @@ func (b *SimulatedBackend) EstimateGasLimit(sender common.Address, contract *com
|
|||||||
vmenv := core.NewEnv(statedb, chainConfig, b.blockchain, msg, block.Header(), vm.Config{})
|
vmenv := core.NewEnv(statedb, chainConfig, b.blockchain, msg, block.Header(), vm.Config{})
|
||||||
gaspool := new(core.GasPool).AddGas(common.MaxBig)
|
gaspool := new(core.GasPool).AddGas(common.MaxBig)
|
||||||
|
|
||||||
_, gas, err := core.ApplyMessage(vmenv, msg, gaspool)
|
_, gas, _, err := core.NewStateTransition(vmenv, msg, gaspool).TransitionDb()
|
||||||
return gas, err
|
return gas, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user