Skip to content

Commit

Permalink
internal/ethapi, accounts/abi/bind: use errors.Is for error compari…
Browse files Browse the repository at this point in the history
…son (ethereum#28348)

Co-authored-by: lightclient <lightclient@protonmail.com>
  • Loading branch information
2 people authored and gzliudan committed Jan 10, 2025
1 parent 807b13a commit 24a7f0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,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)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
}

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)
}
Expand Down

0 comments on commit 24a7f0d

Please sign in to comment.