diff --git a/src/proto_alpha/lib_client_commands/client_proto_programs_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_programs_commands.ml index 0ca77d3f9..016ffde84 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_programs_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_programs_commands.ml @@ -267,7 +267,7 @@ let commands () = begin if MBytes.get bytes 0 != '\005' then failwith "Not a piece of packed Michelson data (must start with `0x05`)" - else return () + else return_unit end >>=? fun () -> (* Remove first byte *) let bytes = MBytes.sub bytes 1 ((MBytes.length bytes) - 1) in diff --git a/src/proto_alpha/lib_delegate/client_baking_forge.ml b/src/proto_alpha/lib_delegate/client_baking_forge.ml index 632e880fd..fd3f74de1 100644 --- a/src/proto_alpha/lib_delegate/client_baking_forge.ml +++ b/src/proto_alpha/lib_delegate/client_baking_forge.ml @@ -707,13 +707,12 @@ let shell_prevalidation f "Shell-side validation: error while prevalidating operations:@\n%a" -% t event "built_invalid_block_error" -% a errs_tag errs) >>= fun () -> - return None + return_none | Ok (shell_header, operations) -> let raw_ops = List.map (fun l -> List.map snd l.Preapply_result.applied) operations in - return - (Some (bi, priority, shell_header, raw_ops, delegate, seed_nonce_hash)) + return_some (bi, priority, shell_header, raw_ops, delegate, seed_nonce_hash) let filter_outdated_endorsements expected_level ops = List.filter (function @@ -934,7 +933,7 @@ let build_block -% a timestamp_tag timestamp) >>= fun () -> finalize_block_header final_context ~timestamp validation_result operations >>=? fun shell_header -> let raw_ops = List.map (List.map forge) operations in - return (Some (bi, priority, shell_header, raw_ops, delegate, seed_nonce_hash)) + return_some (bi, priority, shell_header, raw_ops, delegate, seed_nonce_hash) let previously_baked_level cctxt pkh new_lvl = State.get cctxt pkh >>=? function diff --git a/src/proto_alpha/lib_protocol/src/amendment.ml b/src/proto_alpha/lib_protocol/src/amendment.ml index 75ad7c65e..af87c3b33 100644 --- a/src/proto_alpha/lib_protocol/src/amendment.ml +++ b/src/proto_alpha/lib_protocol/src/amendment.ml @@ -212,7 +212,7 @@ let rec longer_than l n = let record_proposals ctxt delegate proposals = begin match proposals with | [] -> fail Empty_proposal - | _ :: _ -> return () + | _ :: _ -> return_unit end >>=? fun () -> Vote.get_current_period_kind ctxt >>=? function | Proposal -> diff --git a/src/proto_alpha/lib_protocol/src/roll_storage.ml b/src/proto_alpha/lib_protocol/src/roll_storage.ml index 0f1075f16..5e23d4ece 100644 --- a/src/proto_alpha/lib_protocol/src/roll_storage.ml +++ b/src/proto_alpha/lib_protocol/src/roll_storage.ml @@ -297,7 +297,7 @@ module Delegate = struct | None -> (* This case is only when called from `set_active`, when creating a contract. *) - return false + return_false let add_amount c delegate amount = ensure_inited c delegate >>=? fun c -> diff --git a/src/proto_alpha/lib_protocol/src/script_ir_translator.ml b/src/proto_alpha/lib_protocol/src/script_ir_translator.ml index d2e3d7b74..ad3a283df 100644 --- a/src/proto_alpha/lib_protocol/src/script_ir_translator.ml +++ b/src/proto_alpha/lib_protocol/src/script_ir_translator.ml @@ -1617,7 +1617,7 @@ and parse_instr let log_stack ctxt loc stack_ty aft = match type_logger, script_instr with | None, _ - | Some _, (Seq (-1, _) | Int _ | String _ | Bytes _) -> return () + | Some _, (Seq (-1, _) | Int _ | String _ | Bytes _) -> return_unit | Some log, (Prim _ | Seq _) -> (* Unparsing for logging done in an unlimited context as this is used only by the client and not the protocol *) @@ -1625,7 +1625,7 @@ and parse_instr unparse_stack ctxt stack_ty >>=? fun (stack_ty, _) -> unparse_stack ctxt aft >>=? fun (aft, _) -> log loc stack_ty aft; - return () + return_unit in let return : context -> bef judgement -> (bef judgement * context) tzresult Lwt.t = fun ctxt judgement -> diff --git a/src/proto_alpha/lib_protocol/src/voting_services.ml b/src/proto_alpha/lib_protocol/src/voting_services.ml index f4588caac..80a42a4cd 100644 --- a/src/proto_alpha/lib_protocol/src/voting_services.ml +++ b/src/proto_alpha/lib_protocol/src/voting_services.ml @@ -111,8 +111,8 @@ let register () = register0 S.current_proposal begin fun ctxt () () -> (* this would be better implemented using get_option in get_current_proposal *) Vote.get_current_proposal ctxt >>= function - | Ok p -> return (Some p) - | Error [Raw_context.Storage_error (Missing_key _)] -> return None + | Ok p -> return_some p + | Error [Raw_context.Storage_error (Missing_key _)] -> return_none | (Error _ as e) -> Lwt.return e end diff --git a/src/proto_alpha/lib_protocol/test/transfer.ml b/src/proto_alpha/lib_protocol/test/transfer.ml index c6a66e48b..cf30a1e85 100644 --- a/src/proto_alpha/lib_protocol/test/transfer.ml +++ b/src/proto_alpha/lib_protocol/test/transfer.ml @@ -557,7 +557,7 @@ let ownership_sender () = transfer_and_check_balances ~loc:__LOC__ b imcontract_1 contract_2 Tez.one >>=? fun (b,_) -> Incremental.finalize_block b >>=? fun _ -> - return () + return_unit (*********************************************************************) (** Random transfer *)