From 92d1f2f9ff81c8ab393756139e61176707ddc8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 3 Jun 2024 15:36:26 +0300 Subject: [PATCH] internal/ethapi: fix test --- internal/ethapi/api.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index e700164d90..bf8faeacab 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1200,16 +1200,16 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr ErrorRatio: estimateGasErrorRatio, } // Set any required transaction default, but make sure the gas cap itself is not messed with - nilGas := args.Gas == nil + // if it was not specified in the original argument list. + if args.Gas == nil { + args.Gas = new(hexutil.Uint64) + } if err := args.CallDefaults(gasCap, header.BaseFee, b.ChainConfig().ChainID); err != nil { return 0, err } - if nilGas && args.Gas != nil { - args.Gas = nil - } call := args.ToMessage(header.BaseFee) - // Run the gas estimation and wrap any revertals into a custom return + // Run the gas estimation and wrap any revertals into a custom return estimate, revert, err := gasestimator.Estimate(ctx, call, opts, gasCap) if err != nil { if len(revert) > 0 {