diff --git a/src/proto_alpha/lib_client/client_proto_context.mli b/src/proto_alpha/lib_client/client_proto_context.mli index 437fdcdbc..af9783fb1 100644 --- a/src/proto_alpha/lib_client/client_proto_context.mli +++ b/src/proto_alpha/lib_client/client_proto_context.mli @@ -9,7 +9,6 @@ open Proto_alpha open Tezos_context -open Environment val list_contract_labels : #Client_commands.full_context -> diff --git a/src/proto_alpha/lib_client/client_proto_contracts.ml b/src/proto_alpha/lib_client/client_proto_contracts.ml index e94b0323d..4bbdcb728 100644 --- a/src/proto_alpha/lib_client/client_proto_contracts.ml +++ b/src/proto_alpha/lib_client/client_proto_contracts.ml @@ -16,7 +16,7 @@ module ContractEntity = struct let of_source s = match Contract.of_b58check s with | Error _ as err -> - Lwt.return (Environment.wrap_error err) + Lwt.return (Alpha_environment.wrap_error err) |> trace (failure "bad contract notation") | Ok s -> return s let to_source s = return (Contract.to_b58check s) diff --git a/src/proto_alpha/lib_client/client_proto_programs.ml b/src/proto_alpha/lib_client/client_proto_programs.ml index ffdc936eb..92fc8caca 100644 --- a/src/proto_alpha/lib_client/client_proto_programs.ml +++ b/src/proto_alpha/lib_client/client_proto_programs.ml @@ -130,7 +130,7 @@ let print_typecheck_result if emacs then let type_map, errs = match res with | Ok type_map -> type_map, [] - | Error (Environment.Ecoproto_error + | Error (Alpha_environment.Ecoproto_error (Script_tc_errors.Ill_typed_contract (_, type_map ) :: _) :: _ as errs) -> type_map, errs diff --git a/src/proto_alpha/lib_client/michelson_v1_emacs.ml b/src/proto_alpha/lib_client/michelson_v1_emacs.ml index f5b14de9c..d93092f01 100644 --- a/src/proto_alpha/lib_client/michelson_v1_emacs.ml +++ b/src/proto_alpha/lib_client/michelson_v1_emacs.ml @@ -99,8 +99,8 @@ let report_errors ppf (parsed, errs) = fst (List.assoc oloc parsed.expansion_table) in let errs, loc = match err with - | Environment.Ecoproto_error (top :: errs) -> - [ Environment.Ecoproto_error (top :: errs) ], + | Alpha_environment.Ecoproto_error (top :: errs) -> + [ Alpha_environment.Ecoproto_error (top :: errs) ], begin match top with | Ill_typed_contract (expr, _) | Ill_typed_data (_, expr, _) -> diff --git a/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml b/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml index 494c1e7ba..add65d155 100644 --- a/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml +++ b/src/proto_alpha/lib_client/michelson_v1_error_reporter.ml @@ -368,13 +368,14 @@ let report_errors ~details ~show_source ?parsed ppf errs = print_ty (None, tyb) | Reject _ -> Format.fprintf ppf "Script reached FAIL instruction" | Overflow _ -> Format.fprintf ppf "Unexpected arithmetic overflow" - | err -> Format.fprintf ppf "%a" Environment.Error_monad.pp err + | err -> Format.fprintf ppf "%a" Alpha_environment.Error_monad.pp err end ; if rest <> [] then Format.fprintf ppf "@," ; print_trace locations rest in Format.fprintf ppf "@[%a@]" (Format.pp_print_list (fun ppf -> function - | Environment.Ecoproto_error errs -> print_trace (fun _ -> None) errs + | Alpha_environment.Ecoproto_error errs -> + print_trace (fun _ -> None) errs | err -> pp ppf err)) errs diff --git a/src/proto_alpha/lib_client/michelson_v1_parser.ml b/src/proto_alpha/lib_client/michelson_v1_parser.ml index 0b400adbd..7a515a95f 100644 --- a/src/proto_alpha/lib_client/michelson_v1_parser.ml +++ b/src/proto_alpha/lib_client/michelson_v1_parser.ml @@ -67,7 +67,7 @@ let expand_all source ast errors = (l, (ploc, elocs))) (List.sort compare loc_table) (List.sort compare grouped) in - match Environment.wrap_error (Michelson_v1_primitives.prims_of_strings expanded) with + match Alpha_environment.wrap_error (Michelson_v1_primitives.prims_of_strings expanded) with | Ok expanded -> { source ; unexpanded ; expanded ; expansion_table ; unexpansion_table }, diff --git a/src/proto_alpha/lib_client/proto_alpha.ml b/src/proto_alpha/lib_client/proto_alpha.ml index 4c960566a..ebcc00e65 100644 --- a/src/proto_alpha/lib_client/proto_alpha.ml +++ b/src/proto_alpha/lib_client/proto_alpha.ml @@ -8,5 +8,5 @@ (**************************************************************************) module Name = struct let name = "alpha" end -module Environment = Tezos_protocol_environment_client.Fake.Make(Name)() -include Tezos_protocol_alpha.Functor.Make(Environment) +module Alpha_environment = Tezos_protocol_environment_client.Fake.Make(Name)() +include Tezos_protocol_alpha.Functor.Make(Alpha_environment) diff --git a/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml b/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml index 7a7b9e564..ca54fa286 100644 --- a/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml +++ b/src/proto_alpha/lib_client/test/proto_alpha_helpers.ml @@ -313,7 +313,7 @@ module Assert = struct equal_pkh ~msg expected_delegate actual_delegate let ecoproto_error f = function - | Environment.Ecoproto_error errors -> + | Alpha_environment.Ecoproto_error errors -> List.exists f errors | _ -> false @@ -451,7 +451,7 @@ module Baking = struct let endorsement_reward block = Client_proto_rpcs.Header.priority !rpc_ctxt block >>=? fun prio -> Baking.endorsement_reward ~block_priority:prio >|= - Environment.wrap_error >>|? + Alpha_environment.wrap_error >>|? Tez.to_mutez end diff --git a/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli b/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli index 75fef6700..dbab214c7 100644 --- a/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli +++ b/src/proto_alpha/lib_client/test/proto_alpha_helpers.mli @@ -166,12 +166,12 @@ module Assert : sig val failed_to_preapply: msg:string -> ?op:Tezos_base.Operation.t -> - (Environment.Error_monad.error -> + (Alpha_environment.Error_monad.error -> bool) -> 'a tzresult -> unit val ecoproto_error: - (Environment.Error_monad.error -> bool) -> + (Alpha_environment.Error_monad.error -> bool) -> error -> bool val generic_economic_error : msg:string -> 'a tzresult -> unit diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml b/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml index fe6263505..a4147c9d3 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_assert.ml @@ -40,7 +40,7 @@ module Assert = struct end -let wrap_result = Proto_alpha.Environment.wrap_error +let wrap_result = Alpha_environment.wrap_error let wrap = fun x -> Lwt.return @@ wrap_result x @@ -135,7 +135,7 @@ let equal_cents_balance ~tc ?msg (contract, cents_balance) = (contract, Helpers_cast.cents_of_int cents_balance) let ecoproto_error f = function - | Proto_alpha.Environment.Ecoproto_error errors -> + | Alpha_environment.Ecoproto_error errors -> List.exists f errors | _ -> false diff --git a/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli b/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli index 045880bcc..78b79cebc 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/helpers_operation.mli @@ -16,11 +16,11 @@ val sourced : sourced_operations -> proto_operation val manager : Helpers_account.t -> ?fee:Tez.tez -> manager_operation list -> - Proto_alpha.Environment.Context.t -> sourced_operations proto_tzresult Lwt.t + Alpha_environment.Context.t -> sourced_operations proto_tzresult Lwt.t val manager_full : Helpers_account.t -> ?fee:Tez.tez -> manager_operation list -> - Proto_alpha.Environment.Context.t -> proto_operation proto_tzresult Lwt.t + Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t val transaction : ?parameters:Script.expr -> Tez.t -> Contract.contract -> @@ -33,21 +33,21 @@ val origination : val delegation : public_key_hash -> manager_operation val delegation_full : - ?fee:Tez.tez -> Helpers_account.t -> public_key_hash -> Proto_alpha.Environment.Context.t -> + ?fee:Tez.tez -> Helpers_account.t -> public_key_hash -> Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t val script_origination_full : - Script.t option -> Helpers_account.t -> Tez.t -> Proto_alpha.Environment.Context.t -> + Script.t option -> Helpers_account.t -> Tez.t -> Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t val origination_full : ?spendable:bool -> ?delegatable:bool -> ?fee:Tez.tez -> - Helpers_account.t -> Tez.t -> Proto_alpha.Environment.Context.t -> + Helpers_account.t -> Tez.t -> Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t val transaction_full : ?fee:Tez.tez -> ?parameters:Proto_alpha.Tezos_context.Script.expr -> Helpers_account.t -> Contract.contract -> Tez.t -> - Proto_alpha.Environment.Context.t -> proto_operation proto_tzresult Lwt.t + Alpha_environment.Context.t -> proto_operation proto_tzresult Lwt.t val delegate : Helpers_account.t -> delegate_operation list -> sourced_operations diff --git a/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml b/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml index a3d9fb2be..274f8805c 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/isolate_helpers.ml @@ -38,7 +38,7 @@ module Shorthands = struct ~fitness:res.validation.fitness let get_balance_res (account:Account.t) (result:Block.result) = - let open Proto_alpha.Environment.Error_monad in + let open Alpha_environment.Error_monad in get_tc_full result >>=? fun tc -> Tezos_context.Contract.get_balance tc account.contract diff --git a/src/proto_alpha/lib_protocol/test/helpers/proto_alpha.ml b/src/proto_alpha/lib_protocol/test/helpers/proto_alpha.ml index f98f71da4..ab01b262b 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/proto_alpha.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/proto_alpha.ml @@ -12,11 +12,11 @@ module Context = Tezos_protocol_environment_client.Mem_context module Updater = Tezos_protocol_environment_client.Fake_updater.Make(Context) -module Environment = +module Alpha_environment = Tezos_base.Protocol_environment.MakeV1(Name)(Context)(Updater)() -include Tezos_protocol_alpha.Functor.Make(Environment) +include Tezos_protocol_alpha.Functor.Make(Alpha_environment) -module Error_monad = Environment.Error_monad +module Error_monad = Alpha_environment.Error_monad type proto_error = Error_monad.error type 'a proto_tzresult = 'a Error_monad.tzresult diff --git a/src/proto_genesis/lib_client/proto_alpha.ml b/src/proto_genesis/lib_client/proto_alpha.ml index 68cc787c4..93b8f262c 100644 --- a/src/proto_genesis/lib_client/proto_alpha.ml +++ b/src/proto_genesis/lib_client/proto_alpha.ml @@ -8,5 +8,5 @@ (**************************************************************************) module Name = struct let name = "genesis-alpha" end -module Environment = Tezos_protocol_environment_client.Fake.Make(Name)() -include Tezos_protocol_alpha.Functor.Make(Environment) +module Alpha_environment = Tezos_protocol_environment_client.Fake.Make(Name)() +include Tezos_protocol_alpha.Functor.Make(Alpha_environment) diff --git a/src/proto_genesis/lib_client/proto_genesis.ml b/src/proto_genesis/lib_client/proto_genesis.ml index 81adb2627..5f66b334f 100644 --- a/src/proto_genesis/lib_client/proto_genesis.ml +++ b/src/proto_genesis/lib_client/proto_genesis.ml @@ -8,5 +8,5 @@ (**************************************************************************) module Name = struct let name = "genesis" end -module Environment = Tezos_protocol_environment_client.Fake.Make(Name)() -include Tezos_protocol_genesis.Functor.Make(Environment) +module Genesis_environment = Tezos_protocol_environment_client.Fake.Make(Name)() +include Tezos_protocol_genesis.Functor.Make(Genesis_environment)