diff --git a/x/logic/keeper/features/bech32_address_2.feature b/x/logic/keeper/features/bech32_address_2.feature index e2745db9..efc982fa 100644 --- a/x/logic/keeper/features/bech32_address_2.feature +++ b/x/logic/keeper/features/bech32_address_2.feature @@ -16,7 +16,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Address"] @@ -39,7 +39,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Hrp", "Address"] @@ -63,7 +63,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Address"] @@ -84,7 +84,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Bech32"] @@ -109,7 +109,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false results: @@ -130,7 +130,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false results: @@ -146,7 +146,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false results: @@ -163,7 +163,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Hrp"] @@ -186,7 +186,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Address"] @@ -207,7 +207,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["X"] @@ -227,7 +227,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Bech32"] @@ -247,7 +247,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Bech32"] @@ -267,7 +267,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Bech32"] @@ -287,7 +287,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Bech32"] @@ -307,7 +307,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Bech32"] @@ -327,7 +327,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Address", "Bech32"] @@ -347,7 +347,7 @@ Feature: bech32_address/2 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Hrp", "Bech32"] diff --git a/x/logic/keeper/features/block_height_1.feature b/x/logic/keeper/features/block_height_1.feature index cf2bc6ef..a7caff9a 100644 --- a/x/logic/keeper/features/block_height_1.feature +++ b/x/logic/keeper/features/block_height_1.feature @@ -16,7 +16,7 @@ Feature: block_height/1 Then the answer we get is: """ yaml height: 100 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Height"] @@ -43,7 +43,7 @@ Feature: block_height/1 Then the answer we get is: """ yaml height: 101 - gas_used: 2223 + gas_used: 6033 answer: has_more: false variables: ["Height"] diff --git a/x/logic/keeper/features/block_time_1.feature b/x/logic/keeper/features/block_time_1.feature index 05d674e8..d9657291 100644 --- a/x/logic/keeper/features/block_time_1.feature +++ b/x/logic/keeper/features/block_time_1.feature @@ -16,7 +16,7 @@ Feature: block_time/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Time"] @@ -44,7 +44,7 @@ Feature: block_time/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2223 + gas_used: 6033 answer: has_more: false variables: ["Time"] diff --git a/x/logic/keeper/features/consult_1.feature b/x/logic/keeper/features/consult_1.feature index b2b4164e..68c062f6 100644 --- a/x/logic/keeper/features/consult_1.feature +++ b/x/logic/keeper/features/consult_1.feature @@ -34,7 +34,7 @@ Feature: consult/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2224 + gas_used: 6034 answer: has_more: false variables: ["Who"] @@ -90,7 +90,7 @@ Feature: consult/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2223 + gas_used: 6033 answer: has_more: false variables: ["X"] @@ -144,7 +144,7 @@ Feature: consult/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2223 + gas_used: 6033 answer: has_more: false variables: ["File"] diff --git a/x/logic/keeper/features/current_output_1.feature b/x/logic/keeper/features/current_output_1.feature index b4063dec..06b4cada 100644 --- a/x/logic/keeper/features/current_output_1.feature +++ b/x/logic/keeper/features/current_output_1.feature @@ -28,7 +28,7 @@ Feature: current_output/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2241 + gas_used: 6150 answer: has_more: false variables: @@ -66,7 +66,7 @@ Feature: current_output/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2248 + gas_used: 6190 answer: has_more: false variables: @@ -104,7 +104,7 @@ Feature: current_output/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2241 + gas_used: 6150 answer: has_more: false variables: @@ -145,7 +145,7 @@ Feature: current_output/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2255 + gas_used: 6164 answer: has_more: false variables: @@ -176,7 +176,7 @@ Feature: current_output/1 Then the answer we get is: """ yaml height: 42 - gas_used: 2607 + gas_used: 6417 answer: has_more: false variables: diff --git a/x/logic/keeper/features/open_3.feature b/x/logic/keeper/features/open_3.feature index 4e26ad9f..d42da376 100644 --- a/x/logic/keeper/features/open_3.feature +++ b/x/logic/keeper/features/open_3.feature @@ -31,7 +31,7 @@ Feature: open/3 Then the answer we get is: """ yaml height: 42 - gas_used: 2223 + gas_used: 6033 answer: has_more: false variables: diff --git a/x/logic/keeper/features/open_4.feature b/x/logic/keeper/features/open_4.feature index 33b99faf..cec3cf88 100644 --- a/x/logic/keeper/features/open_4.feature +++ b/x/logic/keeper/features/open_4.feature @@ -43,7 +43,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2228 + gas_used: 6038 answer: has_more: false variables: ["URI"] @@ -86,7 +86,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2224 + gas_used: 6034 answer: has_more: false variables: ["Chars"] @@ -127,7 +127,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2224 + gas_used: 6034 answer: has_more: false variables: ["Chars"] @@ -149,7 +149,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Stream"] @@ -170,7 +170,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Stream"] @@ -191,7 +191,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Stream"] @@ -212,7 +212,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Stream"] @@ -232,7 +232,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Stream"] @@ -251,7 +251,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Stream"] @@ -270,7 +270,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Resource", "Stream"] @@ -289,7 +289,7 @@ Feature: open/4 Then the answer we get is: """ yaml height: 42 - gas_used: 2222 + gas_used: 6032 answer: has_more: false variables: ["Mode", "Stream"] diff --git a/x/logic/keeper/grpc_query_ask_test.go b/x/logic/keeper/grpc_query_ask_test.go index 2a778242..3d5b8e05 100644 --- a/x/logic/keeper/grpc_query_ask_test.go +++ b/x/logic/keeper/grpc_query_ask_test.go @@ -141,16 +141,16 @@ func TestGRPCAsk(t *testing.T) { }, { query: "bank_balances(X, Y).", - maxGas: 3000, - expectedError: "out of gas: logic (4204/3000): limit exceeded", + maxGas: 3500, + expectedError: "out of gas: logic (5243/3500): limit exceeded", }, { query: "block_height(X).", - maxGas: 3000, + maxGas: 3500, predicateCosts: map[string]uint64{ "block_height/1": 10000, }, - expectedError: "out of gas: logic (12353/3000): limit exceeded", + expectedError: "out of gas: logic (13467/3500): limit exceeded", }, { program: "father(bob, 'élodie').", @@ -351,10 +351,6 @@ foo(a4). if tc.predicateBlacklist != nil { params.Interpreter.PredicatesFilter.Blacklist = tc.predicateBlacklist } - if tc.maxGas != 0 { - maxGas := sdkmath.NewUint(tc.maxGas) - params.Limits.MaxGas = &maxGas - } if tc.predicateCosts != nil { predicateCosts := make([]types.PredicateCost, 0, len(tc.predicateCosts)) for predicate, cost := range tc.predicateCosts { @@ -370,6 +366,12 @@ foo(a4). So(err, ShouldBeNil) + if tc.maxGas != 0 { + testCtx.Ctx = testCtx.Ctx.WithGasMeter(storetypes.NewGasMeter(tc.maxGas)) + } else { + testCtx.Ctx = testCtx.Ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) + } + Convey("and given a query with program and query to grpc", func() { queryHelper := baseapp.NewQueryServerTestHelper(testCtx.Ctx, encCfg.InterfaceRegistry) types.RegisterQueryServiceServer(queryHelper, logicKeeper) diff --git a/x/logic/keeper/grpc_query_params_test.go b/x/logic/keeper/grpc_query_params_test.go index 5c2976a3..032da10a 100644 --- a/x/logic/keeper/grpc_query_params_test.go +++ b/x/logic/keeper/grpc_query_params_test.go @@ -40,7 +40,6 @@ func TestGRPCParams(t *testing.T) { types.WithVirtualFilesWhitelist([]string{"file2"}), ), types.NewLimits( - types.WithMaxGas(math.NewUint(1)), types.WithMaxSize(math.NewUint(2)), types.WithMaxResultCount(math.NewUint(3)), types.WithMaxUserOutputSize(math.NewUint(4)), diff --git a/x/logic/types/params_test.go b/x/logic/types/params_test.go index dad490d6..a1791a84 100644 --- a/x/logic/types/params_test.go +++ b/x/logic/types/params_test.go @@ -36,7 +36,6 @@ func TestValidateParams(t *testing.T) { types.WithVirtualFilesWhitelist([]string{"file2"}), ), types.NewLimits( - types.WithMaxGas(math.NewUint(1)), types.WithMaxSize(math.NewUint(2)), types.WithMaxResultCount(math.NewUint(3)), types.WithMaxUserOutputSize(math.NewUint(4)),