Skip to content

Commit

Permalink
fix(logic): check out of gas error when parsing interpreter solution
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Jul 4, 2024
1 parent 5893229 commit e0c5b20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/logic/keeper/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ func (k Keeper) queryInterpreter(
if callErr != nil {
if sdkmath.NewUint(uint64(len(results))).LT(solutionsLimit) {
// error is not part of the look-ahead and should be included in the solutions
gasMeter := sdk.UnwrapSDKContext(ctx).GasMeter()
if gasMeter.IsOutOfGas() {
callErr = engine.ResourceError(prolog2.ResourceGas(callErr.Error(), gasMeter.GasConsumed(), gasMeter.Limit()), env)
}
results = append(results, types.Result{Error: callErr.Error()})
} else {
// error is part of the look-ahead, so let's consider that there's one more solution
Expand Down

0 comments on commit e0c5b20

Please sign in to comment.