mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
internal/ethapi: remove unused estimateGasError (#1588)
This commit is contained in:
parent
6e8d261e42
commit
afdb029356
1 changed files with 0 additions and 17 deletions
|
|
@ -1255,23 +1255,6 @@ func (s *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrO
|
||||||
return result.Return(), result.Err
|
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) {
|
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
|
// Retrieve the base state and mutate it with any overrides
|
||||||
state, _, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
|
state, _, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue