internal/ethapi: fix test

This commit is contained in:
Péter Szilágyi 2024-06-03 15:36:26 +03:00 committed by GitHub
parent e7865d63d2
commit 92d1f2f9ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1200,13 +1200,13 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
ErrorRatio: estimateGasErrorRatio, ErrorRatio: estimateGasErrorRatio,
} }
// Set any required transaction default, but make sure the gas cap itself is not messed with // 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 { if err := args.CallDefaults(gasCap, header.BaseFee, b.ChainConfig().ChainID); err != nil {
return 0, err return 0, err
} }
if nilGas && args.Gas != nil {
args.Gas = nil
}
call := args.ToMessage(header.BaseFee) 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