mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-22 07:49:26 +00:00
internal/ethapi: add MaxUsedGas field to eth_simulateV1 response (#32789)
closes #32741
This commit is contained in:
parent
402c71f2e2
commit
fc8c10476d
1 changed files with 2 additions and 1 deletions
|
|
@ -59,6 +59,7 @@ type simCallResult struct {
|
||||||
ReturnValue hexutil.Bytes `json:"returnData"`
|
ReturnValue hexutil.Bytes `json:"returnData"`
|
||||||
Logs []*types.Log `json:"logs"`
|
Logs []*types.Log `json:"logs"`
|
||||||
GasUsed hexutil.Uint64 `json:"gasUsed"`
|
GasUsed hexutil.Uint64 `json:"gasUsed"`
|
||||||
|
MaxUsedGas hexutil.Uint64 `json:"maxUsedGas"`
|
||||||
Status hexutil.Uint64 `json:"status"`
|
Status hexutil.Uint64 `json:"status"`
|
||||||
Error *callError `json:"error,omitempty"`
|
Error *callError `json:"error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
@ -323,7 +324,7 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
|
||||||
sim.gasRemaining -= result.UsedGas
|
sim.gasRemaining -= result.UsedGas
|
||||||
|
|
||||||
logs := tracer.Logs()
|
logs := tracer.Logs()
|
||||||
callRes := simCallResult{ReturnValue: result.Return(), Logs: logs, GasUsed: hexutil.Uint64(result.UsedGas)}
|
callRes := simCallResult{ReturnValue: result.Return(), Logs: logs, GasUsed: hexutil.Uint64(result.UsedGas), MaxUsedGas: hexutil.Uint64(result.MaxUsedGas)}
|
||||||
if result.Failed() {
|
if result.Failed() {
|
||||||
callRes.Status = hexutil.Uint64(types.ReceiptStatusFailed)
|
callRes.Status = hexutil.Uint64(types.ReceiptStatusFailed)
|
||||||
if errors.Is(result.Err, vm.ErrExecutionReverted) {
|
if errors.Is(result.Err, vm.ErrExecutionReverted) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue