From 91ed443544a5cf5079a92a5ee3c8428d2c35116b Mon Sep 17 00:00:00 2001 From: howel Date: Wed, 8 May 2024 15:23:38 +0800 Subject: [PATCH] add comment --- internal/ethapi/api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 67e0d394f5..3bbcfe6263 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1205,6 +1205,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr call := args.ToMessage(header.BaseFee) + //Get the block gas cap block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash) if err != nil { return 0, err @@ -1212,6 +1213,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr if block == nil { return 0, errors.New("block not found") } + // Run the gas estimation andwrap any revertals into a custom return estimate, revert, err := gasestimator.Estimate(ctx, call, opts, gasCap, block.GasLimit())