diff --git a/x/logic/keeper/grpc_query_ask_test.go b/x/logic/keeper/grpc_query_ask_test.go index 2a7782428..33df88d82 100644 --- a/x/logic/keeper/grpc_query_ask_test.go +++ b/x/logic/keeper/grpc_query_ask_test.go @@ -39,6 +39,7 @@ func TestGRPCAsk(t *testing.T) { maxResultCount int predicateBlacklist []string maxGas uint64 + maxVariables uint64 predicateCosts map[string]uint64 expectedAnswer *types.Answer expectedError string @@ -142,7 +143,7 @@ func TestGRPCAsk(t *testing.T) { { query: "bank_balances(X, Y).", maxGas: 3000, - expectedError: "out of gas: logic (4204/3000): limit exceeded", + expectedError: "out of gas: logic (4222/3000): limit exceeded", }, { query: "block_height(X).", @@ -150,7 +151,12 @@ func TestGRPCAsk(t *testing.T) { predicateCosts: map[string]uint64{ "block_height/1": 10000, }, - expectedError: "out of gas: logic (12353/3000): limit exceeded", + expectedError: "out of gas: logic (12371/3000): limit exceeded", + }, + { + query: "length(List, 100000).", + maxVariables: 1000, + expectedError: "maximum number of variables reached: limit exceeded", }, { program: "father(bob, 'élodie').", @@ -348,6 +354,8 @@ foo(a4). maxResultCount := sdkmath.NewUint(uint64(lo.If(tc.maxResultCount == 0, 1).Else(tc.maxResultCount))) params := types.DefaultParams() params.Limits.MaxResultCount = &maxResultCount + maxVariables := sdkmath.NewUint(tc.maxVariables) + params.Limits.MaxVariables = &maxVariables if tc.predicateBlacklist != nil { params.Interpreter.PredicatesFilter.Blacklist = tc.predicateBlacklist }