enhance error check

This commit is contained in:
bnovil 2023-10-16 15:13:54 +08:00
parent 8976a0c97a
commit 77f1f2ea79

View file

@ -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)
}