@@ -39,6 +39,7 @@ func TestGRPCAsk(t *testing.T) {
39
39
maxResultCount int
40
40
predicateBlacklist []string
41
41
maxGas uint64
42
+ maxVariables uint64
42
43
predicateCosts map [string ]uint64
43
44
expectedAnswer * types.Answer
44
45
expectedError string
@@ -142,15 +143,20 @@ func TestGRPCAsk(t *testing.T) {
142
143
{
143
144
query : "bank_balances(X, Y)." ,
144
145
maxGas : 3000 ,
145
- expectedError : "out of gas: logic <panic: {ValuePerByte}> (4204 /3000): limit exceeded" ,
146
+ expectedError : "out of gas: logic <panic: {ValuePerByte}> (4222 /3000): limit exceeded" ,
146
147
},
147
148
{
148
149
query : "block_height(X)." ,
149
150
maxGas : 3000 ,
150
151
predicateCosts : map [string ]uint64 {
151
152
"block_height/1" : 10000 ,
152
153
},
153
- expectedError : "out of gas: logic <block_height/1> (12353/3000): limit exceeded" ,
154
+ expectedError : "out of gas: logic <block_height/1> (12371/3000): limit exceeded" ,
155
+ },
156
+ {
157
+ query : "length(List, 100000)." ,
158
+ maxVariables : 1000 ,
159
+ expectedError : "maximum number of variables reached: limit exceeded" ,
154
160
},
155
161
{
156
162
program : "father(bob, 'élodie')." ,
@@ -348,6 +354,8 @@ foo(a4).
348
354
maxResultCount := sdkmath .NewUint (uint64 (lo .If (tc .maxResultCount == 0 , 1 ).Else (tc .maxResultCount )))
349
355
params := types .DefaultParams ()
350
356
params .Limits .MaxResultCount = & maxResultCount
357
+ maxVariables := sdkmath .NewUint (tc .maxVariables )
358
+ params .Limits .MaxVariables = & maxVariables
351
359
if tc .predicateBlacklist != nil {
352
360
params .Interpreter .PredicatesFilter .Blacklist = tc .predicateBlacklist
353
361
}
0 commit comments