diff --git a/docs/doc_gen/rpc_doc.ml b/docs/doc_gen/rpc_doc.ml index e64891ff89ffbf03119342cb87afd54f3c10593c..69fc4fb357bf51b8de427274dedd002b4697faf1 100644 --- a/docs/doc_gen/rpc_doc.ml +++ b/docs/doc_gen/rpc_doc.ml @@ -429,7 +429,7 @@ let make_default_acl _node = |> Data_encoding.Json.construct policy_encoding in Data_encoding.Json.pp Format.std_formatter policy ; - return () + Lwt.return_ok () let main node = let cmd = Sys.argv.(1) in diff --git a/scripts/yes-wallet/yes_wallet_lib.ml b/scripts/yes-wallet/yes_wallet_lib.ml index e1fdceccecb106b17b177600f172eef90187de0b..704b56e6a3a9b8928e9be729b267c82e8dfa71d7 100644 --- a/scripts/yes-wallet/yes_wallet_lib.ml +++ b/scripts/yes-wallet/yes_wallet_lib.ml @@ -183,7 +183,7 @@ let get_delegates (proto : protocol) context Lwt.return @@ Environment.wrap_tzresult r in let* delegates = - Alpha_context.Delegate.fold ctxt ~init:(ok []) ~f:(fun pkh acc -> + Alpha_context.Delegate.fold ctxt ~init:(Ok []) ~f:(fun pkh acc -> let* pk = let*! r = Alpha_context.Roll.delegate_pubkey ctxt pkh in Lwt.return @@ Environment.wrap_tzresult r @@ -224,7 +224,7 @@ let get_delegates (proto : protocol) context Lwt.return @@ Environment.wrap_tzresult r in let* delegates = - Alpha_context.Delegate.fold ctxt ~init:(ok []) ~f:(fun pkh acc -> + Alpha_context.Delegate.fold ctxt ~init:(Ok []) ~f:(fun pkh acc -> let* pk = let*! r = Alpha_context.Roll.delegate_pubkey ctxt pkh in Lwt.return @@ Environment.wrap_tzresult r @@ -265,7 +265,7 @@ let get_delegates (proto : protocol) context Lwt.return @@ Environment.wrap_tzresult r in let* delegates = - Alpha_context.Delegate.fold ctxt ~init:(ok []) ~f:(fun pkh acc -> + Alpha_context.Delegate.fold ctxt ~init:(Ok []) ~f:(fun pkh acc -> let* pk = let*! r = Alpha_context.Roll.delegate_pubkey ctxt pkh in Lwt.return @@ Environment.wrap_tzresult r @@ -304,7 +304,7 @@ let get_delegates (proto : protocol) context Alpha_context.Delegate.fold ctxt ~order:`Sorted - ~init:(ok []) + ~init:(Ok []) ~f:(fun pkh acc -> let* pk = let*! r = Alpha_context.Delegate.pubkey ctxt pkh in @@ -344,7 +344,7 @@ let get_delegates (proto : protocol) context Alpha_context.Delegate.fold ctxt ~order:`Sorted - ~init:(ok []) + ~init:(Ok []) ~f:(fun pkh acc -> let* pk = let*! r = Alpha_context.Delegate.pubkey ctxt pkh in diff --git a/src/bin_codec/codec.ml b/src/bin_codec/codec.ml index 6a5dd75d4aa33cdeee362b4a47421dc519eb5b20..40721ee9ede1307f35c9f8881150d6ebdbbd974a 100644 --- a/src/bin_codec/codec.ml +++ b/src/bin_codec/codec.ml @@ -41,7 +41,7 @@ let base_dir_arg = ("data directory\n\ The directory where the Tezos codec will output logs.\n\ By default: '" ^ default_base_dir ^ "'.") - (parameter (fun _ctxt x -> return x)) + (parameter (fun _ctxt x -> Lwt.return_ok x)) let global_options = Clic.args1 base_dir_arg diff --git a/src/bin_codec/commands.ml b/src/bin_codec/commands.ml index bef6d9a14c9c3941eb98c1448e85631c8c1b8c52..28972c20271db2efadaf54e95abe5e61f0a38668 100644 --- a/src/bin_codec/commands.ml +++ b/src/bin_codec/commands.ml @@ -30,7 +30,7 @@ let group = {name = "encoding"; title = "Commands to handle encodings"} let id_parameter = parameter (fun (cctxt : #Client_context.printer) id -> match Data_encoding.Registration.find id with - | Some record -> return record + | Some record -> Lwt.return_ok record | None -> cctxt#error "Unknown encoding id: %s" id) let json_parameter = @@ -49,7 +49,7 @@ let json_parameter = let bytes_parameter = parameter (fun (cctxt : #Client_context.printer) hex -> match Hex.to_bytes (`Hex hex) with - | Some s -> return s + | Some s -> Lwt.return_ok s | None -> cctxt#error "Invalid hex string: %s" hex) let commands () = diff --git a/src/bin_node/node_data_version.ml b/src/bin_node/node_data_version.ml index 82cec35a9cbe0230dc7b219a1bb951e223bfe5b3..809a9ced522e3c82f64640e193e265dd2585f12c 100644 --- a/src/bin_node/node_data_version.ml +++ b/src/bin_node/node_data_version.ml @@ -61,6 +61,7 @@ let data_version = "0.0.8" converter), and to sequence them dynamically instead of statically. *) let upgradable_data_version = + let open Lwt_tzresult_syntax in [ ( "0.0.6", fun ~data_dir:_ _ ~chain_name:_ ~sandbox_parameters:_ -> return_unit ); diff --git a/src/bin_tps_evaluation/gas_tps_command.ml b/src/bin_tps_evaluation/gas_tps_command.ml index f337e5b01842cd5be3911f1dc2f05b0cb2d76bb5..30f6a5860b1b8fd7a86251125b5397e1b2f254b1 100644 --- a/src/bin_tps_evaluation/gas_tps_command.ml +++ b/src/bin_tps_evaluation/gas_tps_command.ml @@ -34,22 +34,24 @@ type gas_estimation_results = { let estimate_gas_tps ~average_block_path () = Log.info "Gas TPS estimation" ; - Protocol.write_parameter_file - ~base:(Either.right (protocol, Some protocol_constants)) - [] - >>= fun parameter_file -> - Client.init_with_protocol - ~nodes_args:Node.[Connections 0; Synchronisation_threshold 0] - ~parameter_file - ~timestamp_delay:0.0 - `Client - ~protocol - () - >>= fun (node, client) -> - Average_block.load average_block_path >>= fun average_block -> - Average_block.check_for_unknown_smart_contracts average_block >>= fun () -> + let* parameter_file = + Protocol.write_parameter_file + ~base:(Either.right (protocol, Some protocol_constants)) + [] + in + let* (node, client) = + Client.init_with_protocol + ~nodes_args:Node.[Connections 0; Synchronisation_threshold 0] + ~parameter_file + ~timestamp_delay:0.0 + `Client + ~protocol + () + in + let* average_block = Average_block.load average_block_path in + let* () = Average_block.check_for_unknown_smart_contracts average_block in let delegates = make_delegates Constants.default_bootstraps_count in - Baker.init ~protocol ~delegates node client >>= fun baker -> + let* baker = Baker.init ~protocol ~delegates node client in Log.info "Originating smart contracts" ; let* () = Client.stresstest_originate_smart_contracts originating_bootstrap client diff --git a/src/bin_validation/validator.ml b/src/bin_validation/validator.ml index 5eabe939e108c9b6967d5e3639d2a01e76d3deb6..9227d0a7efd231c172e88a83f27244ea0ba078ff 100644 --- a/src/bin_validation/validator.ml +++ b/src/bin_validation/validator.ml @@ -295,7 +295,7 @@ let run input output = (err, None) | Error _ as err -> (err, cache) | Ok {result; cache} -> - ( ok result, + ( Ok result, Some {context_hash = block_header.shell.context; cache} ) in let*! () = diff --git a/src/lib_client_commands/client_keys_commands.ml b/src/lib_client_commands/client_keys_commands.ml index 91e39842cd8fefdc176dac54e862a3744e6a61c5..911e4268ed0e4fc7ca8264494b65025a8e83e9e1 100644 --- a/src/lib_client_commands/client_keys_commands.ml +++ b/src/lib_client_commands/client_keys_commands.ml @@ -243,6 +243,7 @@ let keys_count_param = ~name:"keys_count" ~desc:"How many keys to generate" (parameter (fun _ s -> + let open Lwt_tzresult_syntax in match int_of_string_opt s with | None -> failwith "number of keys must be an integer" | Some x -> @@ -287,8 +288,8 @@ let generate_test_keys = let (pkh, pk, sk) = Signature.generate_key ~algo:Signature.Ed25519 () in - Tezos_signer_backends.Unencrypted.make_pk pk >>?= fun pk_uri -> - Tezos_signer_backends.Unencrypted.make_sk sk >>?= fun sk_uri -> + let*? pk_uri = Tezos_signer_backends.Unencrypted.make_pk pk in + let*? sk_uri = Tezos_signer_backends.Unencrypted.make_sk sk in return ({pkh; pk; sk}, pk_uri, sk_uri, alias)) in let* () = diff --git a/src/lib_context/context.ml b/src/lib_context/context.ml index a7f8495a3b4c9f440031a1b854b9148ee644cdd8..8f0aa599f08c1bb95b7b453127570059eed288a6 100644 --- a/src/lib_context/context.ml +++ b/src/lib_context/context.ml @@ -576,18 +576,20 @@ module Make (Encoding : module type of Tezos_context_encoding.Context) = struct Tree.add t current_test_chain_key id let find_predecessor_block_metadata_hash t = - Tree.find t current_predecessor_block_metadata_hash_key >>= function - | None -> Lwt.return_none + let open Lwt_syntax in + let* o = Tree.find t current_predecessor_block_metadata_hash_key in + match o with + | None -> return_none | Some data -> ( match Data_encoding.Binary.of_bytes_opt Block_metadata_hash.encoding data with | None -> - Lwt.fail + raise (Failure "Unexpected error \ (Context.get_predecessor_block_metadata_hash)") - | Some r -> Lwt.return_some r) + | Some r -> return_some r) let add_predecessor_block_metadata_hash t hash = let data = @@ -596,8 +598,10 @@ module Make (Encoding : module type of Tezos_context_encoding.Context) = struct Tree.add t current_predecessor_block_metadata_hash_key data let find_predecessor_ops_metadata_hash t = - Tree.find t current_predecessor_ops_metadata_hash_key >>= function - | None -> Lwt.return_none + let open Lwt_syntax in + let* o = Tree.find t current_predecessor_ops_metadata_hash_key in + match o with + | None -> return_none | Some data -> ( match Data_encoding.Binary.of_bytes_opt @@ -605,11 +609,11 @@ module Make (Encoding : module type of Tezos_context_encoding.Context) = struct data with | None -> - Lwt.fail + raise (Failure "Unexpected error \ (Context.get_predecessor_ops_metadata_hash)") - | Some r -> Lwt.return_some r) + | Some r -> return_some r) let add_predecessor_ops_metadata_hash t hash = let data = @@ -631,7 +635,9 @@ module Make (Encoding : module type of Tezos_context_encoding.Context) = struct Root_tree.find_predecessor_ops_metadata_hash ctxt.tree let lift_tree_add_to_ctxt tree_add ctxt v = - tree_add ctxt.tree v >|= fun tree -> incr_ops {ctxt with tree} + let open Lwt_syntax in + let+ tree = tree_add ctxt.tree v in + incr_ops {ctxt with tree} let add_protocol = lift_tree_add_to_ctxt Root_tree.add_protocol diff --git a/src/lib_error_monad/error_monad.ml b/src/lib_error_monad/error_monad.ml index 6be41cd9c9b488a5b35d8a4166b6189215e5a500..48bfebdb356234d8d3a9c97898c846acf20bee2b 100644 --- a/src/lib_error_monad/error_monad.ml +++ b/src/lib_error_monad/error_monad.ml @@ -59,9 +59,11 @@ let () = | _ -> None) (fun msg -> Exn (Failure msg)) -let error_with fmt = Format.kasprintf (fun s -> error (Exn (Failure s))) fmt +let error_with fmt = + Format.kasprintf (fun s -> Tzresult_syntax.fail (Exn (Failure s))) fmt -let failwith fmt = Format.kasprintf (fun s -> fail (Exn (Failure s))) fmt +let failwith fmt = + Format.kasprintf (fun s -> Lwt_tzresult_syntax.fail (Exn (Failure s))) fmt let error_of_exn e = Exn e diff --git a/src/lib_error_monad/monad_extension_maker.ml b/src/lib_error_monad/monad_extension_maker.ml index bc90a4bfde141aba1d198e750abd954c574d3d2a..816599d14c37e5132c99c8a57b6b2bb361d4d002 100644 --- a/src/lib_error_monad/monad_extension_maker.ml +++ b/src/lib_error_monad/monad_extension_maker.ml @@ -34,32 +34,34 @@ end) Sig.MONAD_EXTENSION with type error := Error.error and type 'error trace := 'error Trace.trace = struct - (* we default to exposing the combined monad syntax everywhere. - We do the bulk of this by including [Lwt_traced_result_syntax] directly. *) - include Monad.Lwt_traced_result_syntax + module Legacy_monad_globals = struct + (* we default to exposing the combined monad syntax everywhere. + We do the bulk of this by including [Lwt_traced_result_syntax] directly. *) + include Monad.Lwt_traced_result_syntax - (* Some globals that Lwtreslib does not expose but that the Tezos code uses a - lot. *) - let ( >>= ) = Monad.Lwt_syntax.( let* ) + (* Some globals that Lwtreslib does not expose but that the Tezos code uses a + lot. *) + let ( >>= ) = Monad.Lwt_syntax.( let* ) - let ( >|= ) = Monad.Lwt_syntax.( let+ ) + let ( >|= ) = Monad.Lwt_syntax.( let+ ) - let ( >>? ) = Monad.Result_syntax.( let* ) + let ( >>? ) = Monad.Result_syntax.( let* ) - let ( >|? ) = Monad.Result_syntax.( let+ ) + let ( >|? ) = Monad.Result_syntax.( let+ ) - let ok = Monad.Result_syntax.return + let ok = Monad.Result_syntax.return - let error = Monad.Traced_result_syntax.fail + let error = Monad.Traced_result_syntax.fail - let ( >>=? ) = Monad.Lwt_result_syntax.( let* ) + let ( >>=? ) = Monad.Lwt_result_syntax.( let* ) - let ( >|=? ) = Monad.Lwt_result_syntax.( let+ ) + let ( >|=? ) = Monad.Lwt_result_syntax.( let+ ) - let ( >>?= ) = Monad.Lwt_result_syntax.( let*? ) + let ( >>?= ) = Monad.Lwt_result_syntax.( let*? ) - let ( >|?= ) r f = - match r with Error _ as e -> Lwt.return e | Ok o -> Lwt_result.ok (f o) + let ( >|?= ) r f = + match r with Error _ as e -> Lwt.return e | Ok o -> Lwt_result.ok (f o) + end (* default (traced-everywhere) helper types *) type tztrace = Error.error Trace.trace @@ -127,18 +129,26 @@ end) | ok -> Lwt.return ok let error_unless cond exn = - if cond then Monad.Traced_result_syntax.return_unit else error exn + let open Monad.Traced_result_syntax in + if cond then return_unit else fail exn let error_when cond exn = - if cond then error exn else Monad.Traced_result_syntax.return_unit + let open Monad.Traced_result_syntax in + if cond then fail exn else return_unit - let fail_unless cond exn = if cond then return_unit else fail exn + let fail_unless cond exn = + let open Monad.Lwt_traced_result_syntax in + if cond then return_unit else fail exn - let fail_when cond exn = if cond then fail exn else return_unit + let fail_when cond exn = + let open Monad.Lwt_traced_result_syntax in + if cond then fail exn else return_unit - let unless cond f = if cond then return_unit else f () + let unless cond f = + if cond then Monad.Lwt_traced_result_syntax.return_unit else f () - let when_ cond f = if cond then f () else return_unit + let when_ cond f = + if cond then f () else Monad.Lwt_traced_result_syntax.return_unit let dont_wait f err_handler exc_handler = let open Monad.Lwt_syntax in diff --git a/src/lib_error_monad/sig.ml b/src/lib_error_monad/sig.ml index b3e041e656fdef8bd61538d4a16f374536f88121..f8c9c43475904d81d8cde8efa2031345b65a8920 100644 --- a/src/lib_error_monad/sig.ml +++ b/src/lib_error_monad/sig.ml @@ -253,46 +253,47 @@ module type MONAD_EXTENSION = sig val classify_trace : tztrace -> Error_classification.t - val return : 'a -> ('a, 'e) result Lwt.t + module Legacy_monad_globals : sig + val return : 'a -> ('a, 'e) result Lwt.t - val return_unit : (unit, 'e) result Lwt.t + val return_unit : (unit, 'e) result Lwt.t - val return_none : ('a option, 'e) result Lwt.t + val return_none : ('a option, 'e) result Lwt.t - val return_some : 'a -> ('a option, 'e) result Lwt.t + val return_some : 'a -> ('a option, 'e) result Lwt.t - val return_nil : ('a list, 'e) result Lwt.t + val return_nil : ('a list, 'e) result Lwt.t - val return_true : (bool, 'e) result Lwt.t + val return_true : (bool, 'e) result Lwt.t - val return_false : (bool, 'e) result Lwt.t + val return_false : (bool, 'e) result Lwt.t - (** more globals *) - val ( >>= ) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t + val ( >>= ) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t - val ( >|= ) : 'a Lwt.t -> ('a -> 'b) -> 'b Lwt.t + val ( >|= ) : 'a Lwt.t -> ('a -> 'b) -> 'b Lwt.t - val ok : 'a -> ('a, 'e) result + val ok : 'a -> ('a, 'e) result - val error : 'e -> ('a, 'e trace) result + val error : 'e -> ('a, 'e trace) result - val ( >>? ) : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result + val ( >>? ) : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result - val ( >|? ) : ('a, 'e) result -> ('a -> 'b) -> ('b, 'e) result + val ( >|? ) : ('a, 'e) result -> ('a -> 'b) -> ('b, 'e) result - val fail : 'e -> ('a, 'e trace) result Lwt.t + val fail : 'e -> ('a, 'e trace) result Lwt.t - val ( >>=? ) : - ('a, 'e) result Lwt.t -> - ('a -> ('b, 'e) result Lwt.t) -> - ('b, 'e) result Lwt.t + val ( >>=? ) : + ('a, 'e) result Lwt.t -> + ('a -> ('b, 'e) result Lwt.t) -> + ('b, 'e) result Lwt.t - val ( >|=? ) : ('a, 'e) result Lwt.t -> ('a -> 'b) -> ('b, 'e) result Lwt.t + val ( >|=? ) : ('a, 'e) result Lwt.t -> ('a -> 'b) -> ('b, 'e) result Lwt.t - val ( >>?= ) : - ('a, 'e) result -> ('a -> ('b, 'e) result Lwt.t) -> ('b, 'e) result Lwt.t + val ( >>?= ) : + ('a, 'e) result -> ('a -> ('b, 'e) result Lwt.t) -> ('b, 'e) result Lwt.t - val ( >|?= ) : ('a, 'e) result -> ('a -> 'b Lwt.t) -> ('b, 'e) result Lwt.t + val ( >|?= ) : ('a, 'e) result -> ('a -> 'b Lwt.t) -> ('b, 'e) result Lwt.t + end (* Pretty-prints an error trace. *) val pp_print_trace : Format.formatter -> error trace -> unit diff --git a/src/lib_protocol_environment/environment_V0.ml b/src/lib_protocol_environment/environment_V0.ml index b2b03bddacf5f98bebad30f8284cb14ff7c72c98..c8340b3246b86ab1c4cf6df027f0104efdaf1e19 100644 --- a/src/lib_protocol_environment/environment_V0.ml +++ b/src/lib_protocol_environment/environment_V0.ml @@ -382,10 +382,13 @@ struct (Tezos_error_monad.TzLwtreslib.Monad) (* below is for backward compatibility *) + include Error_monad_infix_globals include Error_monad_traversors include Error_monad_trace_eval - let ( >>|? ) = Lwt_result_syntax.( let+ ) + let fail e = Lwt.return_error (TzTrace.make e) + + let error e = Error (TzTrace.make e) (* Shouldn't be used, only to keep the same environment interface *) let classify_errors = function diff --git a/src/lib_protocol_environment/environment_V1.ml b/src/lib_protocol_environment/environment_V1.ml index 79dd9b251bed046c7f01a2f2cfe3e13ce5c2c73c..aa85063df0355876f4548c7704dfc994da968228 100644 --- a/src/lib_protocol_environment/environment_V1.ml +++ b/src/lib_protocol_environment/environment_V1.ml @@ -569,10 +569,15 @@ struct (Tezos_error_monad.TzLwtreslib.Monad) (* Backwards compatibility additions (traversors, dont_wait, trace) *) + include Error_monad_infix_globals include Error_monad_traversors include Error_monad_preallocated_values include Error_monad_trace_eval + let fail e = Lwt.return_error (TzTrace.make e) + + let error e = Error (TzTrace.make e) + let dont_wait ex er f = dont_wait f er ex type 'err trace = 'err TzTrace.trace diff --git a/src/lib_protocol_environment/environment_V2.ml b/src/lib_protocol_environment/environment_V2.ml index 1338d0322fa0b8577800d706ea12b269410653d6..ebac989eb089714d8088a53966086a1851ca0a25 100644 --- a/src/lib_protocol_environment/environment_V2.ml +++ b/src/lib_protocol_environment/environment_V2.ml @@ -577,10 +577,15 @@ struct (Tezos_error_monad.TzLwtreslib.Monad) (* Backwards compatibility additions (traversors, dont_wait, trace helpers) *) + include Error_monad_infix_globals include Error_monad_traversors include Error_monad_preallocated_values include Error_monad_trace_eval + let fail e = Lwt.return_error (TzTrace.make e) + + let error e = Error (TzTrace.make e) + let dont_wait ex er f = dont_wait f er ex let make_trace_encoding e = TzTrace.encoding e diff --git a/src/lib_protocol_environment/environment_V3.ml b/src/lib_protocol_environment/environment_V3.ml index de11671715ff782f2c0fd71c771025389e68c6f7..831017b7b8e679f4efe867b26f8d207204ac7e2b 100644 --- a/src/lib_protocol_environment/environment_V3.ml +++ b/src/lib_protocol_environment/environment_V3.ml @@ -664,11 +664,17 @@ struct (Tezos_error_monad.TzLwtreslib.Monad) (* Backwards compatibility additions (dont_wait, trace helpers) *) + include Tezos_protocol_environment_structs.V3.M.Error_monad_infix_globals + include Tezos_protocol_environment_structs.V3.M.Error_monad_preallocated_values include Tezos_protocol_environment_structs.V3.M.Error_monad_trace_eval + let fail e = Lwt.return_error (TzTrace.make e) + + let error e = Error (TzTrace.make e) + let dont_wait ex er f = dont_wait f er ex let trace_of_error e = TzTrace.make e diff --git a/src/lib_protocol_environment/environment_V4.ml b/src/lib_protocol_environment/environment_V4.ml index 91711430ffddc37adc767a8600c002ee739301b1..0d894ecf713c4893e2a7a665dee60acf22af374f 100644 --- a/src/lib_protocol_environment/environment_V4.ml +++ b/src/lib_protocol_environment/environment_V4.ml @@ -713,6 +713,12 @@ struct (Tezos_error_monad.TzLwtreslib.Monad) (* Backwards compatibility additions (dont_wait, trace helpers) *) + include Tezos_protocol_environment_structs.V4.M.Error_monad_infix_globals + + let fail e = Lwt.return_error (TzTrace.make e) + + let error e = Error (TzTrace.make e) + let dont_wait ex er f = dont_wait f er ex let trace_of_error e = TzTrace.make e diff --git a/src/lib_protocol_environment/environment_V5.ml b/src/lib_protocol_environment/environment_V5.ml index cc4d1f22353fe57ef26c0dc4142d0f394236e5de..99cee206cecc63fe90c0a474a50b3f8d938b4eb3 100644 --- a/src/lib_protocol_environment/environment_V5.ml +++ b/src/lib_protocol_environment/environment_V5.ml @@ -686,6 +686,12 @@ struct (Tezos_error_monad.TzLwtreslib.Monad) (* Backwards compatibility additions (dont_wait, trace helpers) *) + include Tezos_protocol_environment_structs.V5.M.Error_monad_infix_globals + + let fail e = Lwt.return_error (TzTrace.make e) + + let error e = Error (TzTrace.make e) + let dont_wait ex er f = dont_wait f er ex let trace_of_error e = TzTrace.make e diff --git a/src/lib_protocol_environment/structs/v0.dune.inc b/src/lib_protocol_environment/structs/v0.dune.inc index 02db3712e599d9284bc4ebedabcac0f9ce337dc0..342c215adf65cbc857fac102689bb4e204e9445f 100644 --- a/src/lib_protocol_environment/structs/v0.dune.inc +++ b/src/lib_protocol_environment/structs/v0.dune.inc @@ -18,6 +18,7 @@ v0/context_hash.ml v0/error_monad_traversors.ml v0/data_encoding.ml + v0/error_monad_infix_globals.ml v0/error_monad_trace_eval.ml v0/error_monad_classification.ml ) diff --git a/src/lib_protocol_environment/structs/v0/error_monad_infix_globals.ml b/src/lib_protocol_environment/structs/v0/error_monad_infix_globals.ml new file mode 100644 index 0000000000000000000000000000000000000000..7074a10b3a66d92febe72a63c02fe4a2722585a1 --- /dev/null +++ b/src/lib_protocol_environment/structs/v0/error_monad_infix_globals.ml @@ -0,0 +1,62 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let return = Lwt.return_ok + +let return_unit = Lwt.return_ok () + +let return_true = Lwt.return_ok true + +let return_false = Lwt.return_ok false + +let return_nil = Lwt.return_ok [] + +let return_none = Lwt.return_ok None + +let return_some x = Lwt.return_ok (Some x) + +let ( >>= ) = Lwt.bind + +let ( >|= ) v f = Lwt.map f v + +let ( >>? ) = Result.bind + +let ( >|? ) v f = Result.map f v + +let ( >>=? ) = Lwt_result.bind + +let ( >|=? ) v f = Lwt_result.map f v + +let ( >>?= ) v f = match v with Error e -> Lwt.return_error e | Ok o -> f o + +let ( >|?= ) v f = + match v with + | Error e -> Lwt.return_error e + | Ok o -> f o >>= fun x -> Lwt.return_ok x + +let ok x = Ok x + +let ( >>|? ) v f = + v >>= function Error e -> Lwt.return_error e | Ok v -> Lwt.return_ok (f v) diff --git a/src/lib_protocol_environment/structs/v1.dune.inc b/src/lib_protocol_environment/structs/v1.dune.inc index 989efa6ef2d35ca745f2d9555a14e53fbdcf4524..653e8cb36dc48fa23fa359373495061e6e52d190 100644 --- a/src/lib_protocol_environment/structs/v1.dune.inc +++ b/src/lib_protocol_environment/structs/v1.dune.inc @@ -20,6 +20,7 @@ v1/bls12_381.ml v1/error_monad_preallocated_values.ml v1/hex.ml + v0/error_monad_infix_globals.ml v0/error_monad_trace_eval.ml v0/error_monad_classification.ml ) diff --git a/src/lib_protocol_environment/structs/v2.dune.inc b/src/lib_protocol_environment/structs/v2.dune.inc index 00b7e7b86540bd21c6c22b2bb79b6521f0df5eff..4a95190c93c484f7ded01ff3796b8de80a9b5657 100644 --- a/src/lib_protocol_environment/structs/v2.dune.inc +++ b/src/lib_protocol_environment/structs/v2.dune.inc @@ -19,6 +19,7 @@ v1/bls12_381.ml v1/error_monad_preallocated_values.ml v1/hex.ml + v0/error_monad_infix_globals.ml v0/error_monad_trace_eval.ml v0/error_monad_classification.ml ) diff --git a/src/lib_protocol_environment/structs/v3.dune.inc b/src/lib_protocol_environment/structs/v3.dune.inc index 77ad80ebd318ca9bbf4a1c18eb8ee6442aeb44e1..0d77bddef9646d208512675d990ff2821221460e 100644 --- a/src/lib_protocol_environment/structs/v3.dune.inc +++ b/src/lib_protocol_environment/structs/v3.dune.inc @@ -7,6 +7,7 @@ v1/bls12_381.ml v1/error_monad_preallocated_values.ml v1/hex.ml + v0/error_monad_infix_globals.ml v0/error_monad_trace_eval.ml v0/error_monad_classification.ml ) diff --git a/src/lib_protocol_environment/structs/v4.dune.inc b/src/lib_protocol_environment/structs/v4.dune.inc index f17dfe0061d7c433862107db51276314877f8cc6..0cf7c0e021120d82810fc7aa7820251f0026da45 100644 --- a/src/lib_protocol_environment/structs/v4.dune.inc +++ b/src/lib_protocol_environment/structs/v4.dune.inc @@ -4,6 +4,7 @@ v3/data_encoding.ml v3/replicated_signatures.ml v3/lwtreslib_list_combine.ml + v0/error_monad_infix_globals.ml ) (action (with-stdout-to %{targets} (chdir %{workspace_root}} diff --git a/src/lib_protocol_environment/structs/v5.dune.inc b/src/lib_protocol_environment/structs/v5.dune.inc index 2eab0a72d0e5e63ecc3472ea462e6758edadced6..eb7b33e0bb4f4730687e97348abad0ab18311ef6 100644 --- a/src/lib_protocol_environment/structs/v5.dune.inc +++ b/src/lib_protocol_environment/structs/v5.dune.inc @@ -1,6 +1,7 @@ (rule (targets v5.ml) (deps + v0/error_monad_infix_globals.ml ) (action (with-stdout-to %{targets} (chdir %{workspace_root}} diff --git a/src/lib_protocol_environment/test/test_mem_context.ml b/src/lib_protocol_environment/test/test_mem_context.ml index 4e167c7380f8d9e670d4f0069ec9d561c1365c41..8feea9bcc20e6a6deb3c003f63ed7390a7cd36ff 100644 --- a/src/lib_protocol_environment/test/test_mem_context.ml +++ b/src/lib_protocol_environment/test/test_mem_context.ml @@ -94,21 +94,21 @@ let test_simple {block2 = ctxt; _} = Assert.equal_string_option ~msg:__LOC__ (Some "Juin") (c juin) ; (* Mem function returns "true" if the key given leads to an existing leaf *) - Context.mem ctxt ["a"] >>= fun res -> + let* res = Context.mem ctxt ["a"] in Assert.equal_bool false res ; - Context.mem ctxt ["a"; "c"] >>= fun res -> + let* res = Context.mem ctxt ["a"; "c"] in Assert.equal_bool true res ; - Context.mem ctxt ["a"; "x"] >>= fun res -> + let* res = Context.mem ctxt ["a"; "x"] in Assert.equal_bool false res ; (* Mem_tree is like "mem", but also returns "true" for a trunk node *) - Context.mem_tree ctxt ["a"] >>= fun res -> + let* res = Context.mem_tree ctxt ["a"] in Assert.equal_bool true res ; - Context.mem_tree ctxt ["a"; "c"] >>= fun res -> + let* res = Context.mem_tree ctxt ["a"; "c"] in Assert.equal_bool true res ; - Context.mem_tree ctxt ["a"; "x"] >>= fun res -> + let* res = Context.mem_tree ctxt ["a"; "x"] in Assert.equal_bool false res ; - Lwt.return_unit + return_unit (** Restore the context applied until [block3a]. It is asserted that the following key-values are present: diff --git a/src/lib_store/cemented_block_store.ml b/src/lib_store/cemented_block_store.ml index 374fc282c2c49e49f7000eb2334dd291ad36627c..bc39d7e304aabaad172850869023161012688364 100644 --- a/src/lib_store/cemented_block_store.ml +++ b/src/lib_store/cemented_block_store.ml @@ -668,7 +668,7 @@ let cement_blocks ?(check_consistency = true) (cemented_store : t) cemented_store.cemented_blocks_files <- Some new_array ; (* Compress and write the metadatas *) if write_metadata then - Store_events.(emit start_cementing_blocks_metadata) () >>= fun () -> + let*! () = Store_events.(emit start_cementing_blocks_metadata) () in cement_blocks_metadata cemented_store blocks else return_unit @@ -728,9 +728,10 @@ let trigger_rolling_gc cemented_store cemented_blocks_files offset = files_to_remove let trigger_gc cemented_store history_mode = - Store_events.(emit start_store_garbage_collection) () >>= fun () -> + let open Lwt_syntax in + let* () = Store_events.(emit start_store_garbage_collection) () in match cemented_store.cemented_blocks_files with - | None -> Lwt.return_unit + | None -> return_unit | Some cemented_blocks_files -> ( match history_mode with | History_mode.Archive -> Lwt.return_unit diff --git a/src/lib_store/test/alpha_utils.ml b/src/lib_store/test/alpha_utils.ml index 5109e76ef9872b93fbec9ca62e49531825155973..c455f6f2d43003f242ee5cc302bd12f71c3eef9b 100644 --- a/src/lib_store/test/alpha_utils.ml +++ b/src/lib_store/test/alpha_utils.ml @@ -149,7 +149,7 @@ let make_rpc_context ~chain_id ctxt block = {shell = header; protocol_data = Store.Block.protocol_data block} in let ctxt = Shell_context.wrap_disk_context ctxt in - let* value_of_key = + let*! value_of_key = Main.value_of_key ~chain_id ~predecessor_context:ctxt @@ -158,16 +158,22 @@ let make_rpc_context ~chain_id ctxt block = ~predecessor_fitness ~predecessor ~timestamp - >|= Tezos_protocol_alpha.Protocol.Environment.wrap_tzresult in - Tezos_protocol_environment.Context.load_cache - (Store.Block.hash block) - ctxt - `Lazy - (fun key -> - value_of_key key - >|= Tezos_protocol_alpha.Protocol.Environment.wrap_tzresult) - >>=? fun ctxt -> + let*? value_of_key = + Tezos_protocol_alpha.Protocol.Environment.wrap_tzresult value_of_key + in + let* ctxt = + Tezos_protocol_environment.Context.load_cache + (Store.Block.hash block) + ctxt + `Lazy + (fun key -> + let*! value = value_of_key key in + let*? value = + Tezos_protocol_alpha.Protocol.Environment.wrap_tzresult value + in + return value) + in return @@ new Environment.proto_rpc_context_of_directory (fun block -> diff --git a/src/proto_000_Ps9mPmXa/lib_client/dune b/src/proto_000_Ps9mPmXa/lib_client/dune index 20eec0e7a2396a494522125dfe03887807c49c79..aa6e04c8f32144fc53276ada145b40832bedfb62 100644 --- a/src/proto_000_Ps9mPmXa/lib_client/dune +++ b/src/proto_000_Ps9mPmXa/lib_client/dune @@ -12,6 +12,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_000_Ps9mPmXa diff --git a/src/proto_001_PtCJ7pwo/lib_client/dune b/src/proto_001_PtCJ7pwo/lib_client/dune index dec141846fa8873ae4d248fde47fd9b967e4f4a9..0c548d65d0967d1700d766bd708e3b03a0cb6313 100644 --- a/src/proto_001_PtCJ7pwo/lib_client/dune +++ b/src/proto_001_PtCJ7pwo/lib_client/dune @@ -14,6 +14,7 @@ -w -9+27-30-32-40@8 -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_001_PtCJ7pwo diff --git a/src/proto_001_PtCJ7pwo/lib_client_commands/dune b/src/proto_001_PtCJ7pwo/lib_client_commands/dune index d29c87e6d09c99025bb62039d23c66357718fde0..06c9b988d19976e29363e484ec93750109e5c5fe 100644 --- a/src/proto_001_PtCJ7pwo/lib_client_commands/dune +++ b/src/proto_001_PtCJ7pwo/lib_client_commands/dune @@ -14,6 +14,7 @@ (modules (:standard \ alpha_commands_registration)) (flags (:standard -w -9+27-30-32-40@8 -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_001_PtCJ7pwo -open Tezos_stdlib_unix -open Tezos_shell_services @@ -38,6 +39,7 @@ (modules alpha_commands_registration) (flags (:standard -w -9+27-30-32-40@8 -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_001_PtCJ7pwo -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_002_PsYLVpVv/lib_client/dune b/src/proto_002_PsYLVpVv/lib_client/dune index 93ba29829c61adef79c1f225c09ea672959f0b24..0e1eaefd50110231744cd5396a6820cf23e0aa0b 100644 --- a/src/proto_002_PsYLVpVv/lib_client/dune +++ b/src/proto_002_PsYLVpVv/lib_client/dune @@ -14,6 +14,7 @@ -w -9+27-30-32-40@8 -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_002_PsYLVpVv diff --git a/src/proto_002_PsYLVpVv/lib_client_commands/dune b/src/proto_002_PsYLVpVv/lib_client_commands/dune index b4c1b09f8e1714b96db9cbb9f715675a6048c876..20fcb71b52ecdd375db68e5ec241710cc5e983dc 100644 --- a/src/proto_002_PsYLVpVv/lib_client_commands/dune +++ b/src/proto_002_PsYLVpVv/lib_client_commands/dune @@ -14,6 +14,7 @@ (modules (:standard \ alpha_commands_registration)) (flags (:standard -w -9+27-30-32-40@8 -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_002_PsYLVpVv -open Tezos_stdlib_unix -open Tezos_shell_services @@ -38,6 +39,7 @@ (modules alpha_commands_registration) (flags (:standard -w -9+27-30-32-40@8 -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_002_PsYLVpVv -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_003_PsddFKi3/lib_client/dune b/src/proto_003_PsddFKi3/lib_client/dune index 2f0b22d3e74205294b547e52d9ce7655d944e1d8..132a826367349c0775561c9579ae755751c6587c 100644 --- a/src/proto_003_PsddFKi3/lib_client/dune +++ b/src/proto_003_PsddFKi3/lib_client/dune @@ -12,6 +12,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_003_PsddFKi3 diff --git a/src/proto_003_PsddFKi3/lib_client_commands/dune b/src/proto_003_PsddFKi3/lib_client_commands/dune index e21617853f83ef4b0685baf8c002cd41727f2068..73d40df38d6b93c6e7fab74722f3cb4e911c4433 100644 --- a/src/proto_003_PsddFKi3/lib_client_commands/dune +++ b/src/proto_003_PsddFKi3/lib_client_commands/dune @@ -12,6 +12,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_003_PsddFKi3 -open Tezos_stdlib_unix -open Tezos_shell_services @@ -35,6 +36,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_003_PsddFKi3 -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_004_Pt24m4xi/lib_client/dune b/src/proto_004_Pt24m4xi/lib_client/dune index 1c054fabac2e35dd27a4ed36ca6ce6d8b3c22c9e..6f7e593b630605ba5931548a41855b18979f8443 100644 --- a/src/proto_004_Pt24m4xi/lib_client/dune +++ b/src/proto_004_Pt24m4xi/lib_client/dune @@ -12,6 +12,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_004_Pt24m4xi diff --git a/src/proto_004_Pt24m4xi/lib_client_commands/dune b/src/proto_004_Pt24m4xi/lib_client_commands/dune index ff9cc9fb75c90417450a1683c165fb3d6531d56c..ba294298a95f67aa4912f6e1be402bacb3d8ab72 100644 --- a/src/proto_004_Pt24m4xi/lib_client_commands/dune +++ b/src/proto_004_Pt24m4xi/lib_client_commands/dune @@ -12,6 +12,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_004_Pt24m4xi -open Tezos_stdlib_unix -open Tezos_shell_services @@ -35,6 +36,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_004_Pt24m4xi -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_005_PsBabyM1/lib_client/dune b/src/proto_005_PsBabyM1/lib_client/dune index 97950484879571c9ee5b02651266c403ce56ba62..91a8799608ecc083a320c38097fea9c949cb2c05 100644 --- a/src/proto_005_PsBabyM1/lib_client/dune +++ b/src/proto_005_PsBabyM1/lib_client/dune @@ -12,6 +12,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_005_PsBabyM1 diff --git a/src/proto_005_PsBabyM1/lib_client/managed_contract.ml b/src/proto_005_PsBabyM1/lib_client/managed_contract.ml index e198660a53c2df264500831ea55ac1d194cb3258..84a5e4208667ef3c211b17711e65ecf1b0531fff 100644 --- a/src/proto_005_PsBabyM1/lib_client/managed_contract.ml +++ b/src/proto_005_PsBabyM1/lib_client/managed_contract.ml @@ -71,8 +71,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let set_delegate (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch ~fee_parameter ?fee ~source ~src_pk ~src_sk diff --git a/src/proto_005_PsBabyM1/lib_client_commands/dune b/src/proto_005_PsBabyM1/lib_client_commands/dune index 18832cf0f8c8ac4ad3368e477a67d61d11fbc664..3147034212884ab2c8791de9188039937d97df58 100644 --- a/src/proto_005_PsBabyM1/lib_client_commands/dune +++ b/src/proto_005_PsBabyM1/lib_client_commands/dune @@ -12,6 +12,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_005_PsBabyM1 -open Tezos_stdlib_unix -open Tezos_shell_services @@ -35,6 +36,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_005_PsBabyM1 -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_006_PsCARTHA/lib_client/dune b/src/proto_006_PsCARTHA/lib_client/dune index 6724a9a9d8cb2ef6193218d2877b936484c78216..8674f56ba04d984dad3603e8446663189f2612b3 100644 --- a/src/proto_006_PsCARTHA/lib_client/dune +++ b/src/proto_006_PsCARTHA/lib_client/dune @@ -12,6 +12,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_006_PsCARTHA diff --git a/src/proto_006_PsCARTHA/lib_client/managed_contract.ml b/src/proto_006_PsCARTHA/lib_client/managed_contract.ml index a6c895bd0a26bf4f37850348aaeef78974dfcf44..73cceaf22533d44f48ea42d4df52b34f09c13cb9 100644 --- a/src/proto_006_PsCARTHA/lib_client/managed_contract.ml +++ b/src/proto_006_PsCARTHA/lib_client/managed_contract.ml @@ -71,8 +71,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let set_delegate (cctxt : #full) ~chain ~block ?confirmations ?dry_run ?verbose_signing ?branch ~fee_parameter ?fee ~source ~src_pk ~src_sk diff --git a/src/proto_006_PsCARTHA/lib_client_commands/dune b/src/proto_006_PsCARTHA/lib_client_commands/dune index 2a07e64dbf4220732ba7b6afaacb4061f41b0ca5..ab593d63239f54361023491522614075ffd7eb51 100644 --- a/src/proto_006_PsCARTHA/lib_client_commands/dune +++ b/src/proto_006_PsCARTHA/lib_client_commands/dune @@ -12,6 +12,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_006_PsCARTHA -open Tezos_stdlib_unix -open Tezos_shell_services @@ -35,6 +36,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_006_PsCARTHA -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_007_PsDELPH1/lib_client/dune b/src/proto_007_PsDELPH1/lib_client/dune index e8149f2ed283b796586a658b8016ab86c7440ec0..d7ccf0f3b3108a010f1cc2137cd8016a3fb902e4 100644 --- a/src/proto_007_PsDELPH1/lib_client/dune +++ b/src/proto_007_PsDELPH1/lib_client/dune @@ -15,6 +15,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_007_PsDELPH1 diff --git a/src/proto_007_PsDELPH1/lib_client_commands/dune b/src/proto_007_PsDELPH1/lib_client_commands/dune index 0d639f6f612d22c05d98f5fb8e7b62c54977c5cc..c3868940f9226390a750a6aa0c9527fc54900c62 100644 --- a/src/proto_007_PsDELPH1/lib_client_commands/dune +++ b/src/proto_007_PsDELPH1/lib_client_commands/dune @@ -15,6 +15,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_007_PsDELPH1 -open Tezos_stdlib_unix -open Tezos_shell_services @@ -38,6 +39,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_007_PsDELPH1 -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_007_PsDELPH1/lib_plugin/dune b/src/proto_007_PsDELPH1/lib_plugin/dune index ba7a2f69bd47ae2818af55eafab471d826447610..4a6eab558762a536383648d0ea87ea2d1daea50f 100644 --- a/src/proto_007_PsDELPH1/lib_plugin/dune +++ b/src/proto_007_PsDELPH1/lib_plugin/dune @@ -5,6 +5,7 @@ tezos-protocol-007-PsDELPH1) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_007_PsDELPH1))) (library @@ -16,6 +17,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_007_PsDELPH1 -open Tezos_protocol_plugin_007_PsDELPH1 -open Tezos_shell))) diff --git a/src/proto_008_PtEdo2Zk/lib_client/client_proto_multisig.ml b/src/proto_008_PtEdo2Zk/lib_client/client_proto_multisig.ml index 9de5516df8df4cced524c675162b711c063ddf20..8a58d78c925f0d2c49edf78c5986a038d9309e4e 100644 --- a/src/proto_008_PtEdo2Zk/lib_client/client_proto_multisig.ml +++ b/src/proto_008_PtEdo2Zk/lib_client/client_proto_multisig.ml @@ -644,8 +644,7 @@ let action_to_expr_generic ~loc = function ~parameter ~amount >|? left ~loc) - | Lambda code -> - Error_monad.ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) | Change_delegate delegate -> lambda_from_string @@ Managed_contract.build_lambda_for_set_delegate ~delegate @@ -653,37 +652,36 @@ let action_to_expr_generic ~loc = function | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok expr + ok expr let action_to_expr_legacy ~loc = function | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:0) - then Error_monad.error @@ Unsupported_feature_generic_call parameter + then error @@ Unsupported_feature_generic_call parameter else if parameter_type <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:0) - then - Error_monad.error @@ Unsupported_feature_generic_call_ty parameter_type + then error @@ Unsupported_feature_generic_call_ty parameter_type else - Error_monad.ok + ok @@ left ~loc (pair ~loc (mutez ~loc amount) (optimized_address ~loc ~address:destination ~entrypoint)) - | Lambda _ -> Error_monad.error @@ Unsupported_feature_lambda "" + | Lambda _ -> error @@ Unsupported_feature_lambda "" | Change_delegate delegate -> let delegate_opt = match delegate with | None -> none ~loc () | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) in - Error_monad.ok @@ right ~loc (left ~loc delegate_opt) + ok @@ right ~loc (left ~loc delegate_opt) | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok (right ~loc expr) + ok (right ~loc expr) let action_to_expr ~loc ~generic action = if generic then action_to_expr_generic ~loc action diff --git a/src/proto_008_PtEdo2Zk/lib_client/dune b/src/proto_008_PtEdo2Zk/lib_client/dune index 91a65c9f1008f040fd6057513a67ceecc2215353..4e6194969accbe9bcbfe3270e886e9b8f1a0b107 100644 --- a/src/proto_008_PtEdo2Zk/lib_client/dune +++ b/src/proto_008_PtEdo2Zk/lib_client/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_008_PtEdo2Zk diff --git a/src/proto_008_PtEdo2Zk/lib_client/managed_contract.ml b/src/proto_008_PtEdo2Zk/lib_client/managed_contract.ml index d043f048b6e1888f91f8b51d60f4513b68fc92b4..8dc8f7f8d49975cd3700388ae4ebaff58964cb60 100644 --- a/src/proto_008_PtEdo2Zk/lib_client/managed_contract.ml +++ b/src/proto_008_PtEdo2Zk/lib_client/managed_contract.ml @@ -81,8 +81,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let build_lambda_for_set_delegate ~delegate = match delegate with diff --git a/src/proto_008_PtEdo2Zk/lib_client_commands/dune b/src/proto_008_PtEdo2Zk/lib_client_commands/dune index 3670fca3594f758b53c49817994f42a2cfc27320..d8f4fb0ea3ac647eb4a9c9803c80e5c8638f4736 100644 --- a/src/proto_008_PtEdo2Zk/lib_client_commands/dune +++ b/src/proto_008_PtEdo2Zk/lib_client_commands/dune @@ -17,6 +17,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_008_PtEdo2Zk -open Tezos_stdlib_unix -open Tezos_shell_services @@ -44,6 +45,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_008_PtEdo2Zk -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_008_PtEdo2Zk/lib_client_sapling/dune b/src/proto_008_PtEdo2Zk/lib_client_sapling/dune index bb622c0949bb1ef3dc2833b1a87cd8f951a72d14..f7050d9fc679adcead0d9532b71f10d7747e37d7 100644 --- a/src/proto_008_PtEdo2Zk/lib_client_sapling/dune +++ b/src/proto_008_PtEdo2Zk/lib_client_sapling/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_008_PtEdo2Zk diff --git a/src/proto_008_PtEdo2Zk/lib_plugin/dune b/src/proto_008_PtEdo2Zk/lib_plugin/dune index 4e435902d17623f3f6c778f60f54564301629d83..211ba0ab4fb7a5cecc73c390fb0db9d9b5f9f8d1 100644 --- a/src/proto_008_PtEdo2Zk/lib_plugin/dune +++ b/src/proto_008_PtEdo2Zk/lib_plugin/dune @@ -6,6 +6,7 @@ tezos-protocol-008-PtEdo2Zk) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_008_PtEdo2Zk))) (library @@ -18,6 +19,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_008_PtEdo2Zk -open Tezos_protocol_plugin_008_PtEdo2Zk -open Tezos_shell))) diff --git a/src/proto_009_PsFLoren/lib_client/client_proto_multisig.ml b/src/proto_009_PsFLoren/lib_client/client_proto_multisig.ml index 9de5516df8df4cced524c675162b711c063ddf20..8a58d78c925f0d2c49edf78c5986a038d9309e4e 100644 --- a/src/proto_009_PsFLoren/lib_client/client_proto_multisig.ml +++ b/src/proto_009_PsFLoren/lib_client/client_proto_multisig.ml @@ -644,8 +644,7 @@ let action_to_expr_generic ~loc = function ~parameter ~amount >|? left ~loc) - | Lambda code -> - Error_monad.ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) | Change_delegate delegate -> lambda_from_string @@ Managed_contract.build_lambda_for_set_delegate ~delegate @@ -653,37 +652,36 @@ let action_to_expr_generic ~loc = function | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok expr + ok expr let action_to_expr_legacy ~loc = function | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:0) - then Error_monad.error @@ Unsupported_feature_generic_call parameter + then error @@ Unsupported_feature_generic_call parameter else if parameter_type <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:0) - then - Error_monad.error @@ Unsupported_feature_generic_call_ty parameter_type + then error @@ Unsupported_feature_generic_call_ty parameter_type else - Error_monad.ok + ok @@ left ~loc (pair ~loc (mutez ~loc amount) (optimized_address ~loc ~address:destination ~entrypoint)) - | Lambda _ -> Error_monad.error @@ Unsupported_feature_lambda "" + | Lambda _ -> error @@ Unsupported_feature_lambda "" | Change_delegate delegate -> let delegate_opt = match delegate with | None -> none ~loc () | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) in - Error_monad.ok @@ right ~loc (left ~loc delegate_opt) + ok @@ right ~loc (left ~loc delegate_opt) | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok (right ~loc expr) + ok (right ~loc expr) let action_to_expr ~loc ~generic action = if generic then action_to_expr_generic ~loc action diff --git a/src/proto_009_PsFLoren/lib_client/dune b/src/proto_009_PsFLoren/lib_client/dune index 053ca9426a41642f3639937aa96921b38eaed52f..67d84a2556ec5c37eadcd8863715c5f9337a40a1 100644 --- a/src/proto_009_PsFLoren/lib_client/dune +++ b/src/proto_009_PsFLoren/lib_client/dune @@ -19,6 +19,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_009_PsFLoren diff --git a/src/proto_009_PsFLoren/lib_client/managed_contract.ml b/src/proto_009_PsFLoren/lib_client/managed_contract.ml index 7a87968322c3a89a677e8cc5c2f693df7173271e..ac99cad8a92626a56e31481dabccdde6b757aa02 100644 --- a/src/proto_009_PsFLoren/lib_client/managed_contract.ml +++ b/src/proto_009_PsFLoren/lib_client/managed_contract.ml @@ -81,8 +81,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let build_lambda_for_set_delegate ~delegate = match delegate with diff --git a/src/proto_009_PsFLoren/lib_client_commands/dune b/src/proto_009_PsFLoren/lib_client_commands/dune index af16bd18a3018bf2df80968dc97d5d38b58c25f1..45748313cd4a2e6195c747b78a97178a3dc25c64 100644 --- a/src/proto_009_PsFLoren/lib_client_commands/dune +++ b/src/proto_009_PsFLoren/lib_client_commands/dune @@ -18,6 +18,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_009_PsFLoren -open Tezos_stdlib_unix -open Tezos_shell_services @@ -46,6 +47,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_009_PsFLoren -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_009_PsFLoren/lib_client_sapling/dune b/src/proto_009_PsFLoren/lib_client_sapling/dune index 9407107d71eead83dc90daccb78c72d44b5a1490..9d247eb0022d8c2074a3a7522873ca71ca7879b8 100644 --- a/src/proto_009_PsFLoren/lib_client_sapling/dune +++ b/src/proto_009_PsFLoren/lib_client_sapling/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_009_PsFLoren diff --git a/src/proto_009_PsFLoren/lib_plugin/dune b/src/proto_009_PsFLoren/lib_plugin/dune index 5426ca3c4d4dc13d2f31ea2cfe76da11d02dd9af..b321fc152d7afc07a09cf02b90778f41cec14c1b 100644 --- a/src/proto_009_PsFLoren/lib_plugin/dune +++ b/src/proto_009_PsFLoren/lib_plugin/dune @@ -6,6 +6,7 @@ tezos-protocol-009-PsFLoren) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_009_PsFLoren))) (library @@ -18,6 +19,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_009_PsFLoren -open Tezos_protocol_plugin_009_PsFLoren -open Tezos_shell))) diff --git a/src/proto_010_PtGRANAD/lib_client/client_proto_multisig.ml b/src/proto_010_PtGRANAD/lib_client/client_proto_multisig.ml index 14c0667b99b97cfa4217999f86dd1ed188a2b668..616cc64d4d94594090940b05802ca771f6562c5c 100644 --- a/src/proto_010_PtGRANAD/lib_client/client_proto_multisig.ml +++ b/src/proto_010_PtGRANAD/lib_client/client_proto_multisig.ml @@ -627,8 +627,7 @@ let action_to_expr_generic ~loc = function ~parameter ~amount >|? left ~loc) - | Lambda code -> - Error_monad.ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) | Change_delegate delegate -> lambda_from_string @@ Managed_contract.build_lambda_for_set_delegate ~delegate @@ -636,37 +635,36 @@ let action_to_expr_generic ~loc = function | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok expr + ok expr let action_to_expr_legacy ~loc = function | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:0) - then Error_monad.error @@ Unsupported_feature_generic_call parameter + then error @@ Unsupported_feature_generic_call parameter else if parameter_type <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:0) - then - Error_monad.error @@ Unsupported_feature_generic_call_ty parameter_type + then error @@ Unsupported_feature_generic_call_ty parameter_type else - Error_monad.ok + ok @@ left ~loc (pair ~loc (mutez ~loc amount) (optimized_address ~loc ~address:destination ~entrypoint)) - | Lambda _ -> Error_monad.error @@ Unsupported_feature_lambda "" + | Lambda _ -> error @@ Unsupported_feature_lambda "" | Change_delegate delegate -> let delegate_opt = match delegate with | None -> none ~loc () | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) in - Error_monad.ok @@ right ~loc (left ~loc delegate_opt) + ok @@ right ~loc (left ~loc delegate_opt) | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok (right ~loc expr) + ok (right ~loc expr) let action_to_expr ~loc ~generic action = if generic then action_to_expr_generic ~loc action diff --git a/src/proto_010_PtGRANAD/lib_client/dune b/src/proto_010_PtGRANAD/lib_client/dune index a100227b4cdf82ae5ea611918c39a5f0d004d019..f00e76b5ce1716c7d8ebd7c23868b2eff1262b6d 100644 --- a/src/proto_010_PtGRANAD/lib_client/dune +++ b/src/proto_010_PtGRANAD/lib_client/dune @@ -19,6 +19,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_010_PtGRANAD diff --git a/src/proto_010_PtGRANAD/lib_client/managed_contract.ml b/src/proto_010_PtGRANAD/lib_client/managed_contract.ml index 29bb3d976b631f4606eec0a36d85cfae94b22306..910f27a6d9b3241fea19cdee20da6428293371bd 100644 --- a/src/proto_010_PtGRANAD/lib_client/managed_contract.ml +++ b/src/proto_010_PtGRANAD/lib_client/managed_contract.ml @@ -82,8 +82,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let build_lambda_for_set_delegate ~delegate = match delegate with diff --git a/src/proto_010_PtGRANAD/lib_client_commands/dune b/src/proto_010_PtGRANAD/lib_client_commands/dune index 3554c19940809fa15470c48abd38cd707b571b9b..46a7947bcf588709beb91647550f066e147c9731 100644 --- a/src/proto_010_PtGRANAD/lib_client_commands/dune +++ b/src/proto_010_PtGRANAD/lib_client_commands/dune @@ -18,6 +18,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_010_PtGRANAD -open Tezos_stdlib_unix -open Tezos_shell_services @@ -46,6 +47,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_010_PtGRANAD -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_010_PtGRANAD/lib_client_sapling/dune b/src/proto_010_PtGRANAD/lib_client_sapling/dune index e0df6cc156256ac498ba83538f6afc3833f4ee0f..1bd12aed8824634627159a3adcb40974de6bf86a 100644 --- a/src/proto_010_PtGRANAD/lib_client_sapling/dune +++ b/src/proto_010_PtGRANAD/lib_client_sapling/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_010_PtGRANAD diff --git a/src/proto_010_PtGRANAD/lib_plugin/dune b/src/proto_010_PtGRANAD/lib_plugin/dune index a5d1cace2e2f6dcdf4f8957ef942e29e637f6f96..471d75dbd4a9ce10d4cb1c5105a0fb54c502188f 100644 --- a/src/proto_010_PtGRANAD/lib_plugin/dune +++ b/src/proto_010_PtGRANAD/lib_plugin/dune @@ -6,6 +6,7 @@ tezos-protocol-010-PtGRANAD) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_010_PtGRANAD))) (library @@ -18,6 +19,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_010_PtGRANAD -open Tezos_protocol_plugin_010_PtGRANAD -open Tezos_shell))) diff --git a/src/proto_011_PtHangz2/bin_accuser/dune b/src/proto_011_PtHangz2/bin_accuser/dune index 77b09a7257e1772abf39a6b611fa719ebeabf43d..51dfbe77f3c95e652c2ea005b4adb152616a4a5f 100644 --- a/src/proto_011_PtHangz2/bin_accuser/dune +++ b/src/proto_011_PtHangz2/bin_accuser/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_client_011_PtHangz2 -open Tezos_client_commands diff --git a/src/proto_011_PtHangz2/bin_baker/dune b/src/proto_011_PtHangz2/bin_baker/dune index 4a8a5460e91c3d7ba6ac04b79e526fa301597d8b..fb99d9ad40e06b1ed2a844a40f5a29e5dc3f6127 100644 --- a/src/proto_011_PtHangz2/bin_baker/dune +++ b/src/proto_011_PtHangz2/bin_baker/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_client_011_PtHangz2 -open Tezos_client_commands diff --git a/src/proto_011_PtHangz2/bin_endorser/dune b/src/proto_011_PtHangz2/bin_endorser/dune index d4b3e36c3136c8fde8f4f135c365b08739e943a6..ac55cf831d114c35c7fa3ccaedfeb8bbdb028682 100644 --- a/src/proto_011_PtHangz2/bin_endorser/dune +++ b/src/proto_011_PtHangz2/bin_endorser/dune @@ -12,6 +12,7 @@ tezos-client-commands tezos-baking-011-PtHangz2-commands) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_client_011_PtHangz2 -open Tezos_client_commands diff --git a/src/proto_011_PtHangz2/lib_benchmark/dune b/src/proto_011_PtHangz2/lib_benchmark/dune index e7026efb815e40fa1aaf6e88ef3ade877d72c7e7..6088df6d73b69d17ac4b890f5324f75f269df8ca 100644 --- a/src/proto_011_PtHangz2/lib_benchmark/dune +++ b/src/proto_011_PtHangz2/lib_benchmark/dune @@ -18,6 +18,7 @@ (flags (:standard -open Tezos_stdlib -open Tezos_base -open Tezos_error_monad + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_benchmark diff --git a/src/proto_011_PtHangz2/lib_benchmark/execution_context.ml b/src/proto_011_PtHangz2/lib_benchmark/execution_context.ml index 6e5251a9c539f45544a6cf9007af738f8790a875..3ee66a81f98bee353da5b15cceb44b37844e1dd7 100644 --- a/src/proto_011_PtHangz2/lib_benchmark/execution_context.ml +++ b/src/proto_011_PtHangz2/lib_benchmark/execution_context.ml @@ -24,7 +24,6 @@ (*****************************************************************************) open Protocol -open Error_monad type context = Alpha_context.context * Script_interpreter.step_constants diff --git a/src/proto_011_PtHangz2/lib_benchmark/test/dune b/src/proto_011_PtHangz2/lib_benchmark/test/dune index 67952bc6b0ef73643bccb3f12bb8a7a41bcf20a1..ea992dd0616bffe097ae0b2608f67eee786cca14 100644 --- a/src/proto_011_PtHangz2/lib_benchmark/test/dune +++ b/src/proto_011_PtHangz2/lib_benchmark/test/dune @@ -13,6 +13,7 @@ ;; uncomment to enable gprof profiling ;; (ocamlopt_flags (:standard -p -ccopt -no-pie)) (flags (:standard + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_benchmark -open Tezos_protocol_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_benchmark/test/test_helpers.ml b/src/proto_011_PtHangz2/lib_benchmark/test/test_helpers.ml index 73e6ed7527d2fd2bea2e9d1b96802b187369e849..e79f70c264acfde9a77e6d2f8dad400cf4087937 100644 --- a/src/proto_011_PtHangz2/lib_benchmark/test/test_helpers.ml +++ b/src/proto_011_PtHangz2/lib_benchmark/test/test_helpers.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_error_monad.Error_monad - let rng_state = Random.State.make [|42; 987897; 54120|] let print_script_expr fmtr (expr : Protocol.Script_repr.expr) = diff --git a/src/proto_011_PtHangz2/lib_benchmarks_proto/dune b/src/proto_011_PtHangz2/lib_benchmarks_proto/dune index 777dd4c9ae5501e31b1ab20df946f5fb73d13ebb..4ff06e7396aba2637a2be8f8fe86f6365b61a3cf 100644 --- a/src/proto_011_PtHangz2/lib_benchmarks_proto/dune +++ b/src/proto_011_PtHangz2/lib_benchmarks_proto/dune @@ -27,6 +27,7 @@ -open Tezos_stdlib -open Tezos_base -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad -open Tezos_benchmark -open Tezos_benchmark_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_011_PtHangz2/lib_benchmarks_proto/translator_benchmarks.ml index ce6eda4504d6c78f1568487734a9cea3c388a6c3..86a739220a00d8e50719db99f4be3b47f6728e74 100644 --- a/src/proto_011_PtHangz2/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_011_PtHangz2/lib_benchmarks_proto/translator_benchmarks.ml @@ -570,7 +570,6 @@ module Merge_types : Benchmark.S = struct [("size_translator_model", size_model); ("codegen", codegen_model)] let merge_type_benchmark rng_state nodes (ty : Script_ir_translator.ex_ty) = - let open Error_monad in Lwt_main.run ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -681,7 +680,6 @@ module Parse_type_benchmark : Benchmark.S = struct let info = "Benchmarking parse_ty" let make_bench rng_state config () = - let open Error_monad in ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in let depth = Random.State.int rng_state config.max_size in @@ -729,7 +727,6 @@ module Unparse_type_benchmark : Benchmark.S = struct let info = "Benchmarking unparse_ty" let make_bench rng_state config () = - let open Error_monad in ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in let depth = Random.State.int rng_state config.max_size in diff --git a/src/proto_011_PtHangz2/lib_client/client_proto_multisig.ml b/src/proto_011_PtHangz2/lib_client/client_proto_multisig.ml index 14c0667b99b97cfa4217999f86dd1ed188a2b668..616cc64d4d94594090940b05802ca771f6562c5c 100644 --- a/src/proto_011_PtHangz2/lib_client/client_proto_multisig.ml +++ b/src/proto_011_PtHangz2/lib_client/client_proto_multisig.ml @@ -627,8 +627,7 @@ let action_to_expr_generic ~loc = function ~parameter ~amount >|? left ~loc) - | Lambda code -> - Error_monad.ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) | Change_delegate delegate -> lambda_from_string @@ Managed_contract.build_lambda_for_set_delegate ~delegate @@ -636,37 +635,36 @@ let action_to_expr_generic ~loc = function | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok expr + ok expr let action_to_expr_legacy ~loc = function | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:0) - then Error_monad.error @@ Unsupported_feature_generic_call parameter + then error @@ Unsupported_feature_generic_call parameter else if parameter_type <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:0) - then - Error_monad.error @@ Unsupported_feature_generic_call_ty parameter_type + then error @@ Unsupported_feature_generic_call_ty parameter_type else - Error_monad.ok + ok @@ left ~loc (pair ~loc (mutez ~loc amount) (optimized_address ~loc ~address:destination ~entrypoint)) - | Lambda _ -> Error_monad.error @@ Unsupported_feature_lambda "" + | Lambda _ -> error @@ Unsupported_feature_lambda "" | Change_delegate delegate -> let delegate_opt = match delegate with | None -> none ~loc () | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) in - Error_monad.ok @@ right ~loc (left ~loc delegate_opt) + ok @@ right ~loc (left ~loc delegate_opt) | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok (right ~loc expr) + ok (right ~loc expr) let action_to_expr ~loc ~generic action = if generic then action_to_expr_generic ~loc action diff --git a/src/proto_011_PtHangz2/lib_client/dune b/src/proto_011_PtHangz2/lib_client/dune index 072c22b3c8ae812c1fb796f59f73ac800d8b0d77..0fffb3c62947ea0fd77ec8f0194ca7a4ec07ae78 100644 --- a/src/proto_011_PtHangz2/lib_client/dune +++ b/src/proto_011_PtHangz2/lib_client/dune @@ -19,6 +19,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_client/managed_contract.ml b/src/proto_011_PtHangz2/lib_client/managed_contract.ml index cbc1db16a4eb3d32149df8ada2a5fc44853adaff..7e15c7482cc69038446c4f61ca742986448d0bf9 100644 --- a/src/proto_011_PtHangz2/lib_client/managed_contract.ml +++ b/src/proto_011_PtHangz2/lib_client/managed_contract.ml @@ -82,8 +82,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let build_lambda_for_set_delegate ~delegate = match delegate with diff --git a/src/proto_011_PtHangz2/lib_client/test/dune b/src/proto_011_PtHangz2/lib_client/test/dune index 2ef5bb81b661698808b9c9defac4f3a71cb686f9..fc9d27f001d5541e12ea4fbb26cf08d1851bac3a 100644 --- a/src/proto_011_PtHangz2/lib_client/test/dune +++ b/src/proto_011_PtHangz2/lib_client/test/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_011_PtHangz2 -open Tezos_protocol_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_client_commands/dune b/src/proto_011_PtHangz2/lib_client_commands/dune index f90709e1ab567ac5a13595fdae7c122295db71fa..cd666561abebce1fa1038ac56bb986643979ad5c 100644 --- a/src/proto_011_PtHangz2/lib_client_commands/dune +++ b/src/proto_011_PtHangz2/lib_client_commands/dune @@ -18,6 +18,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_stdlib_unix -open Tezos_shell_services @@ -46,6 +47,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_011_PtHangz2/lib_client_sapling/dune b/src/proto_011_PtHangz2/lib_client_sapling/dune index f73df7db1a9aaac84fe72834f409b4ca77876e00..b5a070938ea73ddf8758464faf43609c28710e6a 100644 --- a/src/proto_011_PtHangz2/lib_client_sapling/dune +++ b/src/proto_011_PtHangz2/lib_client_sapling/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_delegate/client_baking_forge.ml b/src/proto_011_PtHangz2/lib_delegate/client_baking_forge.ml index 2b76caed5a529c148026ac56ce0118a9057b97d1..7f85084c95717885cc23758054148ca4c7471453 100644 --- a/src/proto_011_PtHangz2/lib_delegate/client_baking_forge.ml +++ b/src/proto_011_PtHangz2/lib_delegate/client_baking_forge.ml @@ -1573,7 +1573,7 @@ let () = Block_vote_file_missing_liquidity_baking_escape_vote file_path) let traced_option_to_result ~error = - Option.fold ~some:ok ~none:(Error_monad.error error) + Option.fold ~some:ok ~none:(Tzresult_syntax.fail error) let check_file_exists file = if Sys.file_exists file then Result.return_unit diff --git a/src/proto_011_PtHangz2/lib_delegate/dune b/src/proto_011_PtHangz2/lib_delegate/dune index 2dff6671aebf93f461ba739c408b19da38403f58..0674a39ecaa63362d17074a474481cf36f26d2d6 100644 --- a/src/proto_011_PtHangz2/lib_delegate/dune +++ b/src/proto_011_PtHangz2/lib_delegate/dune @@ -25,6 +25,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_protocol_plugin_011_PtHangz2 -open Tezos_shell_services @@ -58,6 +59,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_stdlib_unix -open Tezos_shell_services diff --git a/src/proto_011_PtHangz2/lib_delegate/test/dune b/src/proto_011_PtHangz2/lib_delegate/test/dune index 4a50334b6f1bd1683dc8accbdb32dfb42728e86c..c8a14f6e5a5b71cd3b4db6248878ed46166c9ab2 100644 --- a/src/proto_011_PtHangz2/lib_delegate/test/dune +++ b/src/proto_011_PtHangz2/lib_delegate/test/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_011_PtHangz2 -open Tezos_protocol_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_plugin/dune b/src/proto_011_PtHangz2/lib_plugin/dune index 75d64efd37c8ca531ee8cf18e8e10f9e66d34420..6811c756149502119afb406780a3283ef48c8c16 100644 --- a/src/proto_011_PtHangz2/lib_plugin/dune +++ b/src/proto_011_PtHangz2/lib_plugin/dune @@ -6,6 +6,7 @@ tezos-protocol-011-PtHangz2) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2))) (library @@ -18,6 +19,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_011_PtHangz2 -open Tezos_protocol_plugin_011_PtHangz2 -open Tezos_shell))) diff --git a/src/proto_011_PtHangz2/lib_protocol/test/helpers/dune b/src/proto_011_PtHangz2/lib_protocol/test/helpers/dune index 602ab8b817a1f8b4255a92916410ff5894d52fdd..6a2abca77bd204b6d6a319a1cd12700bac6cccba 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/helpers/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/helpers/dune @@ -15,6 +15,7 @@ tezos-client-011-PtHangz2 tezos-protocol-plugin-011-PtHangz2) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_stdlib_unix -open Tezos_protocol_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_protocol/test/integration/consensus/dune b/src/proto_011_PtHangz2/lib_protocol/test/integration/consensus/dune index 08da9009290666a291bebb06e36287345854baf6..60b93bade50cd92ee090c2f4c7f5c1da2e9066ac 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/integration/consensus/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/integration/consensus/dune @@ -9,6 +9,7 @@ tezos-protocol-011-PtHangz2-parameters tezos-protocol-plugin-011-PtHangz2) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_011_PtHangz2_test_helpers -open Tezos_base_test_helpers diff --git a/src/proto_011_PtHangz2/lib_protocol/test/integration/dune b/src/proto_011_PtHangz2/lib_protocol/test/integration/dune index 82b4f8eb61ac5072a7b53356557f3b3043aafa34..584ad39f6b7635bc314613e54eb2d70583ab8177 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/integration/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/integration/dune @@ -9,6 +9,7 @@ tezos-base-test-helpers tezos-011-PtHangz2-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_011_PtHangz2 -open Tezos_protocol_011_PtHangz2 -open Tezos_protocol_011_PtHangz2_parameters diff --git a/src/proto_011_PtHangz2/lib_protocol/test/integration/gas/dune b/src/proto_011_PtHangz2/lib_protocol/test/integration/gas/dune index c7fe2cc25261acf4cca96a4095348783a552dc4e..f3d108058a063211a8dae9ff5e0e2c9b478952f6 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/integration/gas/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/integration/gas/dune @@ -7,6 +7,7 @@ tezos-base-test-helpers tezos-011-PtHangz2-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_011_PtHangz2_test_helpers -open Tezos_base_test_helpers))) diff --git a/src/proto_011_PtHangz2/lib_protocol/test/integration/michelson/dune b/src/proto_011_PtHangz2/lib_protocol/test/integration/michelson/dune index e60427aeef6e8d209eadc41ed2b2b9ea10885242..30270c16511c65e43042cc684b6bb9cdc55f1375 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/integration/michelson/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/integration/michelson/dune @@ -13,6 +13,7 @@ tezos-benchmark tezos-benchmark-011-PtHangz2) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_011_PtHangz2_test_helpers -open Tezos_base_test_helpers diff --git a/src/proto_011_PtHangz2/lib_protocol/test/integration/operations/dune b/src/proto_011_PtHangz2/lib_protocol/test/integration/operations/dune index c7fe2cc25261acf4cca96a4095348783a552dc4e..f3d108058a063211a8dae9ff5e0e2c9b478952f6 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/integration/operations/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/integration/operations/dune @@ -7,6 +7,7 @@ tezos-base-test-helpers tezos-011-PtHangz2-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_011_PtHangz2 -open Tezos_011_PtHangz2_test_helpers -open Tezos_base_test_helpers))) diff --git a/src/proto_011_PtHangz2/lib_protocol/test/pbt/dune b/src/proto_011_PtHangz2/lib_protocol/test/pbt/dune index f10382a2220963e028b619e2a632c263ea4339fc..4232404bc8ee9553189ff7dde92613c7129bf130 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/pbt/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/pbt/dune @@ -16,6 +16,7 @@ tezos-benchmark-011-PtHangz2) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_011_PtHangz2 -open Tezos_protocol_011_PtHangz2 diff --git a/src/proto_011_PtHangz2/lib_protocol/test/unit/dune b/src/proto_011_PtHangz2/lib_protocol/test/unit/dune index c5d03655fe6baf3f31d8d831e19e1554bbc5f9b0..2281209099a2b91e26e2e7bf33353137957ea18f 100644 --- a/src/proto_011_PtHangz2/lib_protocol/test/unit/dune +++ b/src/proto_011_PtHangz2/lib_protocol/test/unit/dune @@ -11,6 +11,7 @@ tezos-protocol-011-PtHangz2-parameters tezos-base-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_client_011_PtHangz2 diff --git a/src/proto_012_Psithaca/bin_accuser/dune b/src/proto_012_Psithaca/bin_accuser/dune index 9e5c37f1d0a360eb315996e4ad648c23d2c16eb6..abea20bdf4b628357a3c9c17ee889d5a7de2796d 100644 --- a/src/proto_012_Psithaca/bin_accuser/dune +++ b/src/proto_012_Psithaca/bin_accuser/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_client_012_Psithaca -open Tezos_client_commands diff --git a/src/proto_012_Psithaca/bin_baker/dune b/src/proto_012_Psithaca/bin_baker/dune index b090de8714c1ede8e7658e305c369849d8ef49ed..d5d4af2fe2f4820d7e9d83bdd6e02a68a32a83ad 100644 --- a/src/proto_012_Psithaca/bin_baker/dune +++ b/src/proto_012_Psithaca/bin_baker/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_client_012_Psithaca -open Tezos_client_commands diff --git a/src/proto_012_Psithaca/lib_benchmark/dune b/src/proto_012_Psithaca/lib_benchmark/dune index b667f8872dfc46347a4d5ed30868513c787e3d3a..7d6e281b4016b32f9a324c067ff904623b3fc74d 100644 --- a/src/proto_012_Psithaca/lib_benchmark/dune +++ b/src/proto_012_Psithaca/lib_benchmark/dune @@ -18,6 +18,7 @@ (flags (:standard -open Tezos_stdlib -open Tezos_base -open Tezos_error_monad + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_benchmark diff --git a/src/proto_012_Psithaca/lib_benchmark/execution_context.ml b/src/proto_012_Psithaca/lib_benchmark/execution_context.ml index 74a60d5bd405527645cec94030fd0c71c84fb5f6..0093223692ef78a2afcfaed0322dec90ff80ad7f 100644 --- a/src/proto_012_Psithaca/lib_benchmark/execution_context.ml +++ b/src/proto_012_Psithaca/lib_benchmark/execution_context.ml @@ -24,7 +24,6 @@ (*****************************************************************************) open Protocol -open Error_monad type context = Alpha_context.context * Script_interpreter.step_constants diff --git a/src/proto_012_Psithaca/lib_benchmark/test/dune b/src/proto_012_Psithaca/lib_benchmark/test/dune index 822d94abcddbf1d7575534123323b61a3c60693e..d44f4d5646a7c47e58d93dfa4a70c83059abcf2e 100644 --- a/src/proto_012_Psithaca/lib_benchmark/test/dune +++ b/src/proto_012_Psithaca/lib_benchmark/test/dune @@ -13,6 +13,7 @@ ;; uncomment to enable gprof profiling ;; (ocamlopt_flags (:standard -p -ccopt -no-pie)) (flags (:standard + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_protocol_012_Psithaca -open Tezos_benchmark diff --git a/src/proto_012_Psithaca/lib_benchmark/test/test_helpers.ml b/src/proto_012_Psithaca/lib_benchmark/test/test_helpers.ml index a27aed6768b653f05dbd5a30adbe588ed3fa007c..8c6c9fdd6d667984fe4f668b2895b2bc14abf502 100644 --- a/src/proto_012_Psithaca/lib_benchmark/test/test_helpers.ml +++ b/src/proto_012_Psithaca/lib_benchmark/test/test_helpers.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_error_monad.Error_monad - let rng_state = Random.State.make [|42; 987897; 54120|] let print_script_expr fmtr (expr : Protocol.Script_repr.expr) = diff --git a/src/proto_012_Psithaca/lib_benchmarks_proto/dune b/src/proto_012_Psithaca/lib_benchmarks_proto/dune index bc2ce887cab048054c9fb4fad6b9825e5e3c6d89..d750fec473eff99186aa97ee30aa26be34d74d29 100644 --- a/src/proto_012_Psithaca/lib_benchmarks_proto/dune +++ b/src/proto_012_Psithaca/lib_benchmarks_proto/dune @@ -27,6 +27,7 @@ -open Tezos_stdlib -open Tezos_base -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad -open Tezos_benchmark -open Tezos_benchmark_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_012_Psithaca/lib_benchmarks_proto/translator_benchmarks.ml index e4a3da4cc86a48605035dbd623a7d479d0bf0fca..9c088f35233ea75011deab69dfbfc1b69d657e8f 100644 --- a/src/proto_012_Psithaca/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_012_Psithaca/lib_benchmarks_proto/translator_benchmarks.ml @@ -569,7 +569,6 @@ module Merge_types : Benchmark.S = struct [("size_translator_model", size_model); ("codegen", codegen_model)] let merge_type_benchmark rng_state nodes (ty : Script_ir_translator.ex_ty) = - let open Error_monad in Lwt_main.run ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -692,7 +691,6 @@ module Parse_type_benchmark : Benchmark.S = struct let info = "Benchmarking parse_ty" let make_bench rng_state config () = - let open Error_monad in ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in let size = Random.State.int rng_state config.max_size in @@ -744,7 +742,6 @@ module Unparse_type_benchmark : Benchmark.S = struct let info = "Benchmarking unparse_ty" let make_bench rng_state config () = - let open Error_monad in ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in let size = Random.State.int rng_state config.max_size in @@ -798,7 +795,6 @@ module Unparse_comparable_type_benchmark : Benchmark.S = struct let info = "Benchmarking unparse_comparable_ty" let make_bench rng_state config () = - let open Error_monad in let res = Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in diff --git a/src/proto_012_Psithaca/lib_client/client_proto_multisig.ml b/src/proto_012_Psithaca/lib_client/client_proto_multisig.ml index 4f55086fb15212cc52fffdb5b8d446149a3c57f9..09f1bbb5a15f3b314c45fe28c3b66421da2e9ebc 100644 --- a/src/proto_012_Psithaca/lib_client/client_proto_multisig.ml +++ b/src/proto_012_Psithaca/lib_client/client_proto_multisig.ml @@ -627,8 +627,7 @@ let action_to_expr_generic ~loc = function ~parameter ~amount >|? left ~loc) - | Lambda code -> - Error_monad.ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) | Change_delegate delegate -> lambda_from_string @@ Managed_contract.build_lambda_for_set_delegate ~delegate @@ -636,37 +635,36 @@ let action_to_expr_generic ~loc = function | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok expr + ok expr let action_to_expr_legacy ~loc = function | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:()) - then Error_monad.error @@ Unsupported_feature_generic_call parameter + then error @@ Unsupported_feature_generic_call parameter else if parameter_type <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:()) - then - Error_monad.error @@ Unsupported_feature_generic_call_ty parameter_type + then error @@ Unsupported_feature_generic_call_ty parameter_type else - Error_monad.ok + ok @@ left ~loc (pair ~loc (mutez ~loc amount) (optimized_address ~loc ~address:destination ~entrypoint)) - | Lambda _ -> Error_monad.error @@ Unsupported_feature_lambda "" + | Lambda _ -> error @@ Unsupported_feature_lambda "" | Change_delegate delegate -> let delegate_opt = match delegate with | None -> none ~loc () | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) in - Error_monad.ok @@ right ~loc (left ~loc delegate_opt) + ok @@ right ~loc (left ~loc delegate_opt) | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok (right ~loc expr) + ok (right ~loc expr) let action_to_expr ~loc ~generic action = if generic then action_to_expr_generic ~loc action diff --git a/src/proto_012_Psithaca/lib_client/dune b/src/proto_012_Psithaca/lib_client/dune index cdad36fe2c103fd999221d11eedc731f25e0e338..e31120b4e607c0122e637fa673cf337955bc381a 100644 --- a/src/proto_012_Psithaca/lib_client/dune +++ b/src/proto_012_Psithaca/lib_client/dune @@ -19,6 +19,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_client/managed_contract.ml b/src/proto_012_Psithaca/lib_client/managed_contract.ml index cbc1db16a4eb3d32149df8ada2a5fc44853adaff..7e15c7482cc69038446c4f61ca742986448d0bf9 100644 --- a/src/proto_012_Psithaca/lib_client/managed_contract.ml +++ b/src/proto_012_Psithaca/lib_client/managed_contract.ml @@ -82,8 +82,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let build_lambda_for_set_delegate ~delegate = match delegate with diff --git a/src/proto_012_Psithaca/lib_client/test/dune b/src/proto_012_Psithaca/lib_client/test/dune index ff8b4216701432ccf7807d462332844c2ecc1421..6fb6118a0d6b8623c0a402465fef97010f2b14fd 100644 --- a/src/proto_012_Psithaca/lib_client/test/dune +++ b/src/proto_012_Psithaca/lib_client/test/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_012_Psithaca -open Tezos_protocol_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_client_commands/dune b/src/proto_012_Psithaca/lib_client_commands/dune index 3e77fdb21967d1d215209edeff9373a328c8e3f9..991ff1d7d4dd4ffb09b474ef6ec54448727fe7e8 100644 --- a/src/proto_012_Psithaca/lib_client_commands/dune +++ b/src/proto_012_Psithaca/lib_client_commands/dune @@ -18,6 +18,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_stdlib_unix -open Tezos_shell_services @@ -46,6 +47,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_012_Psithaca/lib_client_sapling/dune b/src/proto_012_Psithaca/lib_client_sapling/dune index 63c9daec23031f00d32d0778a70e05a468f69236..c59b9c22f56bc0021e564ef5548e640196651fd1 100644 --- a/src/proto_012_Psithaca/lib_client_sapling/dune +++ b/src/proto_012_Psithaca/lib_client_sapling/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_delegate/dune b/src/proto_012_Psithaca/lib_delegate/dune index 74c0445e7db07f64e6b9b8501d6cb9c302779fd0..3a7a68fa6161c4628c4450abaf700f77c2b23dfe 100644 --- a/src/proto_012_Psithaca/lib_delegate/dune +++ b/src/proto_012_Psithaca/lib_delegate/dune @@ -26,6 +26,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_protocol_plugin_012_Psithaca -open Tezos_shell_services @@ -59,6 +60,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_stdlib_unix -open Tezos_shell_services @@ -88,6 +90,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_shell_services -open Tezos_client_base diff --git a/src/proto_012_Psithaca/lib_delegate/liquidity_baking_vote_file.ml b/src/proto_012_Psithaca/lib_delegate/liquidity_baking_vote_file.ml index 57bc0ce5a1871e7115f0b0baf2d36524850ec8f9..e0b051037b00613bc4324a59873e8bcfa74cfcfb 100644 --- a/src/proto_012_Psithaca/lib_delegate/liquidity_baking_vote_file.ml +++ b/src/proto_012_Psithaca/lib_delegate/liquidity_baking_vote_file.ml @@ -126,7 +126,7 @@ let () = Block_vote_file_missing_liquidity_baking_escape_vote file_path) let traced_option_to_result ~error = - Option.fold ~some:ok ~none:(Error_monad.error error) + Option.fold ~some:ok ~none:(Tzresult_syntax.fail error) let check_file_exists file = if Sys.file_exists file then Result.return_unit diff --git a/src/proto_012_Psithaca/lib_delegate/test/dune b/src/proto_012_Psithaca/lib_delegate/test/dune index d9acc6a9f69a45517286b8615fe63b59f3c80e00..877793caa21db1cab81dbf77a740c4b25676951b 100644 --- a/src/proto_012_Psithaca/lib_delegate/test/dune +++ b/src/proto_012_Psithaca/lib_delegate/test/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_012_Psithaca -open Tezos_protocol_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_delegate/test/mockup_simulator/dune b/src/proto_012_Psithaca/lib_delegate/test/mockup_simulator/dune index b3135c62603b17f08e0bbd7a95c1d18a394fba04..256c14e25cb59b3c5dcc3b11bb7153577d3564da 100644 --- a/src/proto_012_Psithaca/lib_delegate/test/mockup_simulator/dune +++ b/src/proto_012_Psithaca/lib_delegate/test/mockup_simulator/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_client_012_Psithaca -open Tezos_client_commands diff --git a/src/proto_012_Psithaca/lib_plugin/dune b/src/proto_012_Psithaca/lib_plugin/dune index b54e9d40191790823258fb57f2071b7cb6e10fcd..e3f1218fdca2deba5a34f71854e8439b403bfc3b 100644 --- a/src/proto_012_Psithaca/lib_plugin/dune +++ b/src/proto_012_Psithaca/lib_plugin/dune @@ -8,6 +8,7 @@ ) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_stdlib_unix ))) @@ -22,6 +23,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_012_Psithaca -open Tezos_protocol_plugin_012_Psithaca -open Tezos_shell))) diff --git a/src/proto_012_Psithaca/lib_plugin/test/dune b/src/proto_012_Psithaca/lib_plugin/test/dune index 745b734544f876e95bd9a835d16b79c2bbc54d1b..a3f7689f9ac3f855ee5fd20f7e054c5986a674cf 100644 --- a/src/proto_012_Psithaca/lib_plugin/test/dune +++ b/src/proto_012_Psithaca/lib_plugin/test/dune @@ -11,6 +11,7 @@ tezos-protocol-plugin-012-Psithaca tezos-012-Psithaca-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_protocol_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_protocol/test/helpers/dune b/src/proto_012_Psithaca/lib_protocol/test/helpers/dune index ce08a5f18a55e16d1db7073d669a4f461cbd8081..8b54ed5997b1064b3a9ca2d622916c4796cfc93f 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/helpers/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/helpers/dune @@ -15,6 +15,7 @@ tezos-client-012-Psithaca tezos-protocol-plugin-012-Psithaca) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_stdlib_unix -open Tezos_protocol_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_protocol/test/integration/consensus/dune b/src/proto_012_Psithaca/lib_protocol/test/integration/consensus/dune index 538b75ee9e9a56245beec54d4274fe87fd582264..edaec8f7fb1286af2a30f0aa950373160b45c7c5 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/integration/consensus/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/integration/consensus/dune @@ -9,6 +9,7 @@ tezos-protocol-012-Psithaca-parameters tezos-protocol-plugin-012-Psithaca) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_012_Psithaca_test_helpers -open Tezos_base_test_helpers diff --git a/src/proto_012_Psithaca/lib_protocol/test/integration/dune b/src/proto_012_Psithaca/lib_protocol/test/integration/dune index a3b5fb0e2e412ebbccca3ad7768bc6122abeada5..bb29d21f40307fad50c5cec021739fee9e14d290 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/integration/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/integration/dune @@ -9,6 +9,7 @@ tezos-base-test-helpers tezos-012-Psithaca-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_012_Psithaca -open Tezos_protocol_012_Psithaca -open Tezos_protocol_012_Psithaca_parameters diff --git a/src/proto_012_Psithaca/lib_protocol/test/integration/gas/dune b/src/proto_012_Psithaca/lib_protocol/test/integration/gas/dune index 1dbdf2a308c1dbb255e33b46100b89ed49e35c3a..fa0cc2be74d5e731b82951bfaf3a518855ef16b8 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/integration/gas/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/integration/gas/dune @@ -7,6 +7,7 @@ tezos-base-test-helpers tezos-012-Psithaca-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_012_Psithaca_test_helpers -open Tezos_base_test_helpers))) diff --git a/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/dune b/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/dune index 5c56b5e04e80eb9599f6a6ad1a3e74feba3f4bd4..bbc0933ad78ac474a37ca92020713bd26f9d57e3 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/dune @@ -13,6 +13,7 @@ tezos-benchmark tezos-benchmark-012-Psithaca) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_012_Psithaca_test_helpers -open Tezos_base_test_helpers diff --git a/src/proto_012_Psithaca/lib_protocol/test/integration/operations/dune b/src/proto_012_Psithaca/lib_protocol/test/integration/operations/dune index 1dbdf2a308c1dbb255e33b46100b89ed49e35c3a..fa0cc2be74d5e731b82951bfaf3a518855ef16b8 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/integration/operations/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/integration/operations/dune @@ -7,6 +7,7 @@ tezos-base-test-helpers tezos-012-Psithaca-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_012_Psithaca -open Tezos_012_Psithaca_test_helpers -open Tezos_base_test_helpers))) diff --git a/src/proto_012_Psithaca/lib_protocol/test/pbt/dune b/src/proto_012_Psithaca/lib_protocol/test/pbt/dune index 17bd6521b16d316df94389220aad1ed90063eaef..88e4306ce14c9331adf1509232847549b92d5c6b 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/pbt/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/pbt/dune @@ -17,6 +17,7 @@ tezos-benchmark-012-Psithaca) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_012_Psithaca -open Tezos_protocol_012_Psithaca diff --git a/src/proto_012_Psithaca/lib_protocol/test/unit/dune b/src/proto_012_Psithaca/lib_protocol/test/unit/dune index 096fe8c7229e9edf7a2efdf00be4fc2ceae89244..65337fde242cd4e2148c0100b9b086c21d2f9008 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/unit/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/unit/dune @@ -11,6 +11,7 @@ tezos-protocol-012-Psithaca-parameters tezos-base-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_client_012_Psithaca diff --git a/src/proto_alpha/bin_accuser/dune b/src/proto_alpha/bin_accuser/dune index cb3de5394e2a4acdd1d2b6f0d9ba9a0c3dfcbc5a..cba7f2c31e059ac62f9ada89e5c12f4c55d2e8c4 100644 --- a/src/proto_alpha/bin_accuser/dune +++ b/src/proto_alpha/bin_accuser/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_client_alpha -open Tezos_client_commands diff --git a/src/proto_alpha/bin_baker/dune b/src/proto_alpha/bin_baker/dune index b66dfcc02f0855124569091b01901bc5720de47c..09974dd4e13adc706467ae65c7046b144c103aca 100644 --- a/src/proto_alpha/bin_baker/dune +++ b/src/proto_alpha/bin_baker/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_client_alpha -open Tezos_client_commands diff --git a/src/proto_alpha/bin_sc_rollup_client/dune b/src/proto_alpha/bin_sc_rollup_client/dune index c069d06047f88fc050c11c20631e1333f9af30c8..f2a3126be82f826ef5836b50f813d97f8ba1c4dd 100644 --- a/src/proto_alpha/bin_sc_rollup_client/dune +++ b/src/proto_alpha/bin_sc_rollup_client/dune @@ -19,6 +19,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_alpha -open Tezos_client_commands -open Tezos_stdlib_unix diff --git a/src/proto_alpha/bin_sc_rollup_node/dune b/src/proto_alpha/bin_sc_rollup_node/dune index 7199d7bbdbca6176427b3a724156d9014feeebbc..cd483a6a2efb3c8344e79b5956503f377dd45d5d 100644 --- a/src/proto_alpha/bin_sc_rollup_node/dune +++ b/src/proto_alpha/bin_sc_rollup_node/dune @@ -31,6 +31,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_commands -open Tezos_stdlib_unix -open Tezos_client_base diff --git a/src/proto_alpha/bin_tx_rollup_node/dune b/src/proto_alpha/bin_tx_rollup_node/dune index cb5f701ff22f00b2c4bd989a3325c9772af46709..7b2e1631beabe0ee959c48ce0af63f57088bffef 100644 --- a/src/proto_alpha/bin_tx_rollup_node/dune +++ b/src/proto_alpha/bin_tx_rollup_node/dune @@ -28,6 +28,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base -open Tezos_crypto -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_benchmark/dune b/src/proto_alpha/lib_benchmark/dune index 68d4e869cb74e545dc6c5246e83bc85da34751ae..7ba6dead55625f8a44383f180ff70a24bd104ebe 100644 --- a/src/proto_alpha/lib_benchmark/dune +++ b/src/proto_alpha/lib_benchmark/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_stdlib -open Tezos_base -open Tezos_error_monad + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_benchmark diff --git a/src/proto_alpha/lib_benchmark/execution_context.ml b/src/proto_alpha/lib_benchmark/execution_context.ml index 236e1c3b212894d23a27c7f71e109a6e9864332d..404300f09730d7fa0847761bb8c226d12f04d5b8 100644 --- a/src/proto_alpha/lib_benchmark/execution_context.ml +++ b/src/proto_alpha/lib_benchmark/execution_context.ml @@ -24,7 +24,6 @@ (*****************************************************************************) open Protocol -open Error_monad type context = Alpha_context.context * Script_interpreter.step_constants diff --git a/src/proto_alpha/lib_benchmark/test/dune b/src/proto_alpha/lib_benchmark/test/dune index 0a2cdf72c315fcaebd6b09227c35cf6508c6351a..a0e0f8510679b84d2d8d2ff3cddc5921220dd738 100644 --- a/src/proto_alpha/lib_benchmark/test/dune +++ b/src/proto_alpha/lib_benchmark/test/dune @@ -13,6 +13,7 @@ ;; uncomment to enable gprof profiling ;; (ocamlopt_flags (:standard -p -ccopt -no-pie)) (flags (:standard + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_protocol_alpha -open Tezos_benchmark diff --git a/src/proto_alpha/lib_benchmark/test/test_helpers.ml b/src/proto_alpha/lib_benchmark/test/test_helpers.ml index 0cfe43e5f1d8ca511543bd1c0f2d0346c1317d18..189147add7336d0a7561cec601437660a4cbeeaa 100644 --- a/src/proto_alpha/lib_benchmark/test/test_helpers.ml +++ b/src/proto_alpha/lib_benchmark/test/test_helpers.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_error_monad.Error_monad - let rng_state = Random.State.make [|42; 987897; 54120|] let print_script_expr fmtr (expr : Protocol.Script_repr.expr) = diff --git a/src/proto_alpha/lib_benchmarks_proto/dune b/src/proto_alpha/lib_benchmarks_proto/dune index 3a97d84b9c8c0b2e66fefb8f61df58035ac0127f..905e71a06522db92e1209b052cccd735272be72a 100644 --- a/src/proto_alpha/lib_benchmarks_proto/dune +++ b/src/proto_alpha/lib_benchmarks_proto/dune @@ -27,6 +27,7 @@ -open Tezos_stdlib -open Tezos_base -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad -open Tezos_benchmark -open Tezos_benchmark_alpha diff --git a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml index e24350e3e51b242a6e35961cfa4b60dc8b34bd0b..5602b226ae4fce265518bf36a54bcad91d02a9c6 100644 --- a/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/translator_benchmarks.ml @@ -570,7 +570,6 @@ module Ty_eq : Benchmark.S = struct [("size_translator_model", size_model); ("codegen", codegen_model)] let ty_eq_benchmark rng_state nodes (ty : Script_ir_translator.ex_ty) = - let open Error_monad in Lwt_main.run ( Execution_context.make ~rng_state >>=? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in @@ -704,7 +703,6 @@ module Parse_type_benchmark : Benchmark.S = struct let info = "Benchmarking parse_ty" let make_bench rng_state config () = - let open Error_monad in ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in let size = Random.State.int rng_state config.max_size in @@ -756,7 +754,6 @@ module Unparse_type_benchmark : Benchmark.S = struct let info = "Benchmarking unparse_ty" let make_bench rng_state config () = - let open Error_monad in ( Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in let size = Random.State.int rng_state config.max_size in @@ -810,7 +807,6 @@ module Unparse_comparable_type_benchmark : Benchmark.S = struct let info = "Benchmarking unparse_comparable_ty" let make_bench rng_state config () = - let open Error_monad in let res = Lwt_main.run (Execution_context.make ~rng_state) >>? fun (ctxt, _) -> let ctxt = Gas_helpers.set_limit ctxt in diff --git a/src/proto_alpha/lib_client/client_proto_multisig.ml b/src/proto_alpha/lib_client/client_proto_multisig.ml index ce080f0bdf5224deeebf57c8d0949a3a88237311..41a267cb4e5a285e5b447ecd29b2ef77d9ad7e06 100644 --- a/src/proto_alpha/lib_client/client_proto_multisig.ml +++ b/src/proto_alpha/lib_client/client_proto_multisig.ml @@ -630,8 +630,7 @@ let action_to_expr_generic ~loc = function ~parameter ~amount >|? left ~loc) - | Lambda code -> - Error_monad.ok Tezos_micheline.Micheline.(left ~loc (root code)) + | Lambda code -> ok Tezos_micheline.Micheline.(left ~loc (root code)) | Change_delegate delegate -> lambda_from_string @@ Managed_contract.build_lambda_for_set_delegate ~delegate @@ -639,37 +638,36 @@ let action_to_expr_generic ~loc = function | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok expr + ok expr let action_to_expr_legacy ~loc = function | Transfer {amount; destination; entrypoint; parameter_type; parameter} -> if parameter <> Tezos_micheline.Micheline.strip_locations (unit ~loc:()) - then Error_monad.error @@ Unsupported_feature_generic_call parameter + then error @@ Unsupported_feature_generic_call parameter else if parameter_type <> Tezos_micheline.Micheline.strip_locations (unit_t ~loc:()) - then - Error_monad.error @@ Unsupported_feature_generic_call_ty parameter_type + then error @@ Unsupported_feature_generic_call_ty parameter_type else - Error_monad.ok + ok @@ left ~loc (pair ~loc (mutez ~loc amount) (optimized_address ~loc ~address:destination ~entrypoint)) - | Lambda _ -> Error_monad.error @@ Unsupported_feature_lambda "" + | Lambda _ -> error @@ Unsupported_feature_lambda "" | Change_delegate delegate -> let delegate_opt = match delegate with | None -> none ~loc () | Some delegate -> some ~loc (optimized_key_hash ~loc delegate) in - Error_monad.ok @@ right ~loc (left ~loc delegate_opt) + ok @@ right ~loc (left ~loc delegate_opt) | Change_keys (threshold, keys) -> let optimized_keys = seq ~loc (List.map (optimized_key ~loc) keys) in let expr = right ~loc (pair ~loc (int ~loc threshold) optimized_keys) in - Error_monad.ok (right ~loc expr) + ok (right ~loc expr) let action_to_expr ~loc ~generic action = if generic then action_to_expr_generic ~loc action diff --git a/src/proto_alpha/lib_client/dune b/src/proto_alpha/lib_client/dune index 2e95ca430effc0b7ffa1a611ed049d7dbc07acf0..324a2f36b7fd0c779e7b681181a2d89892348368 100644 --- a/src/proto_alpha/lib_client/dune +++ b/src/proto_alpha/lib_client/dune @@ -19,6 +19,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_client/managed_contract.ml b/src/proto_alpha/lib_client/managed_contract.ml index 2bd7e30b06b90507c30a2e560abf724e98db758d..7ed5db282c938bc2d81b3477dd97f7358e3098a4 100644 --- a/src/proto_alpha/lib_client/managed_contract.ml +++ b/src/proto_alpha/lib_client/managed_contract.ml @@ -82,8 +82,7 @@ let parse code = Lwt.return ( Micheline_parser.no_parsing_error @@ Michelson_v1_parser.parse_expression code - >>? fun exp -> - Error_monad.ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) + >>? fun exp -> ok @@ Script.lazy_expr Michelson_v1_parser.(exp.expanded) ) let build_lambda_for_set_delegate ~delegate = match delegate with diff --git a/src/proto_alpha/lib_client/test/dune b/src/proto_alpha/lib_client/test/dune index b79cbf2f3cb7d6ebf0f4ea385d94fa848f4b5417..c9bc210b11ce5b2eea8dc42b507c0b8132c2a870 100644 --- a/src/proto_alpha/lib_client/test/dune +++ b/src/proto_alpha/lib_client/test/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_alpha -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_client_commands/dune b/src/proto_alpha/lib_client_commands/dune index 8f9daaf54e8b968f95f531237966bc588b635855..d3783b425ed9f786152d662c1bf0b1beb08be467 100644 --- a/src/proto_alpha/lib_client_commands/dune +++ b/src/proto_alpha/lib_client_commands/dune @@ -19,6 +19,7 @@ (library_flags (:standard -linkall)) (modules (:standard \ alpha_commands_registration)) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_protocol_alpha_parameters -open Tezos_stdlib_unix @@ -49,6 +50,7 @@ (library_flags (:standard -linkall)) (modules alpha_commands_registration) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_protocol_alpha_parameters -open Tezos_shell_services diff --git a/src/proto_alpha/lib_client_sapling/dune b/src/proto_alpha/lib_client_sapling/dune index 1c4179a3760389a91d15ff0fa4153f58e7b8e2c6..02850971c035037c196c41e66d53ae85cf76f113 100644 --- a/src/proto_alpha/lib_client_sapling/dune +++ b/src/proto_alpha/lib_client_sapling/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_stdlib_unix -open Tezos_client_base -open Tezos_client_alpha diff --git a/src/proto_alpha/lib_delegate/dune b/src/proto_alpha/lib_delegate/dune index 5133e407968bcc1c6062d7b8b08d6952051a4078..03c733df55caa7f288accb0bace62366641aa43c 100644 --- a/src/proto_alpha/lib_delegate/dune +++ b/src/proto_alpha/lib_delegate/dune @@ -26,6 +26,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_protocol_plugin_alpha -open Tezos_shell_services @@ -59,6 +60,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_stdlib_unix -open Tezos_shell_services diff --git a/src/proto_alpha/lib_delegate/liquidity_baking_vote_file.ml b/src/proto_alpha/lib_delegate/liquidity_baking_vote_file.ml index b10ac7f4148250c1a8f4656514805ccae67224d5..e23b2934b9e68048ae2b1e96432fac8636af0028 100644 --- a/src/proto_alpha/lib_delegate/liquidity_baking_vote_file.ml +++ b/src/proto_alpha/lib_delegate/liquidity_baking_vote_file.ml @@ -135,7 +135,7 @@ let () = Block_vote_file_missing_liquidity_baking_toggle_vote file_path) let traced_option_to_result ~error = - Option.fold ~some:ok ~none:(Error_monad.error error) + Option.fold ~some:ok ~none:(Tzresult_syntax.fail error) let check_file_exists file = if Sys.file_exists file then Result.return_unit diff --git a/src/proto_alpha/lib_delegate/test/dune b/src/proto_alpha/lib_delegate/test/dune index 06701d59031fe548318bf048d3d1d4ccaabdbcff..2d64ebb7757cd11a6e54b8b9d9238333f07d1bea 100644 --- a/src/proto_alpha/lib_delegate/test/dune +++ b/src/proto_alpha/lib_delegate/test/dune @@ -16,6 +16,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_alpha -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_delegate/test/mockup_simulator/dune b/src/proto_alpha/lib_delegate/test/mockup_simulator/dune index e09d30d0d3fa87b07cb82f09c6d06095e51ba1da..8b41b35b0f10fa8d1703f969edba91a79aa99ac1 100644 --- a/src/proto_alpha/lib_delegate/test/mockup_simulator/dune +++ b/src/proto_alpha/lib_delegate/test/mockup_simulator/dune @@ -17,6 +17,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_client_alpha -open Tezos_client_commands diff --git a/src/proto_alpha/lib_delegate/test/tenderbrute/dune b/src/proto_alpha/lib_delegate/test/tenderbrute/dune index 6346e2a3c503beb94c8df3679b9e032a2795c081..b38203307c134e52e93b8623e9138e6e84c828f1 100644 --- a/src/proto_alpha/lib_delegate/test/tenderbrute/dune +++ b/src/proto_alpha/lib_delegate/test/tenderbrute/dune @@ -10,6 +10,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base -open Tezos_client_base -open Tezos_client_alpha diff --git a/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune b/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune index 13120e68bf2e848409d7c5e50db7f00d323dbf8f..aa5e9046ce0a578a91de999f2becb8faaf154624 100644 --- a/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune +++ b/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune @@ -12,6 +12,7 @@ (:standard -open Data_encoding -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base -open Tezos_protocol_alpha -open Tezos_client_base diff --git a/src/proto_alpha/lib_plugin/dune b/src/proto_alpha/lib_plugin/dune index 3895ee7da4e42003e0801e6bf13b1058e2d4d0d1..41a57bfea184c1130b8421a843a88f4c6d4427b5 100644 --- a/src/proto_alpha/lib_plugin/dune +++ b/src/proto_alpha/lib_plugin/dune @@ -7,6 +7,7 @@ ) (modules (:standard) \ Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha ))) @@ -20,6 +21,7 @@ tezos-shell) (modules Plugin_registerer) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_embedded_protocol_alpha -open Tezos_protocol_plugin_alpha -open Tezos_shell))) diff --git a/src/proto_alpha/lib_plugin/plugin.ml b/src/proto_alpha/lib_plugin/plugin.ml index 3a861b01635805621f0da5668ed0adfa1821b703..8bd6c0d764617d13066c18b2cfc3a2f831039fd1 100644 --- a/src/proto_alpha/lib_plugin/plugin.ml +++ b/src/proto_alpha/lib_plugin/plugin.ml @@ -2413,7 +2413,7 @@ module RPC = struct Contract.get_script ctxt contract >>=? fun (ctxt, script_opt) -> Option.fold ~some:ok - ~none:(Error_monad.error View_helpers.Viewed_contract_has_no_script) + ~none:(error View_helpers.Viewed_contract_has_no_script) script_opt >>?= fun script -> Script_repr.(force_decode script.code) >>?= fun decoded_script -> diff --git a/src/proto_alpha/lib_plugin/test/dune b/src/proto_alpha/lib_plugin/test/dune index 4c2fab37aaa22cb5b32ffb0c69fdfc510c005a37..37fb49f6b3976d0d4b12579ef480e1d0c0dd5252 100644 --- a/src/proto_alpha/lib_plugin/test/dune +++ b/src/proto_alpha/lib_plugin/test/dune @@ -13,6 +13,7 @@ tezos-alpha-test-helpers ) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_protocol/test/helpers/dune b/src/proto_alpha/lib_protocol/test/helpers/dune index 0ec09e52df09d3205ab55ff988503148c4cc6aca..9e27a8e32c7c83fd8b4c2648ebe99f6ad54ce4ae 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/dune +++ b/src/proto_alpha/lib_protocol/test/helpers/dune @@ -15,6 +15,7 @@ tezos-client-alpha tezos-protocol-plugin-alpha) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_stdlib_unix -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/dune b/src/proto_alpha/lib_protocol/test/integration/consensus/dune index 14d67879ca7e54a17a6175c8195d2d1948f30442..4cc8ec25ae1cda0fc4dd9fdc834236a27cf99f11 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/dune +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/dune @@ -9,6 +9,7 @@ tezos-protocol-alpha-parameters tezos-protocol-plugin-alpha) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_alpha_test_helpers -open Tezos_base_test_helpers diff --git a/src/proto_alpha/lib_protocol/test/integration/dune b/src/proto_alpha/lib_protocol/test/integration/dune index 62d9ef8a44e4973a929ba44510921f98479c4a26..8f92ac79237d53c7277edfb8f39e4391e811e652 100644 --- a/src/proto_alpha/lib_protocol/test/integration/dune +++ b/src/proto_alpha/lib_protocol/test/integration/dune @@ -9,6 +9,7 @@ tezos-base-test-helpers tezos-alpha-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_alpha -open Tezos_protocol_alpha -open Tezos_protocol_alpha_parameters diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/dune b/src/proto_alpha/lib_protocol/test/integration/gas/dune index 60fcd15cc751507cc134ad43c57942043a21a255..3e8544633c815fd6626ebfb6980873a54cea81a1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/dune +++ b/src/proto_alpha/lib_protocol/test/integration/gas/dune @@ -7,6 +7,7 @@ tezos-base-test-helpers tezos-alpha-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_alpha_test_helpers -open Tezos_base_test_helpers))) diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/dune b/src/proto_alpha/lib_protocol/test/integration/michelson/dune index ee14c3ffb8bb86ffe12babed6fdc4681e3028e87..68d240da1db21cee42f94824d92cfe835c216ff8 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/dune +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/dune @@ -15,6 +15,7 @@ tezos-benchmark tezos-benchmark-alpha) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_alpha_test_helpers -open Tezos_base_test_helpers diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/dune b/src/proto_alpha/lib_protocol/test/integration/operations/dune index 13babc23c207937d8d0709cfe4baefd3f93b0b93..e8d8134922954b3901e9e941564ec6dd5212d4d4 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/dune +++ b/src/proto_alpha/lib_protocol/test/integration/operations/dune @@ -8,6 +8,7 @@ tezos-base-test-helpers tezos-alpha-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_client_alpha -open Tezos_alpha_test_helpers diff --git a/src/proto_alpha/lib_protocol/test/pbt/dune b/src/proto_alpha/lib_protocol/test/pbt/dune index 71dca108c8c3ddc0839dce039aea96eb71dc0601..65bbc730a201057a5cd68b52d7f32311cfc28723 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/dune +++ b/src/proto_alpha/lib_protocol/test/pbt/dune @@ -23,6 +23,7 @@ tezos-benchmark-alpha) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline -open Tezos_client_alpha -open Tezos_protocol_alpha diff --git a/src/proto_alpha/lib_protocol/test/unit/dune b/src/proto_alpha/lib_protocol/test/unit/dune index ae6d11a0d9a67174e256017baf5afbcb07040926..2a375a55c2177936e6b0e6b90f0dc7594eddfb05 100644 --- a/src/proto_alpha/lib_protocol/test/unit/dune +++ b/src/proto_alpha/lib_protocol/test/unit/dune @@ -11,6 +11,7 @@ tezos-protocol-alpha-parameters tezos-base-test-helpers) (flags (:standard -open Tezos_base__TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_client_alpha diff --git a/src/proto_demo_counter/lib_client/dune b/src/proto_demo_counter/lib_client/dune index c7fe46cc835005c83ed38db442a05c74c63cdd5c..67387e882fc9a9afd79a0c70856ee67b0ce54e80 100644 --- a/src/proto_demo_counter/lib_client/dune +++ b/src/proto_demo_counter/lib_client/dune @@ -14,6 +14,7 @@ -w -9+27-30-32-40@8 -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_client_commands diff --git a/src/proto_genesis/lib_client/dune b/src/proto_genesis/lib_client/dune index 115be0aa939961b7751d825a2e9aa934211723a8..2df84bb86c82a5e32b7c6e76397189b4e66afc83 100644 --- a/src/proto_genesis/lib_client/dune +++ b/src/proto_genesis/lib_client/dune @@ -15,6 +15,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_genesis diff --git a/src/proto_genesis_carthagenet/lib_client/dune b/src/proto_genesis_carthagenet/lib_client/dune index 024946b1023d0e492fe00fec16637a28926d1fa7..ff1e6ff2edba6c2b8a181c2acf02c0885bf631d8 100644 --- a/src/proto_genesis_carthagenet/lib_client/dune +++ b/src/proto_genesis_carthagenet/lib_client/dune @@ -14,6 +14,7 @@ (flags (:standard -open Tezos_base.TzPervasives + -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_shell_services -open Tezos_client_base -open Tezos_protocol_genesis_carthagenet