internal/ethapi, accounts/abi/bind: use `errors.Is` for error comparison (#28348)

Co-authored-by: lightclient <lightclient@protonmail.com>
pull/28364/head
Brandon Liu 1 year ago committed by GitHub
parent 1f11d2d340
commit f62502e123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      accounts/abi/bind/backends/simulated.go
  2. 2
      internal/ethapi/api.go

@ -586,7 +586,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
return 0, err
}
if failed {
if result != nil && result.Err != vm.ErrOutOfGas {
if result != nil && !errors.Is(result.Err, vm.ErrOutOfGas) {
if len(result.Revert()) > 0 {
return 0, newRevertError(result)
}

@ -1271,7 +1271,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
return 0, err
}
if failed {
if result != nil && result.Err != vm.ErrOutOfGas {
if result != nil && !errors.Is(result.Err, vm.ErrOutOfGas) {
if len(result.Revert()) > 0 {
return 0, newRevertError(result)
}

Loading…
Cancel
Save