Skip to content
Snippets Groups Projects
Commit 97c078d2 authored by Rémi's avatar Rémi
Browse files

Merge branch 'gas_limit_to_max' into 'dev'

Testing framework: set gas_limit to maximum for all operations

See merge request !2568
parents 81a2ec0a ee04c7d5
No related branches found
No related tags found
Loading
Pipeline #854959591 passed
author: lesenechal.remi
description: "\\n\\n"
merge_request: '2568'
title: "Testing framework: set gas_limit to maximum for all operations"
type: fixed
\ No newline at end of file
......@@ -695,7 +695,7 @@ let%expect_test _ =
[%expect
{|
Everything at the top-level was executed.
- test_x exited with value (KT1BRUZeuJogco1SAhPpq7oLVL24YhgzoYwm , { parameter unit ;
- test_x exited with value (KT1E7ftEB5z7eL6SET1dBWbg2Tf1VXaLtHyv , { parameter unit ;
storage
(pair (pair (big_map %metadata string bytes) (set %participants address))
(map %secrets address bool)) ;
......@@ -728,7 +728,7 @@ let%expect_test _ =
run_ligo_good [ "run"; "test"; test "test_read_contract.mligo" ];
[%expect
{|
KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb
KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS
[1 -> "hi"]
Everything at the top-level was executed.
- test_foo exited with value ().
......@@ -861,7 +861,7 @@ let%expect_test _ =
run_ligo_good [ "run"; "test"; test "test_to_json.mligo" ];
[%expect
{|
["typed_address","KT1JezbhJttsXiQpa3oyxqihsPc7cSvJPRQr"]
["typed_address","KT1CHLcGYthioYYsY5dETp1m7rm7FdX9HH1K"]
["record",[[["Label","bar"],["list",[["constant",["string","hello"]],["constant",["string","world"]]]]],[["Label","foo"],["constant",["int","42"]]]]] |}]
(*
......@@ -975,7 +975,7 @@ let%expect_test _ =
let%expect_test _ =
run_ligo_good [ "run"; "test"; test "contract_with_ticket_storage.mligo" ];
[%expect {|
("unforged_ticket" , Some ({amount = 15n ; ticketer = KT1K9myEXyNZH24QQTb44wHRDAXYJE8V4c2y ; value = 0x0202}))
("unforged_ticket" , Some ({amount = 15n ; ticketer = KT1CDHnKFHBMFtyzC92oTfi4Z5wthR4Yk3LW ; value = 0x0202}))
Everything at the top-level was executed.
- test_originate_contract exited with value (). |}];
run_ligo_good [ "run"; "test"; test "contract_with_ticket_param.mligo" ];
......@@ -984,7 +984,7 @@ let%expect_test _ =
- test_transfer_to_contract exited with value (). |}];
run_ligo_good [ "run"; "test"; test "uncurried_contract_with_ticket_storage.mligo" ];
[%expect {|
("unforged_ticket" , Some ({amount = 15n ; ticketer = KT1K9myEXyNZH24QQTb44wHRDAXYJE8V4c2y ; value = 0x0202}))
("unforged_ticket" , Some ({amount = 15n ; ticketer = KT1CDHnKFHBMFtyzC92oTfi4Z5wthR4Yk3LW ; value = 0x0202}))
Everything at the top-level was executed.
- test_originate_contract exited with value (). |}];
run_ligo_good [ "run"; "test"; test "uncurried_contract_with_ticket_param.mligo" ];
......@@ -1005,13 +1005,13 @@ let%expect_test _ =
[%expect
{|
Everything at the top-level was executed.
- test_originate_from_file_relative_path exited with value KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb.
- test_originate_from_file_relative_path exited with value KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS.
- test_originate_from_file_relative_path_w_r_t_imported_file exited with value true. |}];
run_ligo_good [ "run"; "test"; test "test.jsligo" ];
[%expect
{|
Everything at the top-level was executed.
- test_originate_from_file_relative_path exited with value KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb.
- test_originate_from_file_relative_path exited with value KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS.
- test_originate_from_file_relative_path_w_r_t_imported_file exited with value true. |}]
let () = Caml.Sys.chdir pwd
......@@ -1025,13 +1025,13 @@ let%expect_test _ =
[%expect
{|
Everything at the top-level was executed.
- test_originate_from_file_relative_path exited with value KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb.
- test_originate_from_file_relative_path exited with value KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS.
- test_originate_from_file_relative_path_w_r_t_imported_file exited with value true. |}];
run_ligo_good [ "run"; "test"; test "test/a/b/test.jsligo" ];
[%expect
{|
Everything at the top-level was executed.
- test_originate_from_file_relative_path exited with value KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb.
- test_originate_from_file_relative_path exited with value KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS.
- test_originate_from_file_relative_path_w_r_t_imported_file exited with value true. |}]
let () = Caml.Sys.chdir pwd
......@@ -1183,7 +1183,7 @@ let%expect_test _ =
11 | ()
The source address is not an implicit account
KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb |}]
KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS |}]
let%expect_test _ =
run_ligo_bad [ "run"; "test"; bad_test "test_source2.mligo" ];
......@@ -1196,7 +1196,7 @@ let%expect_test _ =
11 | ()
The source address is not an implicit account
KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb |}]
KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS |}]
let%expect_test _ =
run_ligo_bad [ "run"; "test"; bad_test "test_run_types.jsligo" ];
......@@ -1282,7 +1282,7 @@ let%expect_test _ =
^^^^^
19 | let () = Test.log(packed) in
Cannot decompile value KT1Xkee2E7uiKehrW6Yk9hCUUNcK6AfpBUFb of type typed_address (unit ,
Cannot decompile value KT1MoPRoithHNa7i6LYHqeQfZB4oyWThinnS of type typed_address (unit ,
unit) |}]
let () = Caml.Sys.chdir pwd
......
......@@ -15,7 +15,7 @@ let%expect_test _ =
[%expect
{|
Everything at the top-level was executed.
- test exited with value KT1CSXzoZ4oBwAiJ1PPkJgDzWMCEtN45J61t(None). |}]
- test exited with value KT1FkMmuVEwqHBM9SniT3LRAsERV6cdZz9p2(None). |}]
let%expect_test _ =
run_ligo_good
......
......@@ -620,7 +620,7 @@ let bake_ops
Trace.trace_tzresult_lwt ~raise (throw_obj_exc loc calltrace)
@@ Incremental.begin_construction ~policy:ctxt.internals.baker_policy ctxt.raw
in
let aux incr op = Lwt_main.run @@ Incremental.add_operation incr (op incr) in
let aux incr op = Lwt_main.run @@ Incremental.add_operation ~check_size:false incr (op incr) in
match List.fold_result ~f:aux ~init:incr operation with
| Ok incr ->
let last_operations = get_last_operations_result incr in
......@@ -661,7 +661,7 @@ let register_delegate ~raise ~loc ~calltrace (ctxt : context) pkh =
let contract = Tezos_raw_protocol.Alpha_context.Contract.Implicit pkh in
let operation =
Trace.trace_tzresult_lwt ~raise (throw_obj_exc loc calltrace)
@@ Op.delegation ~force_reveal:true (B ctxt.raw) contract (Some pkh)
@@ Op.delegation ~gas_limit:Max ~force_reveal:true (B ctxt.raw) contract (Some pkh)
in
match bake_op ~raise ~loc ~calltrace ctxt operation with
| Success (ctxt, _) -> ctxt
......@@ -679,7 +679,12 @@ let register_constant ~raise ~loc ~calltrace (ctxt : context) ~source ~value =
let hash = Format.asprintf "%a" Tezos_protocol.Protocol.Script_expr_hash.pp hash in
let operation =
Trace.trace_tzresult_lwt ~raise (throw_obj_exc loc calltrace)
@@ Op.register_global_constant ~force_reveal:true (B ctxt.raw) ~source ~value
@@ Op.register_global_constant
~gas_limit:Max
~force_reveal:true
(B ctxt.raw)
~source
~value
in
match bake_op ~raise ~loc ~calltrace ctxt operation with
| Success (ctxt, _) -> hash, ctxt
......@@ -717,6 +722,7 @@ let register_file_constants ~raise ~loc ~calltrace fn (ctxt : context) ~source =
let op =
Trace.trace_tzresult_lwt ~raise (throw_obj_exc loc calltrace)
@@ Op.register_global_constant
~gas_limit:Max
~force_reveal:true
(B ctxt.raw)
~source
......@@ -784,11 +790,10 @@ let transfer ~raise ~loc ~calltrace (ctxt : context) ?entrypoint dst parameter a
@@
(* TODO: fee? *)
let amt = Int64.of_int (Z.to_int amt) in
let gas_limit = Op.Max in
(* TODO: might let user choose here *)
Op.transaction
~force_reveal:true
~gas_limit
~gas_limit:Max
~fee:(Test_tez.of_int 1)
~parameters
?entrypoint
......@@ -823,6 +828,7 @@ let originate_contract
@@ (* TODO : fee ? *)
Op.contract_origination
~force_reveal:true
~gas_limit:Max
(B ctxt.raw)
source
?credit:amt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment