From 77f1f2ea79b28e8ebeca8149815735f36322ab71 Mon Sep 17 00:00:00 2001 From: bnovil Date: Mon, 16 Oct 2023 15:13:54 +0800 Subject: [PATCH 1/2] enhance error check --- internal/ethapi/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index cf1960fcf646..405930430b06 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1277,7 +1277,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) } From abdd35cecccb565ecf1210c0c8aa2a6eb7cb42f9 Mon Sep 17 00:00:00 2001 From: lightclient Date: Mon, 16 Oct 2023 15:54:12 -0600 Subject: [PATCH 2/2] accounts/abi/bind/backends/simulated: use builtin error comparison --- accounts/abi/bind/backends/simulated.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 8549976480bc..6892668cbe55 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.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) }