Skip to content

Commit 38db7ce

Browse files
committed
Fix recognition of intrinsic gas error
1 parent fbfc277 commit 38db7ce

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ethapi/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
11891189

11901190
result, err := DoCall(ctx, b, args, blockNrOrHash, nil, 0, gasCap)
11911191
if err != nil {
1192-
if errors.Is(err, evmcore.ErrIntrinsicGas) {
1192+
if errors.Is(err, core.ErrIntrinsicGas) {
11931193
return true, nil, nil // Special case, raise gas limit
11941194
}
11951195
return true, nil, err // Bail out

evmcore/error.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ package evmcore
1818

1919
import (
2020
"errors"
21+
"fmt"
2122

23+
"github.com/ethereum/go-ethereum/core"
2224
"github.com/ethereum/go-ethereum/core/types"
2325
)
2426

@@ -60,7 +62,7 @@ var (
6062

6163
// ErrIntrinsicGas is returned if the transaction is specified to use less gas
6264
// than required to start the invocation.
63-
ErrIntrinsicGas = errors.New("intrinsic gas too low")
65+
ErrIntrinsicGas = fmt.Errorf("%w", core.ErrIntrinsicGas)
6466

6567
// ErrTxTypeNotSupported is returned if a transaction is not supported in the
6668
// current network configuration.

0 commit comments

Comments
 (0)