diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 7bcef9f238a4b9b010a16d8ef67fd0ba04f1715c..334fac6fed962a57846d763b2513f8ace7dcca1d 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -557,7 +557,7 @@ let consume_gas ctxt cost = else error Operation_quota_exceeded let check_enough_gas ctxt cost = - consume_gas ctxt cost >>? fun _ -> Result.return_unit + consume_gas ctxt cost >>? fun (_ : t) -> Result.return_unit let gas_consumed ~since ~until = match (gas_level since, gas_level until) with diff --git a/src/proto_alpha/lib_protocol/script_ir_annot.ml b/src/proto_alpha/lib_protocol/script_ir_annot.ml index a9d0cdfce7ddb18706add230f6ca7ee37337383c..6c477246b4673b6f32def82df0704257ee4ec024 100644 --- a/src/proto_alpha/lib_protocol/script_ir_annot.ml +++ b/src/proto_alpha/lib_protocol/script_ir_annot.ml @@ -155,12 +155,12 @@ let check_type_annot loc annot = parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> error_unexpected_annot loc vars >>? fun () -> error_unexpected_annot loc fields >>? fun () -> - get_one_annot loc types >|? fun _a -> () + get_one_annot loc types >|? fun (_a : type_annot option) -> () let check_composed_type_annot loc annot = parse_annots loc annot >>? classify_annot loc >>? fun (vars, types, fields) -> error_unexpected_annot loc vars >>? fun () -> - get_one_annot loc types >>? fun _t -> + get_one_annot loc types >>? fun (_t : type_annot option) -> get_two_annot loc fields >|? fun (_f1, _f2) -> () let parse_field_annot : diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index 2d08c62ff4f9c0552a61a9761894fc896bb1e296..67943470a3455fc05cea6e6718b634d0dd63bcc7 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -455,7 +455,7 @@ let validate_bootstrap_accounts if acc >= minimal_stake then raise Exit else return acc) Tez.zero bootstrap_accounts - >>=? fun _ -> + >>=? fun (_ : Tez.t) -> failwith "Insufficient tokens in initial accounts: the amount should be at \ least minimal_stake") diff --git a/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml b/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml index 0c6963c60d5b9ec8fa5f004c5777bcb76744874f..c0feb9d7e5ab1514bb61e17efea8befb44e67ab2 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml @@ -447,7 +447,7 @@ module Machine = struct pure ()) () env.implicit_accounts - >>= fun _ -> + >>= fun () -> get_tzbtc_balance env.cpmm_contract env state >>= fun cpmm_tzbtc_balance -> assert (specs.cpmm_min_tzbtc_balance <= cpmm_tzbtc_balance) ; @@ -699,7 +699,7 @@ module MachineBuilder = struct >>= fun op -> bake ~invariant ~baker:env.holder [op] env state else pure state) >>= fun state -> - check_state_satisfies_specs env state specs >>= fun _ -> pure (state, env) + check_state_satisfies_specs env state specs >>= fun () -> pure (state, env) end end diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml index a2525fde0d3fe05244b7f69e9c8e9c3cad53fddb..b8f234ad0641ca2a9c83d2bd23bf62485885ff8f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml @@ -83,7 +83,8 @@ let test_bake_n_cycles n () = let open Block in let policy = By_round 0 in Context.init1 ~consensus_threshold:0 () >>=? fun (block, _contract) -> - Block.bake_until_n_cycle_end ~policy n block >>=? fun _block -> return () + Block.bake_until_n_cycle_end ~policy n block >>=? fun (_block : block) -> + return_unit (** Check that, after one or two voting periods, the voting power of a baker is updated according to the rewards it receives for baking the blocks in the diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml index 15fb13a3382c5810497d0cc1657afcb2116936b1..bc2cf7cf7366033d7c77423b6753c967673e0cb7 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml @@ -485,7 +485,7 @@ let test_unregistered_delegate_key_init_origination ~fee () = Context.get_constants (I i) >>=? fun {parametric = {origination_size; cost_per_byte; _}; _} -> cost_per_byte *? Int64.of_int origination_size >>?= fun origination_burn -> - fee +? origination_burn >>?= fun _total_fee -> + fee +? origination_burn >>?= fun (_total_fee : Tez.t) -> (* FIXME unused variable *) Context.Contract.balance (I i) bootstrap >>=? fun balance -> if fee > balance then expect_too_low_balance_error i op @@ -526,7 +526,7 @@ let test_unregistered_delegate_key_init_delegation ~fee () = credit >>=? fun credit_contract -> Block.bake b ~operation:credit_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> (* try to delegate *) Op.delegation ~force_reveal:true @@ -575,7 +575,7 @@ let test_unregistered_delegate_key_switch_delegation ~fee () = credit >>=? fun init_credit -> Block.bake b ~operation:init_credit >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> (* set and check the initial delegate *) Op.delegation ~force_reveal:true @@ -616,7 +616,7 @@ let test_unregistered_delegate_key_init_origination_credit ~fee ~amount () = Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake b ~operation:create_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* origination with delegate argument *) Context.Contract.balance (B b) bootstrap >>=? fun balance -> Op.contract_origination @@ -661,14 +661,14 @@ let test_unregistered_delegate_key_init_delegation_credit ~fee ~amount () = amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* initial credit for the delegated contract *) let credit = of_int 10 in credit +? amount >>?= fun balance -> Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit >>=? fun init_credit -> Block.bake ~operation:init_credit b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract balance >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract balance >>=? fun () -> (* try to delegate *) Op.delegation ~force_reveal:true @@ -713,14 +713,14 @@ let test_unregistered_delegate_key_switch_delegation_credit ~fee ~amount () = amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* initial credit for the delegated contract *) let credit = of_int 10 in credit +? amount >>?= fun balance -> Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit >>=? fun init_credit -> Block.bake ~operation:init_credit b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract balance >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract balance >>=? fun () -> (* set and check the initial delegate *) Op.delegation ~force_reveal:true @@ -762,12 +762,12 @@ let test_unregistered_delegate_key_init_origination_credit_debit ~fee ~amount () Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake b ~operation:create_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* debit + check balance *) Op.transaction ~force_reveal:true (B b) impl_contract bootstrap amount >>=? fun debit_contract -> Block.bake b ~operation:debit_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* origination with delegate argument *) Context.Contract.balance (B b) bootstrap >>=? fun balance -> Op.contract_origination @@ -813,7 +813,7 @@ let test_unregistered_delegate_key_init_delegation_credit_debit ~amount ~fee () amount >>=? fun create_contract -> Block.bake b ~operation:create_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* debit + check balance *) Op.transaction ~force_reveal:true @@ -824,13 +824,13 @@ let test_unregistered_delegate_key_init_delegation_credit_debit ~amount ~fee () amount >>=? fun debit_contract -> Block.bake b ~operation:debit_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* initial credit for the delegated contract *) let credit = of_int 10 in Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit >>=? fun credit_contract -> Block.bake b ~operation:credit_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> (* try to delegate *) Op.delegation ~force_reveal:true @@ -876,18 +876,18 @@ let test_unregistered_delegate_key_switch_delegation_credit_debit ~fee ~amount amount >>=? fun create_contract -> Block.bake b ~operation:create_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* debit + check balance *) Op.transaction ~force_reveal:true (B b) impl_contract bootstrap amount >>=? fun debit_contract -> Block.bake b ~operation:debit_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* delegation - initial credit for the delegated contract *) let credit = of_int 10 in Op.transaction ~fee:Tez.zero (B b) bootstrap impl_contract credit >>=? fun credit_contract -> Block.bake b ~operation:credit_contract >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract credit >>=? fun () -> (* set and check the initial delegate *) Op.delegation ~force_reveal:true @@ -928,7 +928,7 @@ let test_failed_self_delegation_no_transaction () = let impl_contract = Contract.Implicit unregistered_pkh in (* check balance *) Context.Contract.balance (I i) impl_contract >>=? fun balance -> - Assert.equal_tez ~loc:__LOC__ Tez.zero balance >>=? fun _ -> + Assert.equal_tez ~loc:__LOC__ Tez.zero balance >>=? fun () -> (* self delegation fails *) Op.delegation (I i) impl_contract (Some unregistered_pkh) >>=? fun self_delegation -> @@ -947,12 +947,12 @@ let test_failed_self_delegation_emptied_implicit_contract amount () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* empty implicit contract and check balance *) Op.transaction ~force_reveal:true (B b) impl_contract bootstrap amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* self delegation fails *) Op.delegation (B b) impl_contract (Some unregistered_pkh) >>=? fun self_delegation -> @@ -973,7 +973,7 @@ let test_emptying_delegated_implicit_contract_fails amount () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* delegate the contract to the bootstrap *) Op.delegation ~force_reveal:true @@ -1011,13 +1011,13 @@ let test_valid_delegate_registration_init_delegation_credit amount () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* self delegation + verification *) Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) >>=? fun self_delegation -> Block.bake ~operation:self_delegation b >>=? fun b -> Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> - Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun _ -> + Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun () -> (* create an implicit contract with no delegate *) let unregistered_account = Account.new_account () in let unregistered_pkh = Account.(unregistered_account.pkh) in @@ -1030,7 +1030,7 @@ let test_valid_delegate_registration_init_delegation_credit amount () = Assert.error ~loc:__LOC__ err (function | RPC_context.Not_found _ -> true | _ -> false) - >>=? fun _ -> + >>=? fun () -> (* delegation to the newly registered key *) Op.delegation ~force_reveal:true (B b) delegator (Some delegate_account.pkh) >>=? fun delegation -> @@ -1053,13 +1053,13 @@ let test_valid_delegate_registration_switch_delegation_credit amount () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* self delegation + verification *) Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) >>=? fun self_delegation -> Block.bake ~operation:self_delegation b >>=? fun b -> Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> - Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun _ -> + Assert.equal_pkh ~loc:__LOC__ delegate delegate_pkh >>=? fun () -> (* create an implicit contract with bootstrap's account as delegate *) let unregistered_account = Account.new_account () in let unregistered_pkh = Account.(unregistered_account.pkh) in @@ -1074,7 +1074,7 @@ let test_valid_delegate_registration_switch_delegation_credit amount () = (* test delegate of new contract is bootstrap *) Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> Assert.equal_pkh ~loc:__LOC__ delegator_delegate bootstrap_manager.pkh - >>=? fun _ -> + >>=? fun () -> (* delegation with newly registered key *) Op.delegation (B b) delegator (Some delegate_account.pkh) >>=? fun delegation -> @@ -1093,23 +1093,23 @@ let test_valid_delegate_registration_init_delegation_credit_debit amount () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* self delegation + verification *) Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) >>=? fun self_delegation -> Block.bake ~operation:self_delegation b >>=? fun b -> Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> - Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun _ -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun () -> (* empty implicit contracts are usually deleted but they are kept if they were registered as delegates. we empty the contract in order to verify this. *) Op.transaction (B b) impl_contract bootstrap amount >>=? fun empty_contract -> Block.bake ~operation:empty_contract b >>=? fun b -> (* impl_contract is empty *) - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* verify self-delegation after contract is emptied *) Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> - Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun _ -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun () -> (* create an implicit contract with no delegate *) let unregistered_account = Account.new_account () in let unregistered_pkh = Account.(unregistered_account.pkh) in @@ -1122,7 +1122,7 @@ let test_valid_delegate_registration_init_delegation_credit_debit amount () = Assert.error ~loc:__LOC__ err (function | RPC_context.Not_found _ -> true | _ -> false) - >>=? fun _ -> + >>=? fun () -> (* delegation to the newly registered key *) Op.delegation ~force_reveal:true (B b) delegator (Some delegate_account.pkh) >>=? fun delegation -> @@ -1146,20 +1146,20 @@ let test_valid_delegate_registration_switch_delegation_credit_debit amount () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract amount >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract amount >>=? fun () -> (* self delegation + verification *) Op.delegation ~force_reveal:true (B b) impl_contract (Some delegate_pkh) >>=? fun self_delegation -> Block.bake ~operation:self_delegation b >>=? fun b -> Context.Contract.delegate (B b) impl_contract >>=? fun delegate -> - Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun _ -> + Assert.equal_pkh ~loc:__LOC__ delegate_pkh delegate >>=? fun () -> (* empty implicit contracts are usually deleted but they are kept if they were registered as delegates. we empty the contract in order to verify this. *) Op.transaction (B b) impl_contract bootstrap amount >>=? fun empty_contract -> Block.bake ~operation:empty_contract b >>=? fun b -> (* impl_contract is empty *) - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* create an implicit contract with bootstrap's account as delegate *) let unregistered_account = Account.new_account () in let unregistered_pkh = Account.(unregistered_account.pkh) in @@ -1174,7 +1174,7 @@ let test_valid_delegate_registration_switch_delegation_credit_debit amount () = (* test delegate of new contract is bootstrap *) Context.Contract.delegate (B b) delegator >>=? fun delegator_delegate -> Assert.equal_pkh ~loc:__LOC__ delegator_delegate bootstrap_manager.pkh - >>=? fun _ -> + >>=? fun () -> (* delegation with newly registered key *) Op.delegation ~force_reveal:true (B b) delegator (Some delegate_account.pkh) >>=? fun delegation -> @@ -1196,7 +1196,8 @@ let test_double_registration () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract Tez.one_mutez >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> (* self-delegation *) Op.delegation ~force_reveal:true (B b) impl_contract (Some pkh) >>=? fun self_delegation -> @@ -1217,7 +1218,8 @@ let test_double_registration_when_empty () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract Tez.one_mutez >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> (* self delegation *) Op.delegation ~force_reveal:true (B b) impl_contract (Some pkh) >>=? fun self_delegation -> @@ -1226,7 +1228,7 @@ let test_double_registration_when_empty () = Op.transaction (B b) impl_contract bootstrap Tez.one_mutez >>=? fun empty_contract -> Block.bake ~operation:empty_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* second self-delegation *) Op.delegation (B b) impl_contract (Some pkh) >>=? fun second_registration -> Incremental.begin_construction b >>=? fun i -> @@ -1243,7 +1245,8 @@ let test_double_registration_when_recredited () = Op.transaction ~force_reveal:true (B b) bootstrap impl_contract Tez.one_mutez >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> (* self delegation *) Op.delegation ~force_reveal:true (B b) impl_contract (Some pkh) >>=? fun self_delegation -> @@ -1252,12 +1255,13 @@ let test_double_registration_when_recredited () = Op.transaction ~force_reveal:true (B b) impl_contract bootstrap Tez.one_mutez >>=? fun empty_contract -> Block.bake ~operation:empty_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.zero >>=? fun () -> (* credit 1μꜩ+ check balance *) Op.transaction (B b) bootstrap impl_contract Tez.one_mutez >>=? fun create_contract -> Block.bake ~operation:create_contract b >>=? fun b -> - Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez >>=? fun _ -> + Assert.balance_is ~loc:__LOC__ (B b) impl_contract Tez.one_mutez + >>=? fun () -> (* second self-delegation *) Op.delegation (B b) impl_contract (Some pkh) >>=? fun second_registration -> Incremental.begin_construction b >>=? fun i -> diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml index afae5660e2a364e320dc5dc1423ab585085b33d8..c2524e1284f6916bcfb59274720509d3f1f6b4ba 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -362,7 +362,7 @@ let test_just_in_time_double_baking_evidence () = let operation = double_baking (B blk) blk_a.header blk_b.header in (* We include the denunciation in the previous to last block of the cycle. *) - Block.bake ~operation blk >>=? fun _ -> return_unit + Block.bake ~operation blk >>=? fun (_ : Block.t) -> return_unit (** Check that an invalid double baking evidence that exposes two block baking with same level made by different bakers fails. *) diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml index c6e9e3510366ca93e740f8585d3985507e4e0039..73a28b74b618bb7b91724a2ca8f8684b718d2a1e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -139,7 +139,8 @@ let test_two_double_endorsement_evidences_leadsto_no_bake () = let operation = double_endorsement (B genesis) endorsement_a endorsement_b in Context.get_bakers (B blk_a) >>=? fun bakers -> let baker = Context.get_first_different_baker delegate bakers in - Context.Delegate.full_balance (B blk_a) baker >>=? fun _full_balance -> + Context.Delegate.full_balance (B blk_a) baker + >>=? fun (_full_balance : Tez.t) -> Block.bake ~policy:(By_account baker) ~operation blk_a >>=? fun blk_with_evidence1 -> block_fork blk_with_evidence1 >>=? fun (blk_30, blk_40) -> @@ -269,7 +270,7 @@ let test_different_delegates () = (B blk_2) () >>=? fun e_b -> - Block.bake ~operation:(Operation.pack e_b) blk_b >>=? fun _ -> + Block.bake ~operation:(Operation.pack e_b) blk_b >>=? fun (_ : Block.t) -> double_endorsement (B blk_b) e_a e_b |> fun operation -> Block.bake ~operation blk_b >>= fun res -> Assert.proto_error ~loc:__LOC__ res (function @@ -467,7 +468,8 @@ let test_two_double_endorsement_evidences_leads_to_duplicate_denunciation () = let operation2 = double_endorsement (B genesis) endorsement_b endorsement_a in Context.get_bakers (B blk_a) >>=? fun bakers -> let baker = Context.get_first_different_baker delegate bakers in - Context.Delegate.full_balance (B blk_a) baker >>=? fun _full_balance -> + Context.Delegate.full_balance (B blk_a) baker + >>=? fun (_full_balance : Tez.t) -> Block.bake ~policy:(By_account baker) ~operations:[operation; operation2] diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml index 59af65007267ba5a098bf792ddd13e348d602c81..07bee3fa71cb3d381073f438117a2449f6e828f6 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml @@ -328,7 +328,8 @@ end = struct in Context.get_bakers (B blk_a) >>=? fun bakers -> let baker = Context.get_first_different_baker delegate bakers in - Context.Delegate.full_balance (B blk_a) baker >>=? fun _full_balance -> + Context.Delegate.full_balance (B blk_a) baker + >>=? fun (_full_balance : Tez.t) -> Block.bake ~policy:(By_account baker) ~operations:[operation; operation2] diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml index af0603b63c849b273366d4dda9cb792ef43905b8..478b7301ebb761672564f722f1c476d5a982316e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml @@ -54,7 +54,7 @@ let inject_the_first_endorsement () = (** Apply a single endorsement from the slot 0 endorser. *) let test_simple_endorsement () = - inject_the_first_endorsement () >>=? fun _ -> return_unit + inject_the_first_endorsement () >>=? fun (_, _) -> return_unit (****************************************************************) (* The following test scenarios are supposed to raise errors. *) @@ -72,7 +72,7 @@ let test_negative_slot () = ~endorsed_block:b (B genesis) () - >>=? fun _ -> + >>=? fun (_ : _ operation) -> failwith "negative slot should not be accepted by the binary format") (function | Data_encoding.Binary.Write_error _ -> return_unit | e -> Lwt.fail e) @@ -419,10 +419,11 @@ let test_preendorsement_endorsement_same_level () = >>=? fun i -> Op.endorsement ~endorsed_block:b1 (B genesis) () >>=? fun op_endo -> let op_endo = Alpha_context.Operation.pack op_endo in - Incremental.add_operation i op_endo >>=? fun _i -> + Incremental.add_operation i op_endo >>=? fun (_i : Incremental.t) -> Op.preendorsement ~endorsed_block:b1 (B genesis) () >>=? fun op_preendo -> let op_preendo = Alpha_context.Operation.pack op_preendo in - Incremental.add_operation i op_preendo >>=? fun _i -> return () + Incremental.add_operation i op_preendo >>=? fun (_i : Incremental.t) -> + return_unit (** Test for endorsement injection with wrong slot in mempool mode. This test is expected to fail *) @@ -476,7 +477,7 @@ let test_endorsement_grandparent () = let op2 = Alpha_context.Operation.pack op2 in (* Both should be accepted by the mempool *) Incremental.add_operation i op1 >>=? fun i -> - Incremental.add_operation i op2 >>=? fun _i -> return () + Incremental.add_operation i op2 >>=? fun (_i : Incremental.t) -> return_unit (** Double inclusion of grandparent endorsement *) let test_double_endorsement_grandparent () = @@ -499,7 +500,7 @@ let test_double_endorsement_grandparent () = res "Double inclusion of consensus operation" >>=? fun () -> - Incremental.add_operation i op2 >>=? fun _i -> return () + Incremental.add_operation i op2 >>=? fun (_i : Incremental.t) -> return_unit (** Endorsement of grandparent on same slot as parent *) let test_endorsement_grandparent_same_slot () = @@ -517,7 +518,7 @@ let test_endorsement_grandparent_same_slot () = let op2 = Alpha_context.Operation.pack op2 in (* Both should be accepted by the mempool *) Incremental.add_operation i op1 >>=? fun i -> - Incremental.add_operation i op2 >>=? fun _i -> return () + Incremental.add_operation i op2 >>=? fun (_i : Incremental.t) -> return_unit (** Endorsement of grandparent in application mode should be rejected *) let test_endorsement_grandparent_application () = diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml index 89da110389275c5c2951ab5d09c27e82eef30534..93c45c94b830820c12b69e30afbb1e346c7c4d26 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml @@ -218,7 +218,7 @@ let test_set_too_high_limit () = Op.set_deposits_limit (B genesis) contract1 (Some max_limit) >>=? fun operation -> Incremental.add_operation ~expect_apply_failure b operation >>=? fun b -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit let test_unset_limit () = Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> @@ -412,7 +412,7 @@ let test_unfreeze_deposits_after_deactivation () = (Tez.(frozen_deposits = zero) && Tez.(balance = initial_balance)) >>=? fun () -> loop b (pred n) in - loop genesis cycles_to_bake >>=? fun _b -> return_unit + loop genesis cycles_to_bake >>=? fun (_b : Block.t) -> return_unit let test_frozen_deposits_with_delegation () = Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> @@ -478,7 +478,7 @@ let test_frozen_deposits_with_delegation () = in (* Check that frozen deposits do not change for a sufficient period of time *) - loop b cycles_to_bake >>=? fun _b -> return_unit + loop b cycles_to_bake >>=? fun (_b : Block.t) -> return_unit let test_frozen_deposits_with_overdelegation () = Context.init_with_constants2 constants >>=? fun (genesis, contracts) -> @@ -558,7 +558,7 @@ let test_frozen_deposits_with_overdelegation () = in (* Check that frozen deposits do not change for a sufficient period of time *) - loop b cycles_to_bake >>=? fun _b -> return_unit + loop b cycles_to_bake >>=? fun (_b : Block.t) -> return_unit let test_set_limit_with_overdelegation () = let constants = {constants with frozen_deposits_percentage = 10} in @@ -627,7 +627,7 @@ let test_set_limit_with_overdelegation () = in (* Check that frozen deposits do not change for a sufficient period of time *) - loop b cycles_to_bake >>=? fun _b -> return_unit + loop b cycles_to_bake >>=? fun (_b : Block.t) -> return_unit (** This test fails when [to_cycle] in [Delegate.freeze_deposits] is smaller than [new_cycle + preserved_cycles]. *) @@ -662,7 +662,8 @@ let test_error_is_thrown_when_smaller_upper_bound_for_frozen_window () = Op.transaction ~force_reveal:true (B b) contract1 contract2 balance1 >>=? fun operation -> Block.bake ~operation b >>=? fun b -> - Block.bake_until_n_cycle_end constants.preserved_cycles b >>=? fun _ -> + Block.bake_until_n_cycle_end constants.preserved_cycles b + >>=? fun (_ : Block.t) -> (* By this time, after [preserved_cycles] passed after [account1] has emptied its spendable balance, because [account1] had a big staking balance at cycle 0, at this cycle it has a big active stake, and so its diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml index 36aeeb88976bd9ce095743aa38d2e652cc0907b4..03ecf37cbafa399d97b1ea3023ffbe691b919e70 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement_functor.ml @@ -94,8 +94,7 @@ end = struct (** OK: bake a block "_b2_1" at round 1, containing a PQC and a locked round of round 0 *) let include_preendorsement_in_block_with_locked_round () = - aux_simple_preendorsement_inclusion ~loc:__LOC__ () >>=? fun _ -> - return_unit + aux_simple_preendorsement_inclusion ~loc:__LOC__ () (** KO: bake a block "_b2_1" at round 1, containing a PQC and a locked round of round 0. But the preendorsement is on a bad branch *) 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 170b01f9c602b9fd8d30d830a2bdb860f56700c6..e8f358cc67d1598690eb5ab48bd57e8e6ad66823 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 @@ -579,7 +579,8 @@ let test_cycle_bounds () = cycle in let cycle = root in - Context.get_bakers ~cycle:(add cycle future_offset) (B b) >>=? fun _ -> + Context.get_bakers ~cycle:(add cycle future_offset) (B b) + >>=? fun (_ : _ list) -> let future_cycle = add cycle (future_offset + 1) in Context.get_bakers ~cycle:future_cycle (B b) >>= fun res -> (* the first cycle is special *) @@ -591,8 +592,9 @@ let test_cycle_bounds () = >>=? fun () -> Block.bake_until_cycle_end b >>=? fun b -> let cycle = add cycle 1 in - Context.get_bakers ~cycle:root (B b) >>=? fun _ -> - Context.get_bakers ~cycle:(add cycle future_offset) (B b) >>=? fun _ -> + Context.get_bakers ~cycle:root (B b) >>=? fun (_ : _ list) -> + Context.get_bakers ~cycle:(add cycle future_offset) (B b) + >>=? fun (_ : _ list) -> Context.get_bakers ~cycle:(add cycle (future_offset + 1)) (B b) >>= fun res -> Assert.proto_error_with_info ~loc:__LOC__ @@ -603,7 +605,7 @@ let test_cycle_bounds () = Block.bake_until_n_cycle_end past_offset b >>=? fun b -> let cycle = add cycle past_offset in Context.get_bakers ~cycle:(Stdlib.Option.get (sub cycle past_offset)) (B b) - >>=? fun _ -> + >>=? fun (_ : _ list) -> Context.get_bakers ~cycle:(Stdlib.Option.get (sub cycle (past_offset + 1))) (B b) @@ -614,7 +616,8 @@ let test_cycle_bounds () = ~error_info_field:`Message (expected_error_message `Past cycle) >>=? fun () -> - Context.get_bakers ~cycle:(add cycle future_offset) (B b) >>=? fun _ -> + Context.get_bakers ~cycle:(add cycle future_offset) (B b) + >>=? fun (_ : _ list) -> Context.get_bakers ~cycle:(add cycle (future_offset + 1)) (B b) >>= fun res -> Assert.proto_error_with_info ~loc:__LOC__ diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml b/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml index 678a6c79844c8eb5b3f2b51a04c2284eb8779d9b..03ecdb5c72d2ee7e9c94a2ee5b384502a42805e4 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml +++ b/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml @@ -417,7 +417,7 @@ let test_consume_exactly_all_block_gas () = [(src, dst, Alpha_context.Gas.Arith.integral_of_int_exn 1040000)]) src_list in - bake_operations_with_gas block lld >>=? fun _ -> return () + bake_operations_with_gas block lld >>=? fun (_, _, _) -> return_unit (** Tests the consumption of more than the block gas level with many single operations, should fail *) @@ -523,8 +523,8 @@ let test_emptying_account_gas () = return_unit | err -> failwith "got unexpected error: %a" pp_print_trace err in - Incremental.add_operation ~expect_apply_failure i op >>=? fun _i -> - return_unit + Incremental.add_operation ~expect_apply_failure i op + >>=? fun (_i : Incremental.t) -> return_unit let quick (what, how) = Tztest.tztest what `Quick how diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml index d08c70285a5149453e77164fc48d1182c2ecb098..53fcf7b020d27aaa1e0e49fa362a621547483c1c 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml @@ -72,7 +72,7 @@ let get_happy_path () = Global_constants_storage.get context hash >|= Environment.wrap_tzresult >>=? fun (_, result_expr) -> Test_global_constants.assert_expr_equal __LOC__ expr result_expr - >|=? fun _ -> b + >|=? fun () -> b in assert_unchanged b >>=? fun b -> let do_many_transfers b = diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml index e338e9a186a5a5d618f24ee116976f1c194a7c66..9db7896a733e60c3f7fe721af7442101faedd11a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml @@ -80,7 +80,7 @@ module Raw_context_tests = struct ctx) ctx (0 -- 99) - >>=? fun _ctx -> return_unit + >>=? fun (_ctx : Raw_context.t) -> return_unit (* Nullifiers don't check for duplicates are it's done by verify_update, however committing to disk twice the same nf causes a storage error by @@ -327,7 +327,7 @@ module Raw_context_tests = struct i + 1) 0 roots_ctx - >>=? fun _ -> + >>=? fun (_ : int) -> (* Add roots w/o increasing the level *) let roots_same_level = WithExceptions.List.init ~loc:__LOC__ 10 (fun _ -> gen_root ()) @@ -344,7 +344,7 @@ module Raw_context_tests = struct (i + 1, ctx)) (0, ctx) roots_same_level - >>=? fun _ -> return_unit + >>=? fun (_, _) -> return_unit let test_get_memo_size () = Context.init1 () >>=? fun (b, _contract) -> @@ -386,7 +386,7 @@ module Alpha_context_tests = struct ~bound_data:"" ps in - verify_update ctx vt ~memo_size:0 |> assert_some >>=? fun _ -> + verify_update ctx vt ~memo_size:0 |> assert_some >>=? fun (_, _) -> verify_update ctx vt ~memo_size:1 |> assert_none (* Bench the proving and validation time of shielding and transferring several @@ -425,7 +425,7 @@ module Alpha_context_tests = struct verify_update ctx ~id vt |> assert_some >|=? fun (ctx, _id) -> ctx) ctx vts - >|=? fun _ctx -> + >|=? fun (_ctx : context) -> let vtime_transfers = Unix.gettimeofday () -. start in Printf.printf "valdtr_txs %f\n" vtime_transfers @@ -466,7 +466,7 @@ module Alpha_context_tests = struct ctx) ctx vts - >|=? fun _ctx -> + >|=? fun (_ctx : context) -> let vtime_transfers = Unix.gettimeofday () -. start in Printf.printf "valdtr_txs %f\n" vtime_transfers @@ -732,7 +732,7 @@ module Interpreter_tests = struct ~expect_apply_failure:(fun _ -> return_unit) incr operation - >>=? fun _incr -> + >>=? fun (_incr : Incremental.t) -> (* Here we fail by changing the field bound_data*) let orginal_transac = Tezos_sapling.Forge.forge_transaction @@ -767,7 +767,7 @@ module Interpreter_tests = struct ~expect_apply_failure:(fun _ -> return_unit) incr operation - >>=? fun _incr -> return_unit + >>=? fun (_incr : Incremental.t) -> return_unit let test_push_sapling_state_should_be_forbidden () = init () @@ -780,7 +780,7 @@ module Interpreter_tests = struct src block baker - >>=? fun _ -> + >>=? fun (_, _, _) -> (* Originating the next contract should fail *) originate_contract_hash "contracts/sapling_push_sapling_state.tz" @@ -1021,7 +1021,7 @@ module Interpreter_tests = struct Tez.zero ~parameters >>=? fun operation -> - next_block b operation >>=? fun _b -> return_unit + next_block b operation >>=? fun (_b : Block.t) -> return_unit (* We use a contrac with two states. Its parameter is two transactions and a bool. The two transactions are tested valid against the two states, but @@ -1157,7 +1157,7 @@ module Interpreter_tests = struct let dst_2 = Contract.Originated dst_2 in Op.transaction ~gas_limit:Max ~fee (B b) src dst_2 Tez.zero ~parameters >>=? fun operation -> - next_block b operation >>=? fun _b -> return_unit + next_block b operation >>=? fun (_b : Block.t) -> return_unit end let tests = diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml index eacf459e588f242a6971f16d193951842669f519..8caf7bf01e6aee66dfeea834b17a88c84019580f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml @@ -286,7 +286,7 @@ let test_parse_comb_type () = ctxt (pair_prim2 nat_prim_a (Prim (-1, T_pair, [nat_prim; nat_prim], ["%b"]))) pair_nat_a_pair_b_nat_nat_ty - >>?= fun _ -> return_unit + >>?= fun (_ : context) -> return_unit let test_unparse_ty loc ctxt expected ty = Environment.wrap_tzresult @@ -323,7 +323,7 @@ let test_unparse_comb_type () = ctxt (pair_prim [nat_prim; nat_prim; nat_prim]) pair_nat_nat_nat_ty - >>?= fun _ -> return_unit + >>?= fun (_ : context) -> return_unit let test_unparse_comparable_ty loc ctxt expected ty = (* unparse_comparable_ty is not exported, the simplest way to call it is to @@ -365,7 +365,7 @@ let test_unparse_comb_comparable_type () = ctxt (pair_prim [nat_prim; nat_prim; nat_prim]) pair_nat_nat_nat_ty - >>?= fun _ -> return_unit + >>?= fun (_ : context) -> return_unit let test_parse_data ?(equal = Stdlib.( = )) loc ctxt ty node expected = let elab_conf = Script_ir_translator_config.make ~legacy:false () in @@ -574,7 +574,7 @@ let test_parse_address () = address_t (String (-1, "scr1HLXM32GacPNDrhHDLAssZG88eWqCUbyLF%")) {destination = scr1; entrypoint = Entrypoint.default} - >|=? fun _ctxt -> () + >|=? fun (_ctxt : context) -> () let test_unparse_data loc ctxt ty x ~expected_readable ~expected_optimized = wrap_error_lwt @@ -641,7 +641,7 @@ let test_unparse_comb_data () = (z, (z, (z, z))) ~expected_readable:(pair_prim [z_prim; z_prim; z_prim; z_prim]) ~expected_optimized:(Micheline.Seq (-1, [z_prim; z_prim; z_prim; z_prim])) - >>=? fun _ -> return_unit + >>=? fun (_ : context) -> return_unit (* Generate all the possible syntaxes for pairs *) let gen_pairs left right = @@ -715,7 +715,7 @@ let test_optimal_comb () = check_optimal_comb __LOC__ ctxt comb4_ty comb4_v 4 >>=? fun ctxt -> pair_ty leaf_ty comb4_ty >>??= fun (Ty_ex_c comb5_ty) -> let comb5_v = (leaf_v, comb4_v) in - check_optimal_comb __LOC__ ctxt comb5_ty comb5_v 5 >>=? fun _ctxt -> + check_optimal_comb __LOC__ ctxt comb5_ty comb5_v 5 >>=? fun (_ : context) -> return_unit (* Check that UNPACK on contract is forbidden. diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml index 5e995ec1c01a631043b0e196750d5a80a3a8ef42..aa5c46cf4056cc478633b7a6820990f3cb7314b1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml @@ -343,7 +343,7 @@ let activation_init () = baked. *) let test_simple_init_with_commitments () = activation_init () >>=? fun (blk, _contract, _secrets) -> - Block.bake blk >>=? fun _ -> return_unit + Block.bake blk >>=? fun (_ : Block.t) -> return_unit (** A single activation *) let test_single_activation () = @@ -378,7 +378,7 @@ let test_multi_activation_1 () = >|=? fun () -> blk) blk secrets - >>=? fun _ -> return_unit + >>=? fun (_ : Block.t) -> return_unit (** All of the 10 activations occur in one bake. *) let test_multi_activation_2 () = diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml index 9a02d867329454bb2de0d671d829af7244a46202..376ce44906d2a6cc0760dc4e5b36cd7264d3ec3d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml @@ -300,8 +300,8 @@ let test_wrong_signature_in_the_middle () = expected to fail." in Incremental.begin_construction b >>=? fun inc -> - Incremental.add_operation ~expect_failure inc operation >>=? fun _inc -> - return_unit + Incremental.add_operation ~expect_failure inc operation + >>=? fun (_inc : Incremental.t) -> return_unit let expect_inconsistent_counters list = if @@ -368,15 +368,15 @@ let test_inconsistent_counters () = (* Canari: Check counters are ok *) Op.batch_operations ~source:c1 (B b) [op1; op2; op3; op4] >>=? fun op -> Incremental.begin_construction b >>=? fun inc -> - Incremental.add_operation inc op >>=? fun _ -> + Incremental.add_operation inc op >>=? fun (_ : Incremental.t) -> (* Gap in counter in the following op *) Op.batch_operations ~source:c1 (B b) [op1; op2; op4] >>=? fun op -> Incremental.add_operation ~expect_failure:expect_inconsistent_counters inc op - >>=? fun _ -> + >>=? fun (_ : Incremental.t) -> (* Same counter used twice in the following op *) Op.batch_operations ~source:c1 (B b) [op1; op2; op2'] >>=? fun op -> Incremental.add_operation ~expect_failure:expect_inconsistent_counters inc op - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit 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 03feece5006bf870751de7766371dadeb7131794..b0c1e8d97f9c905422543491f0ca688e712bfa7e 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 @@ -83,7 +83,7 @@ let test_origination_balances ~loc:_ ?(fee = Tez.zero) ?(credit = Tez.zero) () = source Account.default_initial_balance total_fee_plus_deposits - >>=? fun _ -> + >>=? fun () -> (* check the balance of the originate contract is equal to credit *) Assert.balance_is ~loc:__LOC__ (B b) new_contract credit @@ -159,7 +159,7 @@ let test_not_tez_in_contract_to_pay_fee () = let pkh1 = Context.Contract.pkh contract_1 in Block.bake ~policy:(Excluding [pkh1]) ~operation b >>=? fun b -> Assert.balance_was_debited ~loc:__LOC__ (B b) contract_1 balance amount - >>=? fun _ -> + >>=? fun () -> (* use this source contract to create an originate contract where it requires to pay a fee and add an amount of credit into this new contract *) Op.contract_origination diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml index d6ea32c30912adeb55597ed4a895e401d7f6a537..c4179f275bda7848ef65ed3152bd2275145a8c17 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml @@ -126,8 +126,8 @@ let test_transfer_fees_emptying_after_reveal_batched () = return_unit | _ -> assert false in - Incremental.add_operation ~expect_apply_failure inc op >>=? fun _inc -> - return_unit + Incremental.add_operation ~expect_apply_failure inc op + >>=? fun (_inc : Incremental.t) -> return_unit (* We assert that the changes introduced in !5182, splitting the application of Reveal operations into a pre-checking and 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 d1f81ea918d502193d51858a1055ffb3071103f3..6331befc44d7e344136e1d0a6b86261d9137052e 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 @@ -91,7 +91,7 @@ let single_transfer ?fee ?expect_apply_failure amount = contract_2 amount >>=? fun (b, _) -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit (** Single transfer without fee. *) let test_block_with_a_single_transfer () = single_transfer Tez.one @@ -136,7 +136,7 @@ let test_transfer_to_originate_with_fee () = Incremental.begin_construction b >>=? fun i -> transfer_and_check_balances ~loc:__LOC__ i ~fee contract new_contract amount >>=? fun (i, _) -> - Incremental.finalize_block i >>=? fun _ -> return_unit + Incremental.finalize_block i >>=? fun (_ : Block.t) -> return_unit (** Transfer from balance. *) let test_transfer_amount_of_contract_balance () = @@ -151,7 +151,7 @@ let test_transfer_amount_of_contract_balance () = (* transfer all the tez inside contract 1 *) transfer_and_check_balances ~loc:__LOC__ b contract_1 contract_2 balance >>=? fun (b, _) -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit (** Transfer to oneself. *) let test_transfers_to_self () = @@ -173,7 +173,7 @@ let test_transfers_to_self () = ~fee contract ten_tez - >>=? fun _ -> return_unit + >>=? fun (_, _) -> return_unit (** Forgot to add the valid transaction into the block. *) let test_missing_transaction () = @@ -188,8 +188,9 @@ let test_missing_transaction () = (* Do the transfer 3 times from source contract to destination contract *) n_transactions 3 i contract_1 contract_2 amount >>=? fun i -> (* do the fourth transfer from source contract to destination contract *) - Op.transaction (I i) contract_1 contract_2 amount >>=? fun _ -> - Incremental.finalize_block i >>=? fun _ -> return_unit + Op.transaction (I i) contract_1 contract_2 amount + >>=? fun (_ : packed_operation) -> + Incremental.finalize_block i >>=? fun (_ : Block.t) -> return_unit (** Transfer zero tez to an implicit contract, with fee equals balance of src. *) let test_transfer_zero_implicit_with_bal_src_as_fee () = @@ -241,7 +242,7 @@ let test_transfer_zero_to_originated_with_bal_src_as_fee () = Op.transaction (B b) ~fee:bal_src src new_contract Tez.zero >>=? fun operation -> Assert.equal_tez ~loc:__LOC__ bal_src (Tez.of_mutez_exn 100L) >>=? fun () -> - Block.bake ~operation b >>=? fun _ -> return_unit + Block.bake ~operation b >>=? fun (_ : Block.t) -> return_unit (** Transfer one tez to an implicit contract, with fee equals balance of src. *) let test_transfer_one_to_implicit_with_bal_src_as_fee () = @@ -262,7 +263,7 @@ let test_transfer_one_to_implicit_with_bal_src_as_fee () = Assert.test_error_encodings err ; return_unit | t -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (********************) (* The following tests are for different kind of contracts: @@ -307,7 +308,7 @@ let test_transfer_from_implicit_to_implicit_contract () = dest amount2 >>=? fun (b, _) -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit (** Implicit to originated. *) let test_transfer_from_implicit_to_originated_contract () = @@ -340,7 +341,7 @@ let test_transfer_from_implicit_to_originated_contract () = (* transfer from implicit contract to originated contract *) transfer_and_check_balances ~loc:__LOC__ i src new_contract amount2 >>=? fun (i, _) -> - Incremental.finalize_block i >>=? fun _ -> return_unit + Incremental.finalize_block i >>=? fun (_ : Block.t) -> return_unit (********************) (* Slow tests case *) @@ -352,7 +353,7 @@ let multiple_transfer n ?fee amount = >>=? fun (b, (contract_1, contract_2)) -> Incremental.begin_construction b >>=? fun b -> n_transactions n b ?fee contract_1 contract_2 amount >>=? fun b -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit (** 1- Create a block with two contracts; 2- Apply 100 transfers. @@ -392,7 +393,7 @@ let test_block_with_multiple_transfers_with_without_fee () = n_transactions 50 ~fee:ten b contracts.(7) contracts.(5) twenty >>=? fun b -> n_transactions 30 ~fee:ten b contracts.(0) contracts.(7) hundred >>=? fun b -> n_transactions 20 ~fee:ten b contracts.(1) contracts.(0) twenty >>=? fun b -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit (** Build a chain that has 10 blocks. *) let test_build_a_chain () = @@ -406,7 +407,7 @@ let test_build_a_chain () = >>=? fun (b, _) -> Incremental.finalize_block b) b (1 -- 10) - >>=? fun _ -> return_unit + >>=? fun (_ : Block.t) -> return_unit (*********************************************************************) (* Expected error test cases *) @@ -487,9 +488,7 @@ let test_balance_too_low_two_transfers fee () = :: _ -> Assert.test_error_encodings err ; return_unit - | t -> - failwith "Unexpected error: %a" Error_monad.pp_print_trace t - >>=? fun _ -> return_unit + | t -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t in Incremental.begin_construction b >>=? fun i -> Incremental.add_operation ~expect_apply_failure i operation >>=? fun i -> @@ -523,7 +522,8 @@ let test_add_the_same_operation_twice () = >>=? fun (i, op_transfer) -> Incremental.finalize_block i >>=? fun b -> Incremental.begin_construction b >>=? fun i -> - Op.transaction (I i) contract_1 contract_2 ten_tez >>=? fun _ -> + Op.transaction (I i) contract_1 contract_2 ten_tez + >>=? fun (_ : packed_operation) -> Incremental.add_operation i op_transfer >>= fun b -> Assert.proto_error ~loc:__LOC__ b (function | Contract_storage.Counter_in_the_past _ as err -> @@ -554,7 +554,7 @@ let test_ownership_sender () = let imcontract_1 = Alpha_context.Contract.Implicit manager.pkh in transfer_and_check_balances ~loc:__LOC__ b imcontract_1 contract_2 Tez.one >>=? fun (b, _) -> - Incremental.finalize_block b >>=? fun _ -> return_unit + Incremental.finalize_block b >>=? fun (_ : Block.t) -> return_unit (*********************************************************************) (* Random transfer *) @@ -591,12 +591,12 @@ let test_random_transfer () = b source amount - >>=? fun _ -> return_unit + >>=? fun (_, _) -> return_unit else Incremental.begin_construction ~policy:(Block.Excluding [source_pkh]) b >>=? fun i -> - transfer_and_check_balances ~loc:__LOC__ i source dest amount >>=? fun _ -> - return_unit + transfer_and_check_balances ~loc:__LOC__ i source dest amount + >>=? fun (_, _) -> return_unit (** Transfer random transactions. *) let test_random_multi_transactions () = 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 496d486b41703bb99efbb304c0b31a1bcf5a80b1..fb6d287d19742a3936bd93d370766e1c141b864c 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 @@ -47,7 +47,7 @@ let add_operation b op = (** [check_tx_rollup_exists ctxt tx_rollup] returns [()] iff [tx_rollup] is a valid address for a transaction rollup. Otherwise, it fails. *) let check_tx_rollup_exists ctxt tx_rollup = - Context.Tx_rollup.state ctxt tx_rollup >|=? fun _ -> () + Context.Tx_rollup.state ctxt tx_rollup >|=? fun (_ : Tx_rollup_state.t) -> () (** [check_proto_error_f f t] checks that the first error of [t] satisfies the boolean function [f]. *) @@ -89,7 +89,7 @@ let test_disable_feature_flag () = (check_proto_error Validate_errors.Manager.Tx_rollup_feature_disabled) i op - >>=? fun _i -> return_unit + >>=? fun (_i : Incremental.t) -> return_unit (** [test_sunset] try to originate a tx rollup after the sunset and check that it fails *) @@ -112,7 +112,7 @@ let test_sunset () = (check_proto_error Validate_errors.Manager.Tx_rollup_feature_disabled) i op - >>=? fun _i -> return_unit + >>=? fun (_i : Incremental.t) -> return_unit (** [parsing_tests] try originating contracts using the type [tx_rollup_l2_address], test that it only works @@ -857,7 +857,7 @@ let test_add_batch_with_limit () = (check_proto_error_f (function | Tx_rollup_errors.Submit_batch_burn_exceeded _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_add_two_batches] originates a tx rollup and adds two arbitrary batches to one of its inboxes. Ensure that their order @@ -926,7 +926,7 @@ let test_batch_too_big () = ~expect_failure: (check_proto_error Tx_rollup_errors.Message_size_exceeds_limit) op - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [fill_inbox b tx_rollup contract contents k] fills the inbox of [tx_rollup] with batches containing [contents] sent by [contract]. @@ -985,7 +985,7 @@ let test_inbox_size_too_big () = (check_proto_error_f (function | Tx_rollup_errors.Inbox_size_would_exceed_limit _ -> true | _ -> false)) - >>=? fun _i -> return_unit) + >>=? fun (_i : Incremental.t) -> return_unit) (** Try to add enough batches to reach the batch count limit of an inbox. *) let test_inbox_count_too_big () = @@ -1053,7 +1053,7 @@ let test_inbox_count_too_big () = | Tx_rollup_errors.Inbox_count_would_exceed_limit rollup -> rollup = tx_rollup | _ -> false) - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> let parameters = print_deposit_arg (`Typed tx_rollup) (`Hash pkh) in let fee = Test_tez.of_int 10 in Op.transaction @@ -1093,7 +1093,6 @@ let test_valid_deposit () = originate b account >>=? fun (b, tx_rollup) -> make_deposit b tx_rollup account addr >>=? fun (b, (deposit, cumulated_size), _) -> - Incremental.begin_construction b >|=? Incremental.alpha_ctxt >>=? fun _ctxt -> Context.Tx_rollup.inbox (B b) tx_rollup Tx_rollup_level.root >>=? fun inbox -> let merkle_root = Tx_rollup_inbox.Merkle.merklize_list @@ -1167,7 +1166,7 @@ let test_valid_deposit_inexistant_rollup () = (check_proto_error_f (function | Script_interpreter.Runtime_contract_error _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_invalid_deposit_not_contract] checks a smart contract cannot deposit something that is not a ticket. *) @@ -1194,7 +1193,7 @@ let test_invalid_deposit_not_ticket () = (check_proto_error_f (function | Script_interpreter.Bad_contract_parameter _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit let string_ticket_of_size expected_size = if expected_size < 0 && expected_size mod 8 <> 0 then @@ -1284,7 +1283,7 @@ let test_invalid_deposit_too_big_ticket () = (check_proto_error_f (function | Tx_rollup_errors_repr.Ticket_payload_size_limit_exceeded _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_invalid_deposit_too_big_ticket_type] tests that depositing a ticket that has a content and type whose summed size exceeds @@ -1335,7 +1334,7 @@ let test_invalid_deposit_too_big_ticket_type () = (check_proto_error_f (function | Tx_rollup_errors_repr.Ticket_payload_size_limit_exceeded _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_valid_deposit_big_ticket] tests that depositing a ticket whose size is exactly [tx_rollup_max_ticket_payload_size] succeeds.*) @@ -1385,7 +1384,7 @@ let test_valid_deposit_big_ticket () = Tez.zero ~parameters >>=? fun op -> - Incremental.add_operation i op >>=? fun _ -> return_unit + Incremental.add_operation i op >>=? fun (_ : Incremental.t) -> return_unit (** [test_invalid_entrypoint] checks that a transaction to an invalid entrypoint of a transaction rollup fails. *) @@ -1412,7 +1411,7 @@ let test_invalid_entrypoint () = (check_proto_error_f (function | Script_interpreter.Bad_contract_parameter _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_invalid_l2_address] checks that a smart contract cannot make a deposit order to something that is not a valid layer-2 address. *) @@ -1439,7 +1438,7 @@ let test_invalid_l2_address () = (check_proto_error_f (function | Script_interpreter.Bad_contract_parameter _ -> true | _ -> false)) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_valid_deposit_invalid_amount] checks that a transaction to a transaction rollup fails if the [amount] parameter is not null. *) @@ -1464,7 +1463,7 @@ let test_valid_deposit_invalid_amount () = ~expect_apply_failure: (check_runtime_error Script_interpreter_defs.Rollup_invalid_transaction_amount) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_deposit_too_many_tickets] checks that a deposit of too many tickets is rejected *) @@ -1635,7 +1634,7 @@ let test_commitment_duplication () = check_proto_error_f (function Tx_rollup_errors.No_uncommitted_inbox -> true | _ -> false) e) - >>=? fun _ -> + >>=? fun () -> (* No charge. *) Assert.balance_was_debited ~loc:__LOC__ (I i) contract2 balance2 Tez.zero >>=? fun () -> @@ -1910,7 +1909,7 @@ let test_commitment_predecessor () = in Incremental.begin_construction b >>=? fun i -> Incremental.add_operation i op ~expect_apply_failure:(check_proto_error error) - >>=? fun _ -> + >>=? fun (_ : Incremental.t) -> (* Now we submit a real commitment *) Op.tx_rollup_commit (B b) contract1 tx_rollup commitment >>=? fun operation -> add_operation b operation >>=? fun b -> @@ -1939,7 +1938,7 @@ let test_commitment_predecessor () = | Tx_rollup_errors.Wrong_predecessor_hash {provided = None; expected} -> expected = commitment.predecessor | _ -> false) - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> (* Commitment refers to a predecessor which does not exist *) let commitment_with_wrong_pred = {commitment with predecessor = Some bogus_hash} @@ -2063,7 +2062,7 @@ let test_finalization_edge_cases () = op ~expect_apply_failure: (check_proto_error @@ Tx_rollup_errors.No_commitment_to_finalize) - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> let message = "bogus" in Op.tx_rollup_submit_batch (B b) contract1 tx_rollup message >>=? fun op -> add_operation b op >>=? fun b -> @@ -2077,7 +2076,7 @@ let test_finalization_edge_cases () = op ~expect_apply_failure: (check_proto_error @@ Tx_rollup_errors.No_commitment_to_finalize) - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> make_incomplete_commitment_for_batch (I i) (tx_level 0l) tx_rollup [] >>=? fun (commitment, _) -> Op.tx_rollup_commit (I i) contract1 tx_rollup commitment >>=? fun op -> @@ -2091,10 +2090,10 @@ let test_finalization_edge_cases () = op ~expect_apply_failure: (check_proto_error @@ Tx_rollup_errors.No_commitment_to_finalize) - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> Incremental.finalize_block i >>=? fun b -> (* Now our finalization is valid *) - add_operation b op >>=? fun _block -> return_unit + add_operation b op >>=? fun (_block : Block.t) -> return_unit (** [test_too_many_commitments] tests that you can't submit new commitments if there are too many finalized commitments. *) @@ -2571,7 +2570,7 @@ module Rejection = struct (check_proto_error Tx_rollup_errors.Proof_undecodable) i operation - >>=? fun _i -> return_unit + >>=? fun (_i : Incremental.t) -> return_unit (** Test that we can produce a simple but valid proof. *) let test_valid_proof_on_invalid_commitment () = @@ -2619,7 +2618,7 @@ module Rejection = struct ~previous_message_result:(message_result l2_context_hash []) ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path >>=? fun operation -> - add_operation b operation >>=? fun _ -> return_unit + add_operation b operation >>=? fun (_ : Block.t) -> return_unit (** It is really similar to {!test_valid_proof_on_invalid_commitment} but it tries to reject a valid commitment, thus, fails. *) @@ -2931,7 +2930,7 @@ module Rejection = struct ~previous_message_result ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path >>=? fun operation -> - add_operation b operation >>=? fun _ -> return_unit + add_operation b operation >>=? fun (_ : Block.t) -> return_unit (** Test that an empty proof is not able to reject a valid commitment. *) let test_invalid_proof_on_invalid_commitment () = @@ -2964,7 +2963,7 @@ module Rejection = struct op ~expect_apply_failure: (check_proto_error Tx_rollup_errors.Proof_failed_to_reject) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Test that rejection successfully fails when there is a disagreement about the previous state. *) @@ -3016,7 +3015,7 @@ module Rejection = struct (Tx_rollup_message_result_hash.of_b58check_exn "txmr344vtdPzvWsfnoSd3mJ3MCFA5ehKLQs1pK9WGcX4FEACg1rVgC"); })) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Test that rejection successfully fails when there's no commitment to reject *) @@ -3055,7 +3054,7 @@ module Rejection = struct (check_proto_error (Tx_rollup_errors.Cannot_reject_level {provided = level; accepted_range = None})) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Test that rejection successfully fails when the rejected commitment is already final *) @@ -3106,7 +3105,7 @@ module Rejection = struct (check_proto_error (Tx_rollup_errors.Cannot_reject_level {provided = level; accepted_range = Some (level2, level2)})) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Test that rejection successfully fails when the message hash does not match the one stored in the inbox *) @@ -3150,7 +3149,7 @@ module Rejection = struct ~expect_apply_failure: (check_proto_error (Tx_rollup_errors.Wrong_message_path {expected = expected_root})) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Test that rejection successfully fails when the message position does exist in the inbox. *) @@ -3184,7 +3183,7 @@ module Rejection = struct (check_proto_error (Tx_rollup_errors.Wrong_message_position {level; position = 1; length = 1})) - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Test rejecting a commitment to a non-trivial message -- that is, not a no-op. *) @@ -3224,7 +3223,7 @@ module Rejection = struct op ~expect_apply_failure: (check_proto_error Tx_rollup_errors.Proof_failed_to_reject) - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> (* Check with a reasonable proof *) l2_parameters (B b) >>=? fun l2_parameters -> make_proof store l2_parameters deposit >>= fun proof -> @@ -3242,7 +3241,7 @@ module Rejection = struct ~previous_message_result ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path >>=? fun operation -> - add_operation b operation >>=? fun _ -> return_unit + add_operation b operation >>=? fun (_ : Block.t) -> return_unit let add_store_to_ctxt ctxt store = let open L2_Context.Syntax in @@ -3303,7 +3302,7 @@ module Rejection = struct (* With a limit, the commitment is rejected because the required proof is above the limit. *) test_large_rejection 100 >>=? fun (i, op) -> - Incremental.add_operation i op >>=? fun _ -> + Incremental.add_operation i op >>=? fun (_ : Incremental.t) -> (* With a high limit, the commitment can not be rejected as it is valid *) test_large_rejection 10_000 >>=? fun (i, op) -> Incremental.add_operation @@ -3311,7 +3310,7 @@ module Rejection = struct ~expect_apply_failure: (check_proto_error Tx_rollup_errors.Proof_produced_rejected_state) op - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** Drop the last element of a seq, that is, the last element of a proof *) let rec drop_last x = @@ -3371,7 +3370,7 @@ module Rejection = struct ~previous_message_result ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path >>=? fun op -> - Incremental.add_operation i op >>=? fun _ -> return_unit + Incremental.add_operation i op >>=? fun (_ : Incremental.t) -> return_unit (** Create a context where the batcher submitted and committed for a layer2 batch that produces [n_withdraw] withdrawals. @@ -3473,8 +3472,8 @@ module Rejection = struct ~previous_message_result_path:Tx_rollup_commitment.Merkle.dummy_path >>=? fun op -> Incremental.begin_construction b >>=? fun i -> - Incremental.add_operation i op ?expect_apply_failure >>=? fun _ -> - return_unit + Incremental.add_operation i op ?expect_apply_failure + >>=? fun (_ : Incremental.t) -> return_unit let test_reject_withdrawals_limit () = context_init1 () >>=? fun (b, _) -> @@ -3667,7 +3666,7 @@ module Rejection = struct Incremental.begin_construction b >>=? fun i -> (* Finally, we reject the commitment and check that the size fits in a Tezos operation. *) - Incremental.add_operation i op >>=? fun _i -> return_unit + Incremental.add_operation i op >>=? fun (_i : Incremental.t) -> return_unit let tests = [ @@ -4012,7 +4011,7 @@ let test_state_with_deleted () = operation ~expect_apply_failure: (check_proto_error Tx_rollup_errors.Remove_commitment_too_early) - >>=? fun _ -> + >>=? fun (_ : Incremental.t) -> (* Wait for some blocks, then remove *) Block.bake b ~operations:[] >>=? fun b -> Block.bake b ~operations:[] >>=? fun b -> @@ -4570,7 +4569,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_invalid_reveal_withdrawals_missing_withdraw_in_commitment] tries to reveal withdrawals when the commitment in question has no withdrawals @@ -4612,7 +4611,7 @@ module Withdraw = struct (check_proto_error Tx_rollup_errors.No_withdrawals_to_dispatch) incr operation - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_reveal_withdrawals_invalid_tickets_info] test to reveal withdrawals with tickets that do not correspond to the given proof and asserts that errors @@ -4667,7 +4666,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _incr -> + >>=? fun (_incr : Incremental.t) -> (* Try with twice the same withdrawal *) Op.tx_rollup_dispatch_tickets (I incr) @@ -4688,7 +4687,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _incr -> + >>=? fun (_incr : Incremental.t) -> (* Try with wrong type *) Op.tx_rollup_dispatch_tickets (I incr) @@ -4709,7 +4708,7 @@ module Withdraw = struct | _ -> Alcotest.fail "expected to fail with wrong type") incr operation - >>=? fun _incr -> + >>=? fun (_incr : Incremental.t) -> (* Try with wrong contents *) Op.tx_rollup_dispatch_tickets (I incr) @@ -4730,7 +4729,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _incr -> + >>=? fun (_incr : Incremental.t) -> (* Try with wrong ticketer *) Op.tx_rollup_dispatch_tickets (I incr) @@ -4751,7 +4750,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _incr -> return_unit + >>=? fun (_incr : Incremental.t) -> return_unit (** [test_reveal_withdrawals_twice] asserts that withdrawing the same withdrawal twice raises an error with the ticket table accounting. *) @@ -4812,7 +4811,7 @@ module Withdraw = struct (check_proto_error Tx_rollup_errors.Withdrawals_already_dispatched) incr operation - >>=? fun _ -> return_unit + >>=? fun (_ : Incremental.t) -> return_unit (** [test_multiple_withdrawals_multiple_batches] checks that multiple withdrawals from the same batch are possible. *) @@ -4931,7 +4930,7 @@ module Withdraw = struct Alcotest.fail "expected to fail with ticket table accounting error") incr operation - >>=? fun _incr -> + >>=? fun (_incr : Incremental.t) -> (* Execute second reveal *) Op.tx_rollup_dispatch_tickets (B block) @@ -4948,8 +4947,8 @@ module Withdraw = struct >>=? fun operation1 -> withdraw_op account2 block Ticket_amount.(add one one) >>=? fun operation2 -> - Block.bake ~operations:[operation1; operation2] block >>=? fun _block -> - return_unit + Block.bake ~operations:[operation1; operation2] block + >>=? fun (_block : Block.t) -> return_unit (** [test_invalid_index_or_context] checks that attempting to reveal withdrawal from a level with a wrong message index or context hash raises an @@ -5040,7 +5039,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> (* try with wrong message_index *) Op.tx_rollup_dispatch_tickets (I incr) @@ -5061,7 +5060,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> (* 5. try with a hilariously-large message_index. If permitted, this could cause a stack overflow. *) let wrong_message_index = 1_000_000_000 in @@ -5084,7 +5083,7 @@ module Withdraw = struct | _ -> false) incr operation - >>=? fun _i -> + >>=? fun (_i : Incremental.t) -> (* valid reveal *) Op.tx_rollup_dispatch_tickets (I incr) @@ -5096,7 +5095,8 @@ module Withdraw = struct valid_context_hash [ticket_info] >>=? fun operation -> - Incremental.add_operation incr operation >>=? fun _i -> return_unit + Incremental.add_operation incr operation >>=? fun (_i : Incremental.t) -> + return_unit (** [test_too_late_withdrawal] checks that attempting to withdraw from a level of a commitment already removed fails. *) @@ -5153,7 +5153,7 @@ module Withdraw = struct | _error -> false) incr operation - >>=? fun _i -> return_unit + >>=? fun (_i : Incremental.t) -> return_unit (** [test_withdrawal_accounting_is_cleaned_up_after_removal] Check that withdrawal accounting is cleaned @@ -5292,7 +5292,7 @@ module Withdraw = struct op ~expect_apply_failure: (check_proto_error Tx_rollup_errors.Proof_produced_rejected_state) - >>=? fun _i -> return (i, message_result) + >>=? fun (_i : Incremental.t) -> return (i, message_result) (** [test_deposit_overflow_to_withdrawal] checks that a deposit that overflows causes withdrawals to be generated. *) @@ -5373,7 +5373,7 @@ module Withdraw = struct (tx_level 2l) [(0, [withdraw])] ~previous_message_result - >>=? fun _ -> return_unit + >>=? fun (_, _) -> return_unit (** [test_deposit_multiple_destinations_at_limit] checks that we can deposit the maximum number of tickets to multiple destinations ] 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 0f6d37978341f34fcdd74777f50b776682ac3d67..46f377155405b6449a0885d1018cc909313f8651 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 @@ -1192,13 +1192,13 @@ let test_voting_power_updated_each_voting_period () = Int64.sub expected_power_of_baker_1 (Tez.to_mutez amount) in assert_voting_power ~loc:__LOC__ expected_power_of_baker_1 block baker1 - >>=? fun _ -> + >>=? fun () -> (* Assert voting power of baker2 has increased by [amount] *) let expected_power_of_baker_2 = Int64.add expected_power_of_baker_2 (Tez.to_mutez amount) in assert_voting_power ~loc:__LOC__ expected_power_of_baker_2 block baker2 - >>=? fun _ -> + >>=? fun () -> (* Retrieve voting power of baker3 *) get_voting_power block baker3 >>=? fun power -> let power_of_baker_3 = power in diff --git a/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml b/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml index dc561b4beb3b31df34e4b88e04aa27b83a1d8f9d..a851e13cf3e206b0f0c275b60c6e00b194fdbcad 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml @@ -552,7 +552,7 @@ let test_delegate_freeze_unfreeze_undelegate () = ~do_slash:_ -> do_unfreeze ctxt >>=? fun ctxt -> - do_undelegate ctxt amount_delegated >>=? fun _ -> return_unit) + do_undelegate ctxt amount_delegated >>=? fun (_ : context) -> return_unit) let test_delegate_freeze_undelegate_unfreeze () = test_scenario @@ -568,7 +568,7 @@ let test_delegate_freeze_undelegate_unfreeze () = ~do_slash:_ -> do_undelegate ctxt amount_delegated >>=? fun ctxt -> - do_unfreeze ctxt >>=? fun _ -> return_unit) + do_unfreeze ctxt >>=? fun (_ : context) -> return_unit) let test_delegate_double_freeze_undelegate_unfreeze () = test_scenario @@ -585,8 +585,8 @@ let test_delegate_double_freeze_undelegate_unfreeze () = -> do_freeze ~deposit_account:deposit_account2 ctxt >>=? fun ctxt -> do_undelegate ctxt amount_delegated >>=? fun ctxt -> - do_unfreeze ~deposit_account:deposit_account1 ctxt >>=? fun _ -> - return_unit) + do_unfreeze ~deposit_account:deposit_account1 ctxt + >>=? fun (_ : context) -> return_unit) let test_delegate_freeze_redelegate_unfreeze () = test_scenario @@ -603,7 +603,8 @@ let test_delegate_freeze_redelegate_unfreeze () = -> do_delegate ~delegate:delegate2 ctxt >>=? fun (ctxt, amount2) -> do_unfreeze ctxt >>=? fun ctxt -> - do_undelegate ~delegate:delegate2 ctxt amount2 >>=? fun _ -> return_unit) + do_undelegate ~delegate:delegate2 ctxt amount2 >>=? fun (_ : context) -> + return_unit) let test_delegate_freeze_unfreeze_freeze_redelegate () = test_scenario @@ -621,7 +622,8 @@ let test_delegate_freeze_unfreeze_freeze_redelegate () = do_unfreeze ctxt >>=? fun ctxt -> do_freeze ctxt >>=? fun ctxt -> do_delegate ~delegate:delegate2 ctxt >>=? fun (ctxt, amount2) -> - do_undelegate ~delegate:delegate2 ctxt amount2 >>=? fun _ -> return_unit) + do_undelegate ~delegate:delegate2 ctxt amount2 >>=? fun (_ : context) -> + return_unit) let test_delegate_freeze_slash_undelegate () = let slash_amount = Tez.of_mutez_exn 1000L in @@ -638,8 +640,8 @@ let test_delegate_freeze_slash_undelegate () = ~do_slash -> do_slash ctxt >>=? fun ctxt -> - do_undelegate ctxt (amount_delegated -! slash_amount) >>=? fun _ -> - return_unit) + do_undelegate ctxt (amount_delegated -! slash_amount) + >>=? fun (_ : context) -> return_unit) let tests = Tztest. diff --git a/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml b/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml index 21cb8aa8d4e3a2dd9378b516496b3f4a29a6905b..44a37f8fdc50ea38ec9108ac63802259737872d1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml @@ -49,7 +49,7 @@ let generate_init_state () = in ValidationMachine.build {cpmm_min_xtz_balance; cpmm_min_tzbtc_balance; accounts_balances} - >>=? fun _ -> return_unit + >>=? fun (_, _) -> return_unit (* The script hash of diff --git a/src/proto_alpha/lib_protocol/test/integration/test_token.ml b/src/proto_alpha/lib_protocol/test/integration/test_token.ml index 8a2c7194de36239a08c6b1fe9c4244fcc0af105e..5f8215536b9cb31a1c3c214caad4e70a68c00a2e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_token.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_token.ml @@ -126,16 +126,16 @@ let test_allocated () = Random.init 0 ; create_context () >>=? fun (ctxt, pkh) -> let dest = `Delegate_balance pkh in - test_allocated_and_still_allocated_when_empty ctxt dest true >>=? fun _ -> + test_allocated_and_still_allocated_when_empty ctxt dest true >>=? fun () -> let pkh, _pk, _sk = Signature.generate_key () in let dest = `Contract (Contract.Implicit pkh) in - test_allocated_and_deallocated_when_empty ctxt dest >>=? fun _ -> + test_allocated_and_deallocated_when_empty ctxt dest >>=? fun () -> let dest = `Collected_commitments Blinded_public_key_hash.zero in - test_allocated_and_deallocated_when_empty ctxt dest >>=? fun _ -> + test_allocated_and_deallocated_when_empty ctxt dest >>=? fun () -> let dest = `Frozen_deposits pkh in - test_allocated_and_still_allocated_when_empty ctxt dest false >>=? fun _ -> + test_allocated_and_still_allocated_when_empty ctxt dest false >>=? fun () -> let dest = `Block_fees in - test_allocated_and_still_allocated_when_empty ctxt dest true >>=? fun _ -> + test_allocated_and_still_allocated_when_empty ctxt dest true >>=? fun () -> let dest = let bond_id = Bond_id.Tx_rollup_bond_id (mk_rollup ()) in `Frozen_bonds (Contract.Implicit pkh, bond_id) @@ -162,12 +162,12 @@ let test_transferring_to_sink ctxt sink amount expected_bupds = (* Transferring zero must be a noop, and must not return balance updates. *) wrap (Token.transfer ctxt `Minted sink Tez.zero) >>=? fun (ctxt', bupds) -> Assert.equal_bool ~loc:__LOC__ (ctxt == ctxt' && bupds = []) true - >>=? fun _ -> + >>=? fun () -> (* Force the allocation of [dest] if need be. *) force_allocation_if_need_be ctxt sink >>=? fun ctxt -> (* Test transferring a non null amount. *) wrap (Token.transfer ctxt `Minted sink amount) >>=? fun (ctxt', bupds) -> - check_sink_balances ctxt ctxt' sink amount >>=? fun _ -> + check_sink_balances ctxt ctxt' sink amount >>=? fun () -> let expected_bupds = Receipt.(Minted, Debited amount, Block_application) :: expected_bupds in @@ -291,12 +291,12 @@ let test_transferring_to_frozen_bonds ctxt = let test_transferring_to_sink () = Random.init 0 ; create_context () >>=? fun (ctxt, _) -> - test_transferring_to_contract ctxt >>=? fun _ -> - test_transferring_to_collected_commitments ctxt >>=? fun _ -> - test_transferring_to_delegate_balance ctxt >>=? fun _ -> - test_transferring_to_frozen_deposits ctxt >>=? fun _ -> - test_transferring_to_collected_fees ctxt >>=? fun _ -> - test_transferring_to_burned ctxt >>=? fun _ -> + test_transferring_to_contract ctxt >>=? fun () -> + test_transferring_to_collected_commitments ctxt >>=? fun () -> + test_transferring_to_delegate_balance ctxt >>=? fun () -> + test_transferring_to_frozen_deposits ctxt >>=? fun () -> + test_transferring_to_collected_fees ctxt >>=? fun () -> + test_transferring_to_burned ctxt >>=? fun () -> test_transferring_to_frozen_bonds ctxt let check_src_balances ctxt ctxt' src amount = @@ -342,13 +342,13 @@ let test_transferring_from_bounded_source ctxt src amount expected_bupds = (* Transferring zero must be a noop, and must not return balance updates. *) wrap (Token.transfer ctxt src `Burned Tez.zero) >>=? fun (ctxt', bupds) -> Assert.equal_bool ~loc:__LOC__ (ctxt == ctxt' && bupds = []) true - >>=? fun _ -> + >>=? fun () -> (* Force the allocation of [dest] if need be. *) force_allocation_if_need_be ctxt src >>=? fun ctxt -> (* Test transferring everything. *) wrap (Token.transfer ctxt `Minted src amount) >>=? fun (ctxt, _) -> wrap (Token.transfer ctxt src `Burned amount) >>=? fun (ctxt', bupds) -> - check_src_balances ctxt ctxt' src amount >>=? fun _ -> + check_src_balances ctxt ctxt' src amount >>=? fun () -> let expected_bupds = expected_bupds @ Receipt.[(Burned, Credited amount, Block_application)] in @@ -362,7 +362,7 @@ let test_transferring_from_bounded_source ctxt src amount expected_bupds = Assert.proto_error_with_info ~loc:__LOC__ res error_title | _ -> wrap (Token.transfer ctxt src `Burned amount) >>=? fun (ctxt', bupds) -> - check_src_balances ctxt ctxt' src amount >>=? fun _ -> + check_src_balances ctxt ctxt' src amount >>=? fun () -> Assert.equal_bool ~loc:__LOC__ (bupds = expected_bupds) true) >>=? fun () -> (* Test transferring more than available. *) @@ -439,44 +439,44 @@ let test_transferring_from_source () = create_context () >>=? fun (ctxt, _) -> test_transferring_from_unbounded_source ctxt `Invoice (fun am -> [(Invoice, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Bootstrap (fun am -> [(Bootstrap, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Initial_commitments (fun am -> [(Initial_commitments, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Revelation_rewards (fun am -> [(Nonce_revelation_rewards, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Double_signing_evidence_rewards (fun am -> [(Double_signing_evidence_rewards, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Endorsing_rewards (fun am -> [(Endorsing_rewards, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Baking_rewards (fun am -> [(Baking_rewards, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Baking_bonuses (fun am -> [(Baking_bonuses, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Minted (fun am -> [(Minted, Debited am, Block_application)]) - >>=? fun _ -> + >>=? fun () -> test_transferring_from_unbounded_source ctxt `Liquidity_baking_subsidies (fun am -> [(Liquidity_baking_subsidies, Debited am, Block_application)]) - >>=? fun _ -> - test_transferring_from_contract ctxt >>=? fun _ -> - test_transferring_from_collected_commitments ctxt >>=? fun _ -> - test_transferring_from_delegate_balance ctxt >>=? fun _ -> - test_transferring_from_frozen_deposits ctxt >>=? fun _ -> - test_transferring_from_collected_fees ctxt >>=? fun _ -> + >>=? fun () -> + test_transferring_from_contract ctxt >>=? fun () -> + test_transferring_from_collected_commitments ctxt >>=? fun () -> + test_transferring_from_delegate_balance ctxt >>=? fun () -> + test_transferring_from_frozen_deposits ctxt >>=? fun () -> + test_transferring_from_collected_fees ctxt >>=? fun () -> test_transferring_from_frozen_bonds ctxt let cast_to_container_type x = @@ -592,7 +592,7 @@ let rec check_balances ctxt ctxt' src dest amount = | Some src, None -> check_src_balances ctxt ctxt' src amount | None, Some dest -> check_sink_balances ctxt ctxt' dest amount | Some src, Some dest -> - check_src_balances ctxt ctxt' src amount >>=? fun _ -> + check_src_balances ctxt ctxt' src amount >>=? fun () -> check_sink_balances ctxt ctxt' dest amount let test_all_combinations_of_sources_and_sinks () = @@ -690,12 +690,12 @@ let test_transfer_n ctxt src dest = assert (bal_updates1 = debit_logs @ credit_logs) ; (* Check balances are the same in ctxt1 and ctxt2. *) List.(iter_es (check_balances_are_consistent ctxt1 ctxt2) (map fst src)) - >>=? fun _ -> check_balances_are_consistent ctxt1 ctxt2 dest + >>=? fun () -> check_balances_are_consistent ctxt1 ctxt2 dest let test_transfer_n_with_empty_source () = Random.init 0 ; create_context () >>=? fun (ctxt, pkh) -> - wrap (test_transfer_n ctxt [] `Block_fees) >>=? fun _ -> + wrap (test_transfer_n ctxt [] `Block_fees) >>=? fun () -> let dest = `Delegate_balance pkh in wrap (test_transfer_n ctxt [] dest) @@ -727,7 +727,7 @@ let test_transfer_n_with_non_empty_source () = (user4c, random_amount ()); ] in - wrap (test_transfer_n ctxt sources user1c) >>=? fun _ -> + wrap (test_transfer_n ctxt sources user1c) >>=? fun () -> wrap (test_transfer_n ctxt ((user1c, random_amount ()) :: sources) user1c) let tests = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml index 075396a79ae1f668fe4cb875695521ce3bf0e3cc..91ce5492e271d5c3b07a527701aaf6c94ac3b0cf 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml @@ -310,7 +310,7 @@ let round_of_timestamp_perf (duration0_int64, dipr) = ~predecessor_timestamp ~timestamp ~predecessor_round:Round.zero - >>? fun _round -> + >>? fun (_round : Round.t) -> let t1 = Unix.gettimeofday () in let time = t1 -. t0 in loop_inner (sum +. time) (j - 1) @@ -349,7 +349,7 @@ let timestamp_of_round_perf (duration0_int64, dipr) = ~predecessor_timestamp ~predecessor_round:Round.zero ~round - >>? fun _ts -> + >>? fun (_ts : Timestamp.time) -> let t1 = Unix.gettimeofday () in let time = t1 -. t0 in assert (time < 0.01) ;