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

Co-authored-by: lightclient <lightclient@protonmail.com>
This commit is contained in:
Brandon Liu 2023-10-17 20:11:04 +08:00 committed by GitHub
parent 1f11d2d340
commit f62502e123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

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

View File

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