internal/ethapi: remove unused estimateGasError (#1588)

This commit is contained in:
wit liu 2025-10-08 12:39:11 +08:00 committed by GitHub
parent 6e8d261e42
commit afdb029356
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1255,23 +1255,6 @@ func (s *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrO
return result.Return(), result.Err
}
type estimateGasError struct {
error string // Concrete error type if it's failed to estimate gas usage
vmerr error // Additional field, it's non-nil if the given transaction is invalid
revert string // Additional field, it's non-empty if the transaction is reverted and reason is provided
}
func (e estimateGasError) Error() string {
errMsg := e.error
if e.vmerr != nil {
errMsg += fmt.Sprintf(" (%v)", e.vmerr)
}
if e.revert != "" {
errMsg += fmt.Sprintf(" (%s)", e.revert)
}
return errMsg
}
func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, gasCap uint64) (hexutil.Uint64, error) {
// Retrieve the base state and mutate it with any overrides
state, _, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)