diff --git a/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml b/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml index 070d69de6c603d06ab5eb31d640a0fbf9ffc251d..9dbb1ba55ba8e8cd49ba094e15a89039d5ba94b8 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml @@ -274,11 +274,13 @@ module V (L : LIB) = struct ~rollup_id op = let* old_state = input ~public:true @@ Input.bool old_state in let* new_state = input ~public:true @@ Input.bool new_state in - let* _fee = + let* (_fee : scalar repr) = input ~public:true @@ E.((fee_encoding ~safety:Bounded_e.Unsafe).input) fee in - let* _exit_validity = input ~public:true @@ Input.bool exit_validity in + let* (_exit_validity : bool repr) = + input ~public:true @@ Input.bool exit_validity + in let* rollup_id = input ~public:true @@ E.(tezos_pkh_encoding.input) rollup_id in @@ -291,7 +293,7 @@ module V (L : LIB) = struct let predicate_batch ~old_state ~new_state ~fees ~rollup_id ops = let* old_state = input ~public:true @@ Input.bool old_state in let* new_state = input ~public:true @@ Input.bool new_state in - let* _fees = + let* (_fees : scalar repr) = input ~public:true @@ E.((amount_encoding ~safety:Bounded_e.Unsafe).input) fees in @@ -312,7 +314,7 @@ module V (L : LIB) = struct let predicate_fees ~old_state ~new_state ~fees = let* old_state = input ~public:true @@ Input.bool old_state in let* new_state = input ~public:true @@ Input.bool new_state in - let* _fees = + let* (_fees : scalar repr) = input ~public:true @@ E.((amount_encoding ~safety:Bounded_e.Unsafe).input) fees in diff --git a/src/proto_alpha/lib_protocol/test/helpers/incremental.ml b/src/proto_alpha/lib_protocol/test/helpers/incremental.ml index da83665012c41cc6d45f10a8bb77e49d68b3650a..506b8e617094e7ac389e87c8ac91b1180687fb39 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/incremental.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/incremental.ml @@ -277,5 +277,5 @@ let finalize_block st = let assert_validate_operation_fails expect_failure op block = let open Lwt_result_syntax in let* i = begin_construction block in - let* _i = validate_operation ~expect_failure i op in + let* (_i : incremental) = validate_operation ~expect_failure i op in return_unit diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml index c284eb3552aaab8f039658b62f8137fd6394e276..170b01f9c602b9fd8d30d830a2bdb860f56700c6 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml @@ -92,7 +92,7 @@ let test_seed_no_commitment () = () in let* b = check_seed b initial_seed in - let* _ = bake_and_check_seed b seeds in + let* (_ : Block.t) = bake_and_check_seed b seeds in return_unit (** Baking [blocks_per_commitment] blocks without a [seed_nonce_hash] diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml index 8d6916166c85212366482d7f334fe35e921b5948..d5f13a418b5c3a990d10f24f01174f983eb3fd25 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml @@ -165,7 +165,7 @@ module Legacy_patch_test (Patches : LEGACY_SCRIPT_PATCHES) : let* block, _contracts = Context.init3 () in let* inc = Incremental.begin_construction block in let ctxt = Incremental.alpha_ctxt inc in - let* _ = + let* _code, _ctxt = Lwt.map Environment.wrap_tzresult @@ Script_ir_translator.parse_code ~elab_conf:Script_ir_translator_config.(make ~legacy:false ()) diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml index 711a6974ec7a05869e3fa190f6614fd3073a7afe..37103dd9ebcd5422a3bc26d3fd22446951d702c3 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml @@ -717,7 +717,7 @@ let test_create_contract_and_send_tickets () = (* Add a green ticket to the lazy storage at index 1 and send it to the green ticket-receiver *) let* b = test b @@ TM.add_lazy ~index:1 ~content:"Green" ~amount:10 in - let* _b = + let* (_b : Block.t) = test b @@ TM.send_lazy ~index:1 ~recipient:ticket_receiver_green_2 in return () @@ -737,7 +737,9 @@ let test_add_remove_from_lazy_storage () = (* Remove the big-map. *) let* b = tm b TM.remove_all_lazy in (* Add back a ticket at index 1. *) - let* _b = tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:10 in + let* (_b : Block.t) = + tm b @@ TM.add_lazy ~index:1 ~content:"Red" ~amount:10 + in return () (** Test send to self and replace big-map. *) @@ -750,7 +752,7 @@ let test_send_self_replace_big_map () = let* b = tm b @@ TM.add_lazy ~index:3 ~content:"Blue" ~amount:1 in let* b = tm b @@ TM.send_self_replace_big_map in let* b = tm b @@ TM.send_self_replace_big_map in - let* _b = tm b @@ TM.send_self_replace_big_map in + let* (_b : Block.t) = tm b @@ TM.send_self_replace_big_map in return () (** Test add to and remove from strict storage. *) @@ -766,7 +768,7 @@ let test_add_remove_strict () = (* Remove strict tickets *) let* b = tm b @@ TM.remove_strict in - let* _b = tm b @@ TM.add_strict ~content:"Red" ~amount:1 in + let* (_b : Block.t) = tm b @@ TM.add_strict ~content:"Red" ~amount:1 in return () (** Test mixed operations. *) @@ -782,7 +784,7 @@ let test_mixed_operations () = let* b = tm b @@ TM.add_lazy ~index:3 ~content:"Blue" ~amount:1 in (* Remove strict and lazy *) let* b = tm b @@ TM.remove_strict in - let* _b = tm b @@ TM.remove_all_lazy in + let* (_b : Block.t) = tm b @@ TM.remove_all_lazy in return () let tests = diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml index e7c455a04999b7b9664901dc9a5b1b0fe5e84362..03feece5006bf870751de7766371dadeb7131794 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml @@ -255,7 +255,7 @@ let test_unparsable_script () = in (* Ensure that the application fails with [Ill_typed_contract]. *) let* i = Incremental.begin_construction b in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure:(function | Environment.Ecoproto_error (Script_tc_errors.Ill_typed_contract _) @@ -296,7 +296,7 @@ let test_unparsable_script () = in (* Ensure that the operation is valid but the application fails with [Lazy_script_decode]. *) - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure:(function | [Environment.Ecoproto_error Script.Lazy_script_decode] -> return_unit diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml index 6d574b5af9e92843024ad466633894f45d03cc99..f233834607ebff63d2fe98d6d1434a332ff656c3 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml @@ -233,7 +233,7 @@ let test_effectiveness () = contract_dst Tez.zero in - let+ _inc = Incremental.add_operation inc op in + let+ (_inc : Incremental.t) = Incremental.add_operation inc op in () let tests = diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml index 70ce655b20d152ef159ad878fd7c3a7fa2c5337c..c979c297afa3a84064f0440c27388d2d0f8c038b 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -691,7 +691,9 @@ let test_publish_fails_on_backtrack () = return_unit | _ -> failwith "It should have failed with [Sc_rollup_staker_backtracked]" in - let* _ = Incremental.add_operation ~expect_apply_failure i operation2 in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_apply_failure i operation2 + in return_unit (** [test_cement_fails_on_conflict] creates a rollup and then publishes @@ -729,7 +731,9 @@ let test_cement_fails_on_conflict () = return_unit | _ -> failwith "It should have failed with [Sc_rollup_disputed]" in - let* _ = Incremental.add_operation ~expect_apply_failure i cement_op in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_apply_failure i cement_op + in return_unit let commit_and_cement_after_n_bloc ?expect_apply_failure block contract rollup n @@ -744,7 +748,9 @@ let commit_and_cement_after_n_bloc ?expect_apply_failure block contract rollup n let* i = Incremental.begin_construction b in let* i, hash = hash_commitment i commitment in let* cement_op = Op.sc_rollup_cement (I i) contract rollup hash in - let* _ = Incremental.add_operation ?expect_apply_failure i cement_op in + let* (_ : Incremental.t) = + Incremental.add_operation ?expect_apply_failure i cement_op + in return_unit (** [test_challenge_window_period_boundaries] checks that cementing a commitment @@ -1536,7 +1542,9 @@ let test_inbox_max_number_of_messages_per_commitment_period () = "It should have failed with \ [Sc_rollup_max_number_of_messages_reached_for_commitment_period" in - let* _incr = Incremental.add_operation ~expect_apply_failure incr op in + let* (_incr : Incremental.t) = + Incremental.add_operation ~expect_apply_failure incr op + in return_unit let add_op block op = @@ -1593,7 +1601,7 @@ let test_timeout () = let game_index = Sc_rollup.Game.Index.make pkh1 pkh2 in (* Testing to send a timeout before it's allowed. There is one block left before timeout is allowed, that is, the current block. *) - let* _incr = + let* (_incr : Incremental.t) = let expected_block_left = 0l in let expect_apply_failure = function | Environment.Ecoproto_error @@ -1859,7 +1867,9 @@ let test_dissection_during_final_move () = return_unit | _ -> failwith "It should have failed with [Dissecting_during_final_move]" in - let* _incr = Incremental.add_operation ~expect_apply_failure incr p2_op in + let* (_incr : Incremental.t) = + Incremental.add_operation ~expect_apply_failure incr p2_op + in return_unit let init_arith_state ~boot_sector = diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml index 18965a83f8bdd24ba9040e701bb20161b9fb79e4..7c7bcb3c799a4d7c5062506570970b6e124f494f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml @@ -168,7 +168,7 @@ let transfer ?expect_apply_failure b ~from ~to_ ~param ~entrypoint = let test_transfer_to_bad_sc_rollup_address () = let* b, c, contract, _rollup = context_init "unit" in let not_an_sc_rollup_address = {|"scr1HLXM32GacPNDrhHDLAssZG88eWqCUbyL"|} in - let* _b = + let* (_b : Block.t) = transfer b ~from:c @@ -195,7 +195,7 @@ let test_transfer_to_bad_sc_rollup_address () = let test_transfer_to_unknown_sc_rollup_address () = let* b, c, contract, _rollup = context_init "unit" in let unknown_sc_rollup_address = {|"scr1HLXM32GacPNDrhHDLAssZG88eWqCUbyLF"|} in - let* _b = + let* (_b : Block.t) = transfer b ~from:c @@ -219,7 +219,7 @@ let test_transfer_to_unknown_sc_rollup_address () = let test_transfer_to_wrongly_typed_sc_rollup () = let* b, c, contract, rollup = context_init "unit" in let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in - let* _b = + let* (_b : Block.t) = transfer b ~from:c @@ -243,7 +243,7 @@ let test_transfer_to_wrongly_typed_sc_rollup () = let test_transfer_non_zero_amount () = let* b, c, contract, rollup = context_init "int" in let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in - let* _b = + let* (_b : Block.t) = transfer b ~from:c @@ -270,7 +270,7 @@ let test_transfer_non_zero_amount_via_entrypoint () = let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup ^ "%use_this_one") in - let* _b = + let* (_b : Block.t) = transfer b ~from:c @@ -328,7 +328,7 @@ let test_transfer_works () = let test_transfer_zero_amount_ticket () = let* b, c, contract, rollup = context_init "ticket string" in let param = Format.sprintf "%S" (Sc_rollup.Address.to_b58check rollup) in - let* _b = + let* (_b : Block.t) = transfer b ~from:c diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml index c31af4759b932cf1e9da7053e48b906c11e7d263..d1f81ea918d502193d51858a1055ffb3071103f3 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml @@ -827,7 +827,9 @@ let test_storage_fees_and_internal_operation () = in (* Ensure success when the initial balance of the originated contract is sufficient to pay storage fees. *) - let+ _ = originate_and_call ~initial_state ~initial_amount:Tez.one_cent in + let+ (_ : State.t) = + originate_and_call ~initial_state ~initial_amount:Tez.one_cent + in () let tests = diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml index 69aea03cb08399b6e4847c46d9d7ea05273a09af..496d486b41703bb99efbb304c0b31a1bcf5a80b1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml @@ -3521,7 +3521,7 @@ module Rejection = struct l2_accounts in let time = time () in - let* _ = C.commit ~time store in + let* (_ : Context_hash.t) = C.commit ~time store in return store (** Regression test to ensure that we can reject a commitment where the @@ -4034,7 +4034,9 @@ let test_state_message_storage_preallocation () = let ctxt = Incremental.alpha_ctxt i in let message, _ = Tx_rollup_message.make_batch "bogus" in let message_hash = Tx_rollup_message_hash.hash_uncarbonated message in - let _inbox_hash = Tx_rollup_inbox.Merkle.merklize_list [message_hash] in + let (_inbox_hash : Tx_rollup_inbox.Merkle.root) = + Tx_rollup_inbox.Merkle.merklize_list [message_hash] + in let state = Tx_rollup_state.initial_state ~pre_allocated_storage:Z.zero in let occupied_storage_before = Tx_rollup_state.Internal_for_tests.get_occupied_storage state diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml index 8a2c400c9abab72b231b7f4f83eb82f0fa43819d..0f6d37978341f34fcdd74777f50b776682ac3d67 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml @@ -1473,7 +1473,7 @@ let test_conflict_too_many_proposals () = Incremental.validate_operation current_block_state op_in_current_block in let* op = Op.proposals (B block) proposer [protos.(0)] in - let* _i = + let* (_i : Incremental.t) = Incremental.validate_operation ~expect_failure:(conflicting_proposals __LOC__) current_block_state @@ -1493,7 +1493,7 @@ let test_conflicting_proposal () = Incremental.validate_operation current_block_state op_in_current_block in let* op = Op.proposals (B block) proposer [proposal] in - let* _i = + let* (_i : Incremental.t) = Incremental.validate_operation ~expect_failure:(conflicting_proposals __LOC__) current_block_state @@ -1501,7 +1501,7 @@ let test_conflicting_proposal () = in let proposal' = protos.(1) in let* op' = Op.proposals (B block) proposer [proposal'] in - let* _i = + let* (_i : Incremental.t) = Incremental.validate_operation ~expect_failure:(conflicting_proposals __LOC__) current_block_state @@ -1634,14 +1634,14 @@ let test_too_many_proposals_in_one_operation () = let open Lwt_result_syntax in let* b0, proposer0 = context_init1 () in let protos = Array.to_list protos in - let* _ = - try - let* _ = Op.proposals (B b0) proposer0 protos in + Lwt.catch + (fun () -> + let* (_ : packed_operation) = Op.proposals (B b0) proposer0 protos in failwith - "Encoding of proposals operation with too many proposals should fail" - with Data_encoding.Binary.(Write_error List_invalid_length) -> return_unit - in - return_unit + "Encoding of proposals operation with too many proposals should fail") + (function + | Data_encoding.Binary.(Write_error List_invalid_length) -> return_unit + | exn -> Lwt.fail exn) (* Bake blocks with various valid Proposals operations, and observe that their effects are correctly applied. *) @@ -1838,7 +1838,7 @@ let test_conflicting_ballot () = Incremental.validate_operation current_block_state op_in_current_block in let* op = Op.ballot (B block) voter proposal Vote.Nay in - let* _i = + let* (_i : Incremental.t) = Incremental.validate_operation ~expect_failure:(conflicting_ballot __LOC__) current_block_state diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml index e13d8fdd54a7bc648d281fdd2b7948a0939385a0..ce91e84403782b72d017300cc1e625f333e6bf3d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml @@ -97,7 +97,7 @@ let test_disable_feature_flag () = ~init_state:Operator.init_state ~nb_ops:1 in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_failure: (check_proto_error Validate_errors.Manager.Zk_rollup_feature_disabled) @@ -183,7 +183,7 @@ let test_origination_negative_nb_ops () = ~nb_ops:(-1) in let* i = Incremental.begin_construction ctxt in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure: (check_proto_error Zk_rollup_apply.Zk_rollup_negative_nb_ops) @@ -224,7 +224,7 @@ let test_originate_two_rollups () = ~init_state:Operator.init_state ~nb_ops:1 in - let* _b = Block.bake ~operation ctxt in + let* (_b : Block.t) = Block.bake ~operation ctxt in assert (zk_rollup1 <> zk_rollup2) ; return_unit @@ -265,7 +265,7 @@ let test_append_out_of_range_op_code () = ~zk_rollup ~ops:[no_ticket {l2_op with op_code = 1}] in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure: (check_proto_error (Zk_rollup_storage.Zk_rollup_invalid_op_code 1)) @@ -291,7 +291,7 @@ let test_append_external_deposit () = ~ops: [no_ticket {l2_op with price = {l2_op.price with amount = Z.of_int 10}}] in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure: (check_proto_error Zk_rollup.Errors.Deposit_as_external) @@ -495,7 +495,7 @@ let test_append_errors () = ~zk_rollup ~ops:[({op with price}, Some ticket)] in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure: (check_proto_error Zk_rollup.Errors.Invalid_deposit_amount) @@ -511,7 +511,7 @@ let test_append_errors () = ~zk_rollup ~ops:[no_ticket {op with price}] in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure: (check_proto_error Zk_rollup.Errors.Invalid_deposit_amount) @@ -532,7 +532,7 @@ let test_append_errors () = ~zk_rollup ~ops:[({op with price}, Some ticket)] in - let* _i = + let* (_i : Incremental.t) = Incremental.add_operation ~expect_apply_failure: (check_proto_error Zk_rollup.Errors.Invalid_deposit_ticket) @@ -725,7 +725,7 @@ let test_invalid_deposit () = let* constants = Context.get_constants (I i) in constants.parametric.tx_rollup.max_ticket_payload_size |> return in - let* _i = + let* (_i : Incremental.t) = let payload_size = Saturation_repr.safe_int (contents_size + 216) in Incremental.add_operation ~expect_apply_failure: diff --git a/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml index 46369c9f3f8062712f1cf6f63a03b548efcd72cf..7c39adddd6a6e47fedf603921bd2902b328156ce 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml @@ -85,7 +85,9 @@ module WASM_P : let produce_proof context tree step = let open Lwt_syntax in let* context = Context_binary.add_tree context [] tree in - let _hash = Context_binary.commit ~time:Time.Protocol.epoch context in + let* (_hash : Context_hash.t) = + Context_binary.commit ~time:Time.Protocol.epoch context + in let index = Context_binary.index context in match Context_binary.Tree.kinded_key tree with | Some k -> @@ -215,7 +217,7 @@ let should_boot_computation_kernel () = checked_set_input ~loc:__LOC__ context (arbitrary_input 0 "test") s in (* running until waiting for input *) - let* _s = eval_until_set_input context s in + let* (_s : Prover.state) = eval_until_set_input context s in return_unit let tests = diff --git a/src/proto_alpha/lib_protocol/test/integration/test_storage.ml b/src/proto_alpha/lib_protocol/test/integration/test_storage.ml index 60ed66fbc0c54cbff3ea9563776d8455a5b6e994..03485707c3ef3eb2c078f4f36e3aa618a8ec01e0 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_storage.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_storage.ml @@ -128,7 +128,7 @@ let create_indexed_subcontext_int64 let must_failwith f_prog error = try - let _ = f_prog () in + let () = f_prog () in Alcotest.fail "Unexpected successful result" with exc -> if exc = error then Lwt.return_unit @@ -141,8 +141,12 @@ let must_failwith f_prog error = let test_register_single_data () = let f_prog () = let context = create_context "context1" in - let _single_data = create_single_data_storage "single_data" context in - create_single_data_storage "single_data" context + (create_single_data_storage "single_data" context + :> (module Single_data_storage)) + |> ignore ; + (create_single_data_storage "single_data" context + :> (module Single_data_storage)) + |> ignore in let error = Invalid_argument @@ -159,9 +163,13 @@ let test_register_named_subcontext () = let f_prog () = let context = create_context "context2" in let subcontext = create_subcontext "sub_context" context in - let _single_data = create_single_data_storage "error_register" subcontext in + (create_single_data_storage "error_register" subcontext + :> (module Single_data_storage)) + |> ignore ; let subcontext = create_subcontext "error_register" subcontext in - create_single_data_storage "single_data2" subcontext + (create_single_data_storage "single_data2" subcontext + :> (module Single_data_storage)) + |> ignore in let error = Invalid_argument @@ -177,8 +185,11 @@ let test_register_named_subcontext () = let test_register_indexed_subcontext () = let f_prog () = let context = create_context "context3" in - let _ = create_single_data_storage "single_value" context in - create_indexed_subcontext_int32 context + (create_single_data_storage "single_value" context + :> (module Single_data_storage)) + |> ignore ; + (create_indexed_subcontext_int32 context :> (module Data_set_storage)) + |> ignore in let error = Invalid_argument @@ -195,8 +206,10 @@ let test_register_indexed_subcontext () = let test_register_indexed_subcontext_2 () = let f_prog () = let context = create_context "context4" in - let _ = create_indexed_subcontext_int32 context in - create_indexed_subcontext_int64 context + (create_indexed_subcontext_int32 context :> (module Data_set_storage)) + |> ignore ; + (create_indexed_subcontext_int64 context :> (module Data_set_storage)) + |> ignore in let error = Invalid_argument diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml b/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml index 6f7af4cd1c5969fb19e6bc5116376cd7c2c71f13..ab2bd849f25b9cde5d68617f3778420f1a5c85d8 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/manager_operation_helpers.ml @@ -327,7 +327,7 @@ let self_delegate block pkh = let* block = Block.bake block ~operation in let* del_opt_new = Context.Contract.delegate_opt (B block) contract in let* del = Assert.get_some ~loc:__LOC__ del_opt_new in - let+ _ = Assert.equal_pkh ~loc:__LOC__ del pkh in + let+ () = Assert.equal_pkh ~loc:__LOC__ del pkh in block let delegation block source delegate = @@ -344,7 +344,7 @@ let delegation block source delegate = let* block = Block.bake block ~operation in let* del_opt_new = Context.Contract.delegate_opt (B block) contract_source in let* del = Assert.get_some ~loc:__LOC__ del_opt_new in - let+ _ = Assert.equal_pkh ~loc:__LOC__ del delegate_pkh in + let+ () = Assert.equal_pkh ~loc:__LOC__ del delegate_pkh in block let originate_tx_rollup block rollup_account = @@ -1385,7 +1385,7 @@ let observe ~only_validate ~mode ctxt_pre ctxt_post op = (if only_validate then "Balance update (=)" else "Balance update (<=)") Tez.pp in - let* _ = b_cmp b_out b_expected in + let* () = b_cmp b_out b_expected in let _ = Assert.equal Z.equal @@ -1525,7 +1525,7 @@ let validate_ko_diagnostic ?(mode = Construction) (infos : infos) ops infos.ctxt.block ~mempool_mode:(mempool_mode_of mode) in - let* _ = add_operations ~expect_failure i ops in + let* (_ : Incremental.t) = add_operations ~expect_failure i ops in return_unit | Application -> ( let*! res = diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml index 1431e708f43eb61e27b595c446ed5dcfe1a56a87..2e5ef078bcc4ec7fd69ebb48f7c49acf05e71fda 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml @@ -108,7 +108,7 @@ let positive_tests = let open Lwt_result_syntax in let* infos = init_ctxt ctxt_req in let* op = select_op operation_req infos in - let* _infos = wrap_mode ~only_validate:true infos [op] mode in + let* (_infos : infos) = wrap_mode ~only_validate:true infos [op] mode in return_true) (** Under 1M restriction, neither a block nor a prevalidator's valid @@ -146,7 +146,7 @@ let two_op_from_same_manager_tests = let* infos = init_ctxt ctxt_req in let* op1 = select_op operation_req infos in let* op2 = select_op operation_req2 infos in - let* _ = validate_ko_diagnostic ~mode infos [op1; op2] expect_failure in + let* () = validate_ko_diagnostic ~mode infos [op1; op2] expect_failure in return_true) (** Under 1M restriction, a batch of two operations cannot be replaced @@ -175,8 +175,8 @@ let batch_is_not_singles_tests = let* batch = Op.batch_operations ~source (B infos.ctxt.block) [op1; op2] in - let* _ = only_validate_diagnostic ~mode infos [batch] in - let* _ = validate_ko_diagnostic ~mode infos [op1; op2] expect_failure in + let* (_ : infos) = only_validate_diagnostic ~mode infos [batch] in + let* () = validate_ko_diagnostic ~mode infos [op1; op2] expect_failure in return_true) (** The applications of two covalid operations in a certain context @@ -213,8 +213,8 @@ let conflict_free_tests = } in let* op2 = select_op operation_req' infos2 in - let* _ = only_validate_diagnostic ~mode infos [op1; op2] in - let* _ = only_validate_diagnostic ~mode infos [op2; op1] in + let* (_ : infos) = only_validate_diagnostic ~mode infos [op1; op2] in + let* (_ : infos) = only_validate_diagnostic ~mode infos [op2; op1] in return_true) open Lib_test.Qcheck2_helpers diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml index 8e266096c096f6fecb619d94dbab5f5fed17c9d9..c2fb1e2a55b936ffe26e35579eb652f933e8ea8e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml @@ -112,7 +112,7 @@ let covalid_permutation_and_bake ks nb_bootstrap = |> List.rev_filter is_not_preendorsement in (* Ensure that we can validate and apply this permutation *) - let* _b = + let* (_b : Block.t) = Block.bake ~allow_manager_failures:true state.block ~operations in loop (pred n) diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml index 2d16cdda3096dbee56cbfc4219d686c705a65727..d5e81108f4266c0124aad7ff958ac9c2f9fbe038 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml @@ -437,7 +437,7 @@ let test_validate infos kind = } infos in - let* _ = validate_diagnostic infos [op] in + let* (_ : infos) = validate_diagnostic infos [op] in return_unit (** Fee payment that emptying a self_delegated implicit. *) @@ -457,7 +457,7 @@ let test_emptying_self_delegate infos kind = } infos in - let* _ = only_validate_diagnostic infos [op] in + let* (_ : infos) = only_validate_diagnostic infos [op] in return_unit (** Minimum gas cost to pass the validation: @@ -484,7 +484,7 @@ let test_empty_undelegate infos kind = } infos in - let* _ = only_validate_diagnostic infos [op] in + let* (_ : infos) = only_validate_diagnostic infos [op] in return_unit (** No gas consumer with the minimal gas limit for manager operations @@ -558,14 +558,11 @@ let test_feature_flags infos kind = infos in let flags = infos.flags in - let* () = - if is_disabled flags kind then - validate_ko_diagnostic infos [op] (flag_expect_failure flags) - else - let* _ = validate_diagnostic infos [op] in - return_unit - in - return_unit + if is_disabled flags kind then + validate_ko_diagnostic infos [op] (flag_expect_failure flags) + else + let* (_ : infos) = validate_diagnostic infos [op] in + return_unit let tests = let mk_default () = default_init_ctxt () in diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml index 4709f1fffb5052631dde4f407d426ab3caa9447e..beff404e811fc454f8d59e9d81107089a4128f9f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml @@ -298,11 +298,21 @@ let batch_incons_counters infos kind1 kind2 = err in let* i = Incremental.begin_construction infos.ctxt.block in - let* _ = Incremental.add_operation ~expect_failure i batch_same in - let* _ = Incremental.add_operation ~expect_failure i batch_in_the_future in - let* _ = Incremental.add_operation ~expect_failure i batch_missing_one in - let* _ = Incremental.add_operation ~expect_failure i batch_inverse in - let* _ = Incremental.add_operation ~expect_failure i batch_in_the_past in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_same + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_in_the_future + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_missing_one + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_inverse + in + let* (_ : Incremental.t) = + Incremental.add_operation ~expect_failure i batch_in_the_past + in return_unit (** A batch that consumes all the balance for fees can only face the total @@ -361,7 +371,9 @@ let batch_emptying_balance_in_the_middle infos kind1 kind2 = Error_monad.pp_print_trace err in - let* _ = Incremental.add_operation i case1 ~expect_failure in + let* (_ : Incremental.t) = + Incremental.add_operation i case1 ~expect_failure + in return_unit (** A batch that consumes all the balance for fees only at the end of @@ -417,8 +429,8 @@ let batch_empty_at_end infos kind1 kind2 = (Context.B infos.ctxt.block) [reveal; op_case2; op2_case2] in - let* _ = validate_diagnostic infos [case2] in - let* _ = validate_diagnostic infos [case3] in + let* (_ : infos) = validate_diagnostic infos [case2] in + let* (_ : infos) = validate_diagnostic infos [case3] in return_unit (** Simple reveal followed by a transaction. *) @@ -454,8 +466,8 @@ let batch_reveal_transaction infos = (Context.B infos.ctxt.block) [reveal; transaction] in - let* _i = Incremental.begin_construction infos.ctxt.block in - let* _ = validate_diagnostic infos [batch] in + let* (_i : Incremental.t) = Incremental.begin_construction infos.ctxt.block in + let* (_ : infos) = validate_diagnostic infos [batch] in return_unit (** A batch of manager operation must not exceed the initial available gas in the block. *) @@ -539,9 +551,15 @@ let batch_exceeding_block_gas ~mempool_mode infos kind1 kind2 = Error_monad.pp_print_trace err in - let* _ = Incremental.add_operation i case1 ~expect_failure in - let* _ = Incremental.add_operation i case3 ~expect_failure in - let* _ = Incremental.add_operation i case2 ~expect_failure in + let* (_ : Incremental.t) = + Incremental.add_operation i case1 ~expect_failure + in + let* (_ : Incremental.t) = + Incremental.add_operation i case3 ~expect_failure + in + let* (_ : Incremental.t) = + Incremental.add_operation i case2 ~expect_failure + in return_unit let make_tztest_batched ?(fmt = Format.std_formatter) name test subjects diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/validate_helpers.ml b/src/proto_alpha/lib_protocol/test/integration/validate/validate_helpers.ml index 7c399cf014af490e0f4c52c9fac04fbe1166ecb1..9515b72cfa0950362cd1bbdf8770b0fe30b26580 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/validate_helpers.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/validate_helpers.ml @@ -384,7 +384,7 @@ let delegates_of_block block = let sequential_validate ?(mempool_mode = true) block operations = let open Lwt_result_syntax in let* inc = Incremental.begin_construction ~mempool_mode block in - let* _inc = + let* (_inc : Incremental.t) = List.fold_left_es (fun acc op -> Incremental.validate_operation acc op) inc diff --git a/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml b/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml index f17af60c8e9a932c039d4b3f2ea16609ba87f2a7..5c38346b763fb3aad4b451ac0315778778f1c54a 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml @@ -244,7 +244,9 @@ let machine_validation_tests = extract_qcheck_tzresult (let invariant = validate_consistency in let* state, env = ValidationMachine.build ~invariant specs in - let* _ = ValidationMachine.run ~invariant scenario env state in + let* (_ : ValidationMachine.t) = + ValidationMachine.run ~invariant scenario env state + in return_unit)); QCheck2.Test.make ~count:10 @@ -255,7 +257,9 @@ let machine_validation_tests = extract_qcheck_tzresult (let invariant = validate_storage in let* state, env = ConcreteMachine.build ~invariant specs in - let* _ = ConcreteMachine.run ~invariant scenario env state in + let* (_ : Block.t) = + ConcreteMachine.run ~invariant scenario env state + in return_unit)); QCheck2.Test.make ~count:50_000 @@ -266,7 +270,9 @@ let machine_validation_tests = extract_qcheck_tzresult (let invariant = positive_pools in let state, env = SymbolicMachine.build ~invariant specs in - let _ = SymbolicMachine.run ~invariant scenario env state in + let (_ : SymbolicMachine.t) = + SymbolicMachine.run ~invariant scenario env state + in return_unit)); ] @@ -282,7 +288,7 @@ let economic_tests = (Liquidity_baking_generator.gen_adversary_scenario 1_000_000 1_000_000 50) (fun (specs, attacker, scenario) -> let state, env = SymbolicMachine.build ~subsidy:0L specs in - let _ = + let (_ : SymbolicMachine.t) = run_and_check (one_balance_decreases attacker env) scenario env state in true); @@ -293,7 +299,7 @@ let economic_tests = (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 50) (fun (specs, scenario) -> let state, env = SymbolicMachine.build ~subsidy:0L specs in - let _ = + let (_ : SymbolicMachine.t) = run_and_check (is_remove_liquidity_consistent env) scenario env state in true); @@ -304,13 +310,13 @@ let economic_tests = (Liquidity_baking_generator.gen_scenario 1_000_000 1_000_000 50) (fun (specs, scenario) -> let state, env = SymbolicMachine.build ~subsidy:0L specs in - let _ = + let (_ : SymbolicMachine.t) = run_and_check (is_share_price_increasing env) scenario env state in true); ] -let _ = +let () = let open Lib_test.Qcheck2_helpers in Alcotest.run "protocol > pbt > liquidity baking" diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml b/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml index 119cc368292d8ce8ab022a1de70c56f892927575..6e6e7f756f72588da8175601cd48aec908d38849 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml @@ -327,7 +327,7 @@ let test_find_existing = int_map_test "Find all elements" @@ fun map -> let ctxt = unsafe_new_context () in let* kvs, _ = CM.to_list ctxt map in - let* _ = + let* (_ : CM.context) = List.fold_left_e (fun ctxt (k, v) -> let* v_opt, ctxt = CM.find ctxt k map in diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml b/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml index 0d2c865622190cd893f71933438c512572eb816e..e0439f6b085ee8cfae6347cee969f314da2f47d3 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml @@ -838,7 +838,7 @@ module Tree_inbox = struct let commit_tree store key tree = let open Lwt_syntax in let* store = Store.add_tree store key tree in - let* _ = Store.commit ~time:Time.Protocol.epoch store in + let* (_ : Context_hash.t) = Store.commit ~time:Time.Protocol.epoch store in return () let lookup_tree store hash = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml b/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml index fd5af2672971057e40b25079e9aedd79fe4f7df4..77cda1e31232ffc04f3431891dab8d44bd2e72c8 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml @@ -238,7 +238,7 @@ module Test_Big_map = struct let* kvs1 = check_key_values ~loc:__LOC__ ~num_elements:20 () in let* kvs2 = check_key_values ~loc:__LOC__ ~num_elements:20 ~length:100 () in let* () = assert_equal_key_values ~loc:__LOC__ kvs1 kvs2 in - let* _ = + let* (_ : _ list) = check_key_values ~loc:__LOC__ ~num_elements:100 ~offset:100 ~length:1 () in (* Offset greater than the length. *) diff --git a/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml index 86b65ecf2b934f0eed9b5041ad17b4d9eccf92e8..4d1a15287756e1016f514738c6ecabd23b9bbb2a 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml @@ -53,13 +53,13 @@ let test_destruct_sc_bond_id_repr () = | Some id -> Ok (Bond_id_repr.Sc_rollup_bond_id id) | None -> Error "Not an sc address" in - let* _ = + let* () = assert_bond_id_result_equal ~loc:__LOC__ (destruct sc_rollup_address1) (sc_bond sc_rollup_address1) in - let* _ = + let* () = assert_bond_id_result_equal ~loc:__LOC__ (destruct sc_rollup_address2) @@ -80,13 +80,13 @@ let test_destruct_tx_bond_id_repr () = | Some id -> Ok (Bond_id_repr.Tx_rollup_bond_id id) | None -> Error "Not a tx address" in - let* _ = + let* () = assert_bond_id_result_equal ~loc:__LOC__ (destruct tx_rollup_address1) (tx_bond tx_rollup_address1) in - let* _ = + let* () = assert_bond_id_result_equal ~loc:__LOC__ (destruct tx_rollup_address2) @@ -101,7 +101,7 @@ let test_destruct_invalid_bond_id_repr () = let invalid_address = "asdfasdfasdf" in let empty_address = "" in let destruct = Bond_id_repr.Internal_for_test.destruct in - let* _ = + let* () = Assert.is_error ~loc:__LOC__ ~pp:Bond_id_repr.pp (destruct invalid_address) in Assert.is_error ~loc:__LOC__ ~pp:Bond_id_repr.pp (destruct empty_address) @@ -124,9 +124,9 @@ let test_roundtrip () = let tx_rollup_address2 = "txr1YNMEtkj5Vkqsbdmt7xaxBTMRZjzS96UAi" in let sc_rollup_address1 = "scr1HLXM32GacPNDrhHDLAssZG88eWqCUbyLF" in let sc_rollup_address2 = "scr1Ew52VCdi6nF1JuokRGMqfmSeiAEXymW2m" in - let* _ = rountrip_test __LOC__ tx_rollup_address1 in - let* _ = rountrip_test __LOC__ tx_rollup_address2 in - let* _ = rountrip_test __LOC__ sc_rollup_address1 in + let* () = rountrip_test __LOC__ tx_rollup_address1 in + let* () = rountrip_test __LOC__ tx_rollup_address2 in + let* () = rountrip_test __LOC__ sc_rollup_address1 in rountrip_test __LOC__ sc_rollup_address2 let tests = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml b/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml index fff2e8efbe5f26f24f2a4b79cd7da36c352d8d9f..d14a7f9035027e6d242fc48cbaaee2c4cd606f6e 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml @@ -88,7 +88,7 @@ struct ~mk_level:(fun id -> Raw_level_repr.succ id.H.published_level) ~mk_slot_index:(fun id -> id.H.index) ~check_result:(fun res -> - let* _skip_list = Assert.get_ok ~__LOC__ res in + let* (_skip_list : Hist.t) = Assert.get_ok ~__LOC__ res in return_unit) (** This test attempts to add a slot on top of genesis cell zero which satisfies @@ -100,7 +100,7 @@ struct ~mk_level:(fun id -> id.H.published_level) ~mk_slot_index:(fun id -> succ_slot_index id.H.index) ~check_result:(fun res -> - let* _skip_list = Assert.get_ok ~__LOC__ res in + let* (_skip_list : Hist.t) = Assert.get_ok ~__LOC__ res in return_unit) (** This test attempts to add two slots on top of genesis cell zero which satisfies @@ -119,7 +119,7 @@ struct Raw_level_repr.(succ (succ id.H.published_level))) ~mk_slot_index:(fun id -> id.H.index) ~check_result:(fun res -> - let* _skip_list = Assert.get_ok ~__LOC__ res in + let* (_skip_list : Hist.t) = Assert.get_ok ~__LOC__ res in return_unit)) (* Tests of construct/verify proofs that confirm/unconfirm pages on top of diff --git a/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml index 207692cf643b2ae3536701193ee84e5b2a113799..af2b1149f73677eef95e3b373dc4a0bf60844da2 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml @@ -149,14 +149,12 @@ let test_check_path () = in let elements_array = Array.of_list elements in let t = List.fold_left snoc_tr nil elements in - let _ = - Stdlib.List.init n (fun pos -> - let* path = compute_path t pos in - let* b = check_path path pos elements_array.(pos) (ML.root t) in - assert b ; - return_unit) - in - return_unit + Stdlib.List.init n (fun pos -> + let* path = compute_path t pos in + let* b = check_path path pos elements_array.(pos) (ML.root t) in + assert b ; + return_unit) + |> Environment.Error_monad.Tzresult_syntax.join (* Check that a path is only valid for the position for which it was computed *) @@ -169,13 +167,11 @@ let test_check_path_wrong_pos () = let elements_array = Array.of_list elements in let t = List.fold_left snoc_tr ML.nil elements in let* path = compute_path t (n - 1) in - let _ = - Stdlib.List.init (n - 2) (fun pos -> - let* b = check_path path pos elements_array.(pos) (ML.root t) in - assert (not b) ; - return_unit) - in - return_unit + Stdlib.List.init (n - 2) (fun pos -> + let* b = check_path path pos elements_array.(pos) (ML.root t) in + assert (not b) ; + return_unit) + |> Environment.Error_monad.Tzresult_syntax.join (* Check that a computed path is invalidated by a tree update *) let test_check_invalidated_path () = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml index 9543efcdf22e1785e1b476afc9fe9026ae2d829f..4f12f21eba1d2357c2f495c2add57935de44cf10 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml @@ -84,7 +84,7 @@ module Test_raw_level_repr = struct | Error _ -> return_unit) >>=? fun () -> try - let _ = Raw_level_repr.of_int32_exn int32v in + let (_ : Raw_level_repr.t) = Raw_level_repr.of_int32_exn int32v in failwith "Negative int32s should not be coerced into raw_level" with Invalid_argument _ -> return_unit diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml index 61ad98d29a117c170967bfbb9db5ec865128e6b0..4f49832e6e8eca6524547250d3088a52f891cbb4 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -81,7 +81,9 @@ module Arith_Context = struct (* FIXME: With on-disk context, we cannot commit the empty context. Is it also true in our case? *) let* context = Context_binary.add_tree context [] tree in - let* _hash = Context_binary.commit ~time:Time.Protocol.epoch context in + let* (_hash : Context_hash.t) = + Context_binary.commit ~time:Time.Protocol.epoch context + in let index = Context_binary.index context in match Context_binary.Tree.kinded_key tree with | Some k -> diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml index d7289e4e6168e06312f86edd1a6db4d21a0f9c0c..fbcf756c65049202bad1aa1f175c590b39f4ffea 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml @@ -220,7 +220,7 @@ module Tree = struct let commit_tree context key tree = let open Lwt_syntax in let* ctxt = Tezos_context_memory.Context.add_tree context key tree in - let* _ = commit ~time:Time.Protocol.epoch ~message:"" ctxt in + let* (_ : value_key) = commit ~time:Time.Protocol.epoch ~message:"" ctxt in return () let lookup_tree context hash = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml index 4187fc86380d765a805c8aade5d00cc1ed411a31..720132968a8d447b886a3fcad95ee467aba214c1 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml @@ -2478,7 +2478,7 @@ let test_limit_on_number_of_messages_during_commitment_period with_gap () = in if with_gap then (* Changing the commitment period is enough to accept that many messages... *) - let*? _r = add_too_many_messages in + let*? (_r : Raw_context.t) = add_too_many_messages in return () else (* ... but if we stay in the same commitment period, it fails. *) diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml index 31e6bdaba3caa19be7f66976a99f2ed0407e1efe..41bc79f67c51cd5bb2b2dd2ff1618601811ede56 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml @@ -66,7 +66,9 @@ module Wasm_context = struct let produce_proof context tree step = let open Lwt_syntax in let* context = Context.add_tree context [] tree in - let* _hash = Context.commit ~time:Time.Protocol.epoch context in + let* (_hash : Context_hash.t) = + Context.commit ~time:Time.Protocol.epoch context + in let index = Context.index context in match Context.Tree.kinded_key tree with | Some k -> diff --git a/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml index 6d94465845d65bc7da65a7d6602883a63a5caa10..9367d4a9a088ec59ebfb80cf759c092ee1a11009 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml @@ -126,7 +126,7 @@ module Test_tez_repr = struct let test_of_mutez_exn_negative () = try - let _ = Tez_repr.of_mutez_exn (-1000000L) in + let (_ : Tez_repr.t) = Tez_repr.of_mutez_exn (-1000000L) in failwith "should have failed to converted -1000000L to tez" with | Invalid_argument _ -> return_unit diff --git a/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2.ml b/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2.ml index b95ed7e35c17d1ff47b3017a1adc9c28cd0434f6..f0fd2133a596c16a529b82aa181cf9be7e6abe5a 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2.ml @@ -402,15 +402,13 @@ module Test_Ticket_ledger = struct to an address. *) let test_credit_unknown_index () = let ctxt = empty_context in - - let* _ctxt = + let* (_ctxt : t) = credit ctxt ticket_idx1 (Indexable.index_exn 0l) (Tx_rollup_l2_qty.of_int64_exn 1L) in - return_unit (** Test that spending a ticket from an index to another one behaves correctly *)