@@ -2,18 +2,19 @@ package util
2
2
3
3
import (
4
4
"context"
5
- errorsmod "cosmossdk.io/errors"
6
5
"errors"
7
- sdk "github.com/cosmos/cosmos-sdk/types"
8
- sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
9
6
"strings"
10
7
11
8
"github.com/ichiban/prolog"
12
9
"github.com/ichiban/prolog/engine"
13
10
"github.com/samber/lo"
14
11
12
+ errorsmod "cosmossdk.io/errors"
15
13
sdkmath "cosmossdk.io/math"
16
14
15
+ sdk "github.com/cosmos/cosmos-sdk/types"
16
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
17
+
17
18
"github.com/axone-protocol/axoned/v8/x/logic/types"
18
19
)
19
20
@@ -52,13 +53,14 @@ func QueryInterpreter(
52
53
if callErr != nil {
53
54
if sdkmath .NewUint (uint64 (len (results ))).LT (solutionsLimit ) {
54
55
// error is not part of the look-ahead and should be included in the solutions
55
- if errors .Is (callErr , sdkerrors .ErrOutOfGas ) {
56
+ switch {
57
+ case errors .Is (callErr , sdkerrors .ErrOutOfGas ):
56
58
return nil , callErr
57
- } else if sdk .UnwrapSDKContext (ctx ).GasMeter ().IsOutOfGas () {
59
+ case sdk .UnwrapSDKContext (ctx ).GasMeter ().IsOutOfGas ():
58
60
return nil , errorsmod .Wrapf (sdkerrors .ErrOutOfGas , "out of gas in location: %v" , callErr .Error ())
61
+ default :
62
+ results = append (results , types.Result {Error : callErr .Error ()})
59
63
}
60
-
61
- results = append (results , types.Result {Error : callErr .Error ()})
62
64
} else {
63
65
// error is part of the look-ahead, so let's consider that there's one more solution
64
66
count = count .Incr ()
0 commit comments