diff --git a/devtools/get_contracts/dune b/devtools/get_contracts/dune index 67c2304355b8195b0b0502f288233a26a9e7e18c..3f03b09dc8501a61d21f5aa54c8979c6b6eeb69f 100644 --- a/devtools/get_contracts/dune +++ b/devtools/get_contracts/dune @@ -26,6 +26,7 @@ (flags (:standard) -open Tezos_base.TzPervasives + -open Tezos_protocol_012_Psithaca -open Tezos_protocol_012_Psithaca.Protocol -open Tezos_client_012_Psithaca) (modules get_contracts_012_Psithaca)) @@ -40,6 +41,7 @@ (flags (:standard) -open Tezos_base.TzPervasives + -open Tezos_protocol_013_PtJakart -open Tezos_protocol_013_PtJakart.Protocol -open Tezos_client_013_PtJakart) (modules get_contracts_013_PtJakart)) @@ -54,6 +56,7 @@ (flags (:standard) -open Tezos_base.TzPervasives + -open Tezos_protocol_alpha -open Tezos_protocol_alpha.Protocol -open Tezos_client_alpha) (modules get_contracts_alpha)) diff --git a/manifest/main.ml b/manifest/main.ml index c8950f83fe4f446f45a0a53cf808c3c2027a0e22..f6c7b50f12df3412fac9bef2dece14f533fa2397 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -3079,15 +3079,10 @@ end = struct List.filter_map (fun (x, b) -> if b then Some x else None) module Lib_protocol = struct - type t = { - main : target; - embedded : target; - environment : target; - raw_protocol : target; - } + type t = {main : target; embedded : target} let make_tests ?test_helpers ?parameters ?plugin ?client ?benchmark - ?benchmark_type_inference ~main ~environment ~name () = + ?benchmark_type_inference ~main ~name () = let name_dash = Name.name_dash name in let number = Name.number name in let path = Name.base_path name in @@ -3262,7 +3257,6 @@ end = struct octez_protocol_environment; octez_stdlib_unix; main |> open_; - environment |> open_; test_helpers |> if_some |> open_; alcotest_lwt; octez_stdlib |> if_ N.(number >= 013) |> open_; @@ -3415,7 +3409,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end "Tezos/Protocol: %s economic-protocol definition" name_underscore | Alpha | V _ -> "Tezos/Protocol: economic-protocol definition") - ~modules:["Protocol"] + ~modules:["Protocol"; sf "Tezos_protocol_%s" name_underscore] ~flags:(Flags.standard ~nopervasives:true ~disable_warnings ()) ~deps: [ @@ -3438,15 +3432,29 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end S "%{targets}"; S (sf - {|module Environment = Tezos_protocol_environment_%s.Environment + {| let hash = Tezos_crypto.Protocol_hash.of_b58check_exn "%s" -let name = Environment.Name.name +let name = Tezos_protocol_environment_%s.Environment.Name.name include Tezos_raw_protocol_%s include Tezos_raw_protocol_%s.Main |} - name_underscore tezos_protocol.hash name_underscore + name_underscore + name_underscore); + ]; + targets_rule + [sf "tezos_protocol_%s.ml" name_underscore] + ~action: + [ + S "write-file"; + S "%{targets}"; + S + (sf + {| +module Environment = Tezos_protocol_environment_%s.Environment +module Protocol = Protocol +|} name_underscore); ]; alias_rule @@ -3502,12 +3510,7 @@ include Tezos_raw_protocol_%s.Main ~bisect_ppx:false ~flags:(Flags.standard ~nopervasives:true ~disable_warnings ()) ~opam_only_deps:[octez_protocol_compiler_tezos_protocol_packer] - ~deps: - [ - octez_protocol_environment; - tezos_protocol_environment_sigs; - raw_protocol; - ] + ~deps:[octez_protocol_environment; tezos_protocol_environment_sigs] ~dune: Dune. [ @@ -3578,14 +3581,12 @@ include Tezos_raw_protocol_%s.Main ]; ] in - {main; embedded; environment; raw_protocol} + {main; embedded} end let genesis = let name = Name.other "genesis" in - let {Lib_protocol.main; embedded; environment = _; raw_protocol = _} = - Lib_protocol.make ~name - in + let {Lib_protocol.main; embedded} = Lib_protocol.make ~name in let client = public_lib (sf "tezos-client-%s" (Name.name_dash name)) @@ -3609,16 +3610,12 @@ include Tezos_raw_protocol_%s.Main let demo_noops = let name = Name.other "demo-noops" in - let {Lib_protocol.main; embedded; environment = _; raw_protocol = _} = - Lib_protocol.make ~name - in + let {Lib_protocol.main; embedded} = Lib_protocol.make ~name in register @@ make ~name ~status:Not_mainnet ~main ~embedded () let _demo_counter = let name = Name.other "demo-counter" in - let {Lib_protocol.main; embedded; environment = _; raw_protocol = _} = - Lib_protocol.make ~name - in + let {Lib_protocol.main; embedded} = Lib_protocol.make ~name in let client = public_lib (sf "tezos-client-%s" (Name.name_dash name)) @@ -3656,9 +3653,7 @@ include Tezos_raw_protocol_%s.Main let both o1 o2 = match (o1, o2) with Some x, Some y -> Some (x, y) | _, _ -> None in - let {Lib_protocol.main; embedded; environment; raw_protocol} = - Lib_protocol.make ~name - in + let {Lib_protocol.main; embedded} = Lib_protocol.make ~name in let parameters = only_if (N.(number >= 011) && not_overridden) @@ fun () -> public_lib @@ -3797,7 +3792,6 @@ include Tezos_raw_protocol_%s.Main parameters |> if_some; octez_protocol_environment; plugin |> if_some |> open_; - environment |> open_; octez_shell_services |> open_; ] in @@ -3821,7 +3815,6 @@ include Tezos_raw_protocol_%s.Main octez_stdlib_unix; octez_micheline |> open_; plugin |> open_; - environment |> open_; main |> open_ |> open_ ~m:"Protocol"; parameters |> if_some |> open_; test_helpers |> open_; @@ -3898,7 +3891,6 @@ include Tezos_raw_protocol_%s.Main client |> if_some |> open_; client_commands |> if_some |> open_; main |> open_; - environment |> open_; plugin |> if_some |> if_ N.(number >= 013) |> open_; ] ~linkall:true @@ -4047,7 +4039,6 @@ include Tezos_raw_protocol_%s.Main octez_micheline |> open_; client |> if_some |> open_; main |> open_; - environment |> open_; test_helpers |> if_ N.(number <= 011) |> open_; octez_base_test_helpers |> open_; mockup_simulator |> if_some |> open_; @@ -4147,7 +4138,6 @@ include Tezos_raw_protocol_%s.Main |> open_; octez_crypto |> open_; main |> open_; - environment |> open_; octez_micheline |> open_; client |> if_some |> open_; octez_client_base |> open_; @@ -4247,7 +4237,6 @@ include Tezos_raw_protocol_%s.Main |> open_; octez_crypto |> open_; main |> open_; - environment |> open_; client |> if_some |> open_; octez_client_commands |> open_; octez_context_encoding; @@ -4280,13 +4269,12 @@ include Tezos_raw_protocol_%s.Main [ octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; - main |> open_; + main |> open_ |> open_ ~m:"Protocol"; client |> if_some |> open_; client_commands |> if_some |> open_; octez_client_base_unix |> open_; octez_stdlib_unix |> open_; tx_rollup |> if_some |> open_; - raw_protocol |> open_; uri; ] in @@ -4441,8 +4429,7 @@ include Tezos_raw_protocol_%s.Main octez_benchmark |> open_; benchmark |> if_some |> open_; benchmark_type_inference |> if_some |> open_; - main |> open_; - raw_protocol |> open_; + main |> open_ |> open_ ~m:"Protocol"; octez_crypto |> open_; octez_shell_benchmarks; octez_micheline |> open_; @@ -4463,7 +4450,6 @@ include Tezos_raw_protocol_%s.Main ?benchmark:(Option.bind benchmark Fun.id) ?benchmark_type_inference ~main - ~environment ~name () in @@ -4710,7 +4696,7 @@ let _get_contracts = ~deps: [ octez_base |> open_ ~m:"TzPervasives"; - main |> open_ ~m:"Protocol"; + main |> open_ |> open_ ~m:"Protocol"; client |> open_; get_contracts_lib; ] diff --git a/scripts/yes-wallet/yes_wallet_lib.ml b/scripts/yes-wallet/yes_wallet_lib.ml index b49196122b25912fbf2cfbcf7a04abc701c46468..8e54148eb7f72fbb7b8e5aab8a69ab3dbe12c162 100644 --- a/scripts/yes-wallet/yes_wallet_lib.ml +++ b/scripts/yes-wallet/yes_wallet_lib.ml @@ -198,7 +198,8 @@ let get_delegates (proto : protocol) context let fitness = header.fitness in match proto with | Florence -> - let open Tezos_protocol_009_PsFLoren.Protocol in + let open Tezos_protocol_009_PsFLoren in + let open Protocol in let* ctxt, _ = let*! r = Alpha_context.prepare @@ -258,7 +259,8 @@ let get_delegates (proto : protocol) context (fun (_, _, x) (_, _, y) -> Alpha_context.Tez.compare y x) delegates | Granada -> - let open Tezos_protocol_010_PtGRANAD.Protocol in + let open Tezos_protocol_010_PtGRANAD in + let open Protocol in let* ctxt, _, _ = let*! r = Alpha_context.prepare @@ -318,7 +320,8 @@ let get_delegates (proto : protocol) context (fun (_, _, x) (_, _, y) -> Alpha_context.Tez.compare y x) delegates | Hangzhou -> - let open Tezos_protocol_011_PtHangz2.Protocol in + let open Tezos_protocol_011_PtHangz2 in + let open Protocol in let* ctxt, _, _ = let*! r = Alpha_context.prepare @@ -378,7 +381,8 @@ let get_delegates (proto : protocol) context (fun (_, _, x) (_, _, y) -> Alpha_context.Tez.compare y x) delegates | Ithaca -> - let open Tezos_protocol_012_Psithaca.Protocol in + let open Tezos_protocol_012_Psithaca in + let open Protocol in let* ctxt, _, _ = let*! r = Alpha_context.prepare context ~level ~predecessor_timestamp ~timestamp @@ -434,7 +438,8 @@ let get_delegates (proto : protocol) context (fun (_, _, x) (_, _, y) -> Alpha_context.Tez.compare y x) delegates | Alpha -> - let open Tezos_protocol_alpha.Protocol in + let open Tezos_protocol_alpha in + let open Protocol in let* ctxt, _, _ = let*! r = Alpha_context.prepare context ~level ~predecessor_timestamp ~timestamp diff --git a/src/lib_protocol_compiler/bin/main_embedded_packer.ml b/src/lib_protocol_compiler/bin/main_embedded_packer.ml index 07fc19c44a1bedd848e1cbee14d26086dc91c75d..34ebaf34963fb0785511cdac8b22452e11e424a8 100644 --- a/src/lib_protocol_compiler/bin/main_embedded_packer.ml +++ b/src/lib_protocol_compiler/bin/main_embedded_packer.ml @@ -60,8 +60,8 @@ let () = {| module Registered = Tezos_protocol_updater.Registered_protocol.Register_embedded_%s - (Tezos_protocol_environment_%s.Environment) - (Tezos_raw_protocol_%s.Main) + (Tezos_protocol_%s.Environment) + (Tezos_protocol_%s.Protocol.Main) (Source) @.|} (Protocol.module_name_of_env_version sources.expected_env) diff --git a/src/lib_store/test/alpha_utils.ml b/src/lib_store/test/alpha_utils.ml index c886e6e65511cd8aefe64dc75a4ce4926af52c10..320f97ed6325c02eb1b0ede658c35094f61f2de7 100644 --- a/src/lib_store/test/alpha_utils.ml +++ b/src/lib_store/test/alpha_utils.ml @@ -24,7 +24,8 @@ (*****************************************************************************) module Assert = Lib_test.Assert -open Tezos_protocol_alpha.Protocol +open Tezos_protocol_alpha +open Protocol open Alpha_context open Tezos_context open Tezos_shell_context @@ -162,7 +163,7 @@ let make_rpc_context ~chain_id ctxt block = ~timestamp in let*? value_of_key = - Tezos_protocol_alpha.Protocol.Environment.wrap_tzresult value_of_key + Tezos_protocol_alpha.Environment.wrap_tzresult value_of_key in let* ctxt = Tezos_protocol_environment.Context.load_cache @@ -171,9 +172,7 @@ let make_rpc_context ~chain_id ctxt block = `Lazy (fun key -> let*! value = value_of_key key in - let*? value = - Tezos_protocol_alpha.Protocol.Environment.wrap_tzresult value - in + let*? value = Tezos_protocol_alpha.Environment.wrap_tzresult value in return value) in return diff --git a/src/lib_store/test/test_utils.ml b/src/lib_store/test/test_utils.ml index 46475d6f80fe4c678c7d68d138460f6920f461aa..8e3a12480617d658a8752d48847bd85b1ac63dbf 100644 --- a/src/lib_store/test/test_utils.ml +++ b/src/lib_store/test/test_utils.ml @@ -181,7 +181,7 @@ let dummy_patch_context ctxt = context = Context_hash.zero; } in - let*? {context; _} = Protocol.Environment.wrap_tzresult res in + let*? {context; _} = Environment.wrap_tzresult res in return (Tezos_shell_context.Shell_context.unwrap_disk_context context) let wrap_store_init ?(patch_context = dummy_patch_context) diff --git a/src/proto_000_Ps9mPmXa/lib_protocol/dune b/src/proto_000_Ps9mPmXa/lib_protocol/dune index 787a0c104e3f7decb96502b85531d52ce55850e6..600f2aad08168461a744c39782572a97c4a5d9ff 100644 --- a/src/proto_000_Ps9mPmXa/lib_protocol/dune +++ b/src/proto_000_Ps9mPmXa/lib_protocol/dune @@ -46,7 +46,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_000_Ps9mPmXa)) (install (package tezos-protocol-000-Ps9mPmXa) @@ -58,7 +58,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_000_Ps9mPmXa.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_000_Ps9mPmXa\ninclude Tezos_raw_protocol_000_Ps9mPmXa.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P\"\nlet name = Tezos_protocol_environment_000_Ps9mPmXa.Environment.Name.name\ninclude Tezos_raw_protocol_000_Ps9mPmXa\ninclude Tezos_raw_protocol_000_Ps9mPmXa.Main\n"))) + +(rule + (targets tezos_protocol_000_Ps9mPmXa.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_000_Ps9mPmXa.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -76,8 +83,7 @@ (name tezos_protocol_000_Ps9mPmXa_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-000-Ps9mPmXa.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_001_PtCJ7pwo/lib_client/alpha_client_context.ml b/src/proto_001_PtCJ7pwo/lib_client/alpha_client_context.ml index 40e7d5bb62bcb8b6fd86452a4bbe4369dca724fd..7c9f0a05f8ff204b0d96214616220fdd69b5bd44 100644 --- a/src/proto_001_PtCJ7pwo/lib_client/alpha_client_context.ml +++ b/src/proto_001_PtCJ7pwo/lib_client/alpha_client_context.ml @@ -32,8 +32,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -64,8 +63,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = t#call_streamed_service inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -75,13 +73,11 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end class wrap_full (t : Client_context.full) : full = @@ -89,8 +85,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_001_PtCJ7pwo/lib_protocol/dune b/src/proto_001_PtCJ7pwo/lib_protocol/dune index 5ee564582ef2c463e7021f2662716d50d520742e..5878a7dd5d9dc2b307e2751902f53fd29bc3477c 100644 --- a/src/proto_001_PtCJ7pwo/lib_protocol/dune +++ b/src/proto_001_PtCJ7pwo/lib_protocol/dune @@ -113,7 +113,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_001_PtCJ7pwo)) (install (package tezos-protocol-001-PtCJ7pwo) @@ -125,7 +125,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_001_PtCJ7pwo.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_001_PtCJ7pwo\ninclude Tezos_raw_protocol_001_PtCJ7pwo.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY\"\nlet name = Tezos_protocol_environment_001_PtCJ7pwo.Environment.Name.name\ninclude Tezos_raw_protocol_001_PtCJ7pwo\ninclude Tezos_raw_protocol_001_PtCJ7pwo.Main\n"))) + +(rule + (targets tezos_protocol_001_PtCJ7pwo.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_001_PtCJ7pwo.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -209,8 +216,7 @@ (name tezos_protocol_001_PtCJ7pwo_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-001-PtCJ7pwo.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_002_PsYLVpVv/lib_client/alpha_client_context.ml b/src/proto_002_PsYLVpVv/lib_client/alpha_client_context.ml index 40e7d5bb62bcb8b6fd86452a4bbe4369dca724fd..7c9f0a05f8ff204b0d96214616220fdd69b5bd44 100644 --- a/src/proto_002_PsYLVpVv/lib_client/alpha_client_context.ml +++ b/src/proto_002_PsYLVpVv/lib_client/alpha_client_context.ml @@ -32,8 +32,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -64,8 +63,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = t#call_streamed_service inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -75,13 +73,11 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end class wrap_full (t : Client_context.full) : full = @@ -89,8 +85,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_002_PsYLVpVv/lib_protocol/dune b/src/proto_002_PsYLVpVv/lib_protocol/dune index 4b8f316f106dd35bee0c6fc305152b43e0741d48..1dc454d7d4564f5c9d887a5ae318d82b697b2cc9 100644 --- a/src/proto_002_PsYLVpVv/lib_protocol/dune +++ b/src/proto_002_PsYLVpVv/lib_protocol/dune @@ -113,7 +113,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_002_PsYLVpVv)) (install (package tezos-protocol-002-PsYLVpVv) @@ -125,7 +125,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_002_PsYLVpVv.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_002_PsYLVpVv\ninclude Tezos_raw_protocol_002_PsYLVpVv.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt\"\nlet name = Tezos_protocol_environment_002_PsYLVpVv.Environment.Name.name\ninclude Tezos_raw_protocol_002_PsYLVpVv\ninclude Tezos_raw_protocol_002_PsYLVpVv.Main\n"))) + +(rule + (targets tezos_protocol_002_PsYLVpVv.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_002_PsYLVpVv.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -209,8 +216,7 @@ (name tezos_protocol_002_PsYLVpVv_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-002-PsYLVpVv.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_003_PsddFKi3/lib_client/alpha_client_context.ml b/src/proto_003_PsddFKi3/lib_client/alpha_client_context.ml index 40e7d5bb62bcb8b6fd86452a4bbe4369dca724fd..7c9f0a05f8ff204b0d96214616220fdd69b5bd44 100644 --- a/src/proto_003_PsddFKi3/lib_client/alpha_client_context.ml +++ b/src/proto_003_PsddFKi3/lib_client/alpha_client_context.ml @@ -32,8 +32,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -64,8 +63,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = t#call_streamed_service inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -75,13 +73,11 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end class wrap_full (t : Client_context.full) : full = @@ -89,8 +85,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_003_PsddFKi3/lib_protocol/dune b/src/proto_003_PsddFKi3/lib_protocol/dune index 51218ea300c7545f82ececab314de0cc2f94bc70..3946b3af9e9aa4009fb29dcdc2f15b64ce29e86e 100644 --- a/src/proto_003_PsddFKi3/lib_protocol/dune +++ b/src/proto_003_PsddFKi3/lib_protocol/dune @@ -114,7 +114,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_003_PsddFKi3)) (install (package tezos-protocol-003-PsddFKi3) @@ -126,7 +126,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_003_PsddFKi3.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_003_PsddFKi3\ninclude Tezos_raw_protocol_003_PsddFKi3.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP\"\nlet name = Tezos_protocol_environment_003_PsddFKi3.Environment.Name.name\ninclude Tezos_raw_protocol_003_PsddFKi3\ninclude Tezos_raw_protocol_003_PsddFKi3.Main\n"))) + +(rule + (targets tezos_protocol_003_PsddFKi3.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_003_PsddFKi3.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -211,8 +218,7 @@ (name tezos_protocol_003_PsddFKi3_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-003-PsddFKi3.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_004_Pt24m4xi/lib_client/alpha_client_context.ml b/src/proto_004_Pt24m4xi/lib_client/alpha_client_context.ml index f758c005e6e1742245dca90028720bd2791fee27..dbd0aeb7cbab37d1368a74f7833f6f27e2d85614 100644 --- a/src/proto_004_Pt24m4xi/lib_client/alpha_client_context.ml +++ b/src/proto_004_Pt24m4xi/lib_client/alpha_client_context.ml @@ -32,8 +32,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -64,8 +63,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = t#call_streamed_service inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -75,13 +73,11 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end class wrap_full (t : Client_context.full) : full = @@ -89,8 +85,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_004_Pt24m4xi/lib_protocol/dune b/src/proto_004_Pt24m4xi/lib_protocol/dune index 0f525fcea3228c1ab655b9158e88dd1825b7e165..c9aef4a19ea03601e875cb64ecf0825c0acf17ed 100644 --- a/src/proto_004_Pt24m4xi/lib_protocol/dune +++ b/src/proto_004_Pt24m4xi/lib_protocol/dune @@ -114,7 +114,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_004_Pt24m4xi)) (install (package tezos-protocol-004-Pt24m4xi) @@ -126,7 +126,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_004_Pt24m4xi.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_004_Pt24m4xi\ninclude Tezos_raw_protocol_004_Pt24m4xi.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd\"\nlet name = Tezos_protocol_environment_004_Pt24m4xi.Environment.Name.name\ninclude Tezos_raw_protocol_004_Pt24m4xi\ninclude Tezos_raw_protocol_004_Pt24m4xi.Main\n"))) + +(rule + (targets tezos_protocol_004_Pt24m4xi.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_004_Pt24m4xi.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -211,8 +218,7 @@ (name tezos_protocol_004_Pt24m4xi_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-004-Pt24m4xi.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_005_PsBABY5H/lib_protocol/dune b/src/proto_005_PsBABY5H/lib_protocol/dune index 1f234b11a7cd4c64a8caa85528f3d5052359a266..16da9173c0df362ff3b2093c186860d18bc6f4fb 100644 --- a/src/proto_005_PsBABY5H/lib_protocol/dune +++ b/src/proto_005_PsBABY5H/lib_protocol/dune @@ -115,7 +115,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_005_PsBABY5H)) (install (package tezos-protocol-005-PsBABY5H) @@ -127,7 +127,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_005_PsBABY5H.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_005_PsBABY5H\ninclude Tezos_raw_protocol_005_PsBABY5H.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU\"\nlet name = Tezos_protocol_environment_005_PsBABY5H.Environment.Name.name\ninclude Tezos_raw_protocol_005_PsBABY5H\ninclude Tezos_raw_protocol_005_PsBABY5H.Main\n"))) + +(rule + (targets tezos_protocol_005_PsBABY5H.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_005_PsBABY5H.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -213,8 +220,7 @@ (name tezos_protocol_005_PsBABY5H_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-005-PsBABY5H.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_005_PsBabyM1/lib_client/protocol_client_context.ml b/src/proto_005_PsBabyM1/lib_client/protocol_client_context.ml index 5be1fb146d6a9bb8438fc57f0f8ecfd95e025e4b..519fa90c1c8a9f42cc66c0e8771b76375aa9aaed 100644 --- a/src/proto_005_PsBabyM1/lib_client/protocol_client_context.ml +++ b/src/proto_005_PsBabyM1/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -39,8 +39,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -71,8 +70,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = t#call_streamed_service inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -82,13 +80,11 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end class wrap_full (t : Client_context.full) : full = @@ -96,8 +92,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_005_PsBabyM1/lib_protocol/dune b/src/proto_005_PsBabyM1/lib_protocol/dune index 01eaf41aee51363a674e835ca6cdefb41c5313e9..2672d3f1c84732a00eb87b4d79c50a80c6345b4c 100644 --- a/src/proto_005_PsBabyM1/lib_protocol/dune +++ b/src/proto_005_PsBabyM1/lib_protocol/dune @@ -115,7 +115,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_005_PsBabyM1)) (install (package tezos-protocol-005-PsBabyM1) @@ -127,7 +127,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_005_PsBabyM1.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_005_PsBabyM1\ninclude Tezos_raw_protocol_005_PsBabyM1.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS\"\nlet name = Tezos_protocol_environment_005_PsBabyM1.Environment.Name.name\ninclude Tezos_raw_protocol_005_PsBabyM1\ninclude Tezos_raw_protocol_005_PsBabyM1.Main\n"))) + +(rule + (targets tezos_protocol_005_PsBabyM1.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_005_PsBabyM1.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -213,8 +220,7 @@ (name tezos_protocol_005_PsBabyM1_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-005-PsBabyM1.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_006_PsCARTHA/lib_client/protocol_client_context.ml b/src/proto_006_PsCARTHA/lib_client/protocol_client_context.ml index 686667044abacd909da62500224dbf382c48f388..7c20976ff8619e9577ef5d197a738450f63c7536 100644 --- a/src/proto_006_PsCARTHA/lib_client/protocol_client_context.ml +++ b/src/proto_006_PsCARTHA/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -39,8 +39,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -71,8 +70,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = t#call_streamed_service inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -82,13 +80,11 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end class wrap_full (t : Client_context.full) : full = @@ -96,8 +92,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_006_PsCARTHA/lib_protocol/dune b/src/proto_006_PsCARTHA/lib_protocol/dune index 4afd2869b36be08eab2fe40d528f9915c40074ea..ad66066b5a586998f51fe0122a97e7c678c7ea97 100644 --- a/src/proto_006_PsCARTHA/lib_protocol/dune +++ b/src/proto_006_PsCARTHA/lib_protocol/dune @@ -115,7 +115,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_006_PsCARTHA)) (install (package tezos-protocol-006-PsCARTHA) @@ -127,7 +127,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_006_PsCARTHA.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_006_PsCARTHA\ninclude Tezos_raw_protocol_006_PsCARTHA.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb\"\nlet name = Tezos_protocol_environment_006_PsCARTHA.Environment.Name.name\ninclude Tezos_raw_protocol_006_PsCARTHA\ninclude Tezos_raw_protocol_006_PsCARTHA.Main\n"))) + +(rule + (targets tezos_protocol_006_PsCARTHA.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_006_PsCARTHA.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -213,8 +220,7 @@ (name tezos_protocol_006_PsCARTHA_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-006-PsCARTHA.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_007_PsDELPH1/lib_client/protocol_client_context.ml b/src/proto_007_PsDELPH1/lib_client/protocol_client_context.ml index c4cacea6bd501a432d286dbdc8cdd33c91f993e7..b2becb8d99c59dc91bf48aee54fa2482e47b166b 100644 --- a/src/proto_007_PsDELPH1/lib_client/protocol_client_context.ml +++ b/src/proto_007_PsDELPH1/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_007_PsDELPH1/lib_plugin/plugin.ml b/src/proto_007_PsDELPH1/lib_plugin/plugin.ml index cf575957c82c97d6f0f5b74e7c9ebfe68e0e1c18..9d5576906d8d9c7a8e25549ad090e6e72955b0ff 100644 --- a/src/proto_007_PsDELPH1/lib_plugin/plugin.ml +++ b/src/proto_007_PsDELPH1/lib_plugin/plugin.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Protocol - module RPC = struct let rpc_services : Environment.Updater.rpc_context RPC_directory.t = Protocol.rpc_services diff --git a/src/proto_007_PsDELPH1/lib_protocol/dune b/src/proto_007_PsDELPH1/lib_protocol/dune index c5674ebb79a48129d87a1d8c502924443d117e46..ececfa3136cf8656514cc57e97d2bc90c2c8d171 100644 --- a/src/proto_007_PsDELPH1/lib_protocol/dune +++ b/src/proto_007_PsDELPH1/lib_protocol/dune @@ -117,7 +117,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_007_PsDELPH1)) (install (package tezos-protocol-007-PsDELPH1) @@ -129,7 +129,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_007_PsDELPH1.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_007_PsDELPH1\ninclude Tezos_raw_protocol_007_PsDELPH1.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo\"\nlet name = Tezos_protocol_environment_007_PsDELPH1.Environment.Name.name\ninclude Tezos_raw_protocol_007_PsDELPH1\ninclude Tezos_raw_protocol_007_PsDELPH1.Main\n"))) + +(rule + (targets tezos_protocol_007_PsDELPH1.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_007_PsDELPH1.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -217,8 +224,7 @@ (name tezos_protocol_007_PsDELPH1_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-007-PsDELPH1.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_008_PtEdo2Zk/lib_client/protocol_client_context.ml b/src/proto_008_PtEdo2Zk/lib_client/protocol_client_context.ml index 3624e0cae05906feac36059ee20ae0ee1684ca96..0b2e471b20b274a9ad4f17594b66bff25adbc8c1 100644 --- a/src/proto_008_PtEdo2Zk/lib_client/protocol_client_context.ml +++ b/src/proto_008_PtEdo2Zk/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_008_PtEdo2Zk/lib_protocol/dune b/src/proto_008_PtEdo2Zk/lib_protocol/dune index 0861d0b09df6ef0139ec12f5864567e43c6960b7..afd5118cd07433d3559898407d7a44ef01c97ac5 100644 --- a/src/proto_008_PtEdo2Zk/lib_protocol/dune +++ b/src/proto_008_PtEdo2Zk/lib_protocol/dune @@ -122,7 +122,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_008_PtEdo2Zk)) (install (package tezos-protocol-008-PtEdo2Zk) @@ -134,7 +134,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_008_PtEdo2Zk.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_008_PtEdo2Zk\ninclude Tezos_raw_protocol_008_PtEdo2Zk.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA\"\nlet name = Tezos_protocol_environment_008_PtEdo2Zk.Environment.Name.name\ninclude Tezos_raw_protocol_008_PtEdo2Zk\ninclude Tezos_raw_protocol_008_PtEdo2Zk.Main\n"))) + +(rule + (targets tezos_protocol_008_PtEdo2Zk.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_008_PtEdo2Zk.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -227,8 +234,7 @@ (name tezos_protocol_008_PtEdo2Zk_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-008-PtEdo2Zk.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_008_PtEdoTez/lib_protocol/dune b/src/proto_008_PtEdoTez/lib_protocol/dune index 8b1969bf86f49d07d28cf949db0195be6d240d8d..99749c2782399b095a1dea31c4072c8fae0b93b4 100644 --- a/src/proto_008_PtEdoTez/lib_protocol/dune +++ b/src/proto_008_PtEdoTez/lib_protocol/dune @@ -122,7 +122,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_008_PtEdoTez)) (install (package tezos-protocol-008-PtEdoTez) @@ -134,7 +134,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_008_PtEdoTez.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_008_PtEdoTez\ninclude Tezos_raw_protocol_008_PtEdoTez.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq\"\nlet name = Tezos_protocol_environment_008_PtEdoTez.Environment.Name.name\ninclude Tezos_raw_protocol_008_PtEdoTez\ninclude Tezos_raw_protocol_008_PtEdoTez.Main\n"))) + +(rule + (targets tezos_protocol_008_PtEdoTez.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_008_PtEdoTez.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -227,8 +234,7 @@ (name tezos_protocol_008_PtEdoTez_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-008-PtEdoTez.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_009_PsFLoren/lib_client/protocol_client_context.ml b/src/proto_009_PsFLoren/lib_client/protocol_client_context.ml index 1a8add9504627d30b8ee56a86109f4eb03a38dbf..53f6350e07a3a94690c0c7be64849f9e9b7c5995 100644 --- a/src/proto_009_PsFLoren/lib_client/protocol_client_context.ml +++ b/src/proto_009_PsFLoren/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_009_PsFLoren/lib_protocol/dune b/src/proto_009_PsFLoren/lib_protocol/dune index 4ae25e8fec6f3f9c2b29fe5ed948f4ac55788b4c..be40efad84605556d94adfafd5c7a4cd73546908 100644 --- a/src/proto_009_PsFLoren/lib_protocol/dune +++ b/src/proto_009_PsFLoren/lib_protocol/dune @@ -125,7 +125,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_009_PsFLoren)) (install (package tezos-protocol-009-PsFLoren) @@ -137,7 +137,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_009_PsFLoren.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_009_PsFLoren\ninclude Tezos_raw_protocol_009_PsFLoren.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i\"\nlet name = Tezos_protocol_environment_009_PsFLoren.Environment.Name.name\ninclude Tezos_raw_protocol_009_PsFLoren\ninclude Tezos_raw_protocol_009_PsFLoren.Main\n"))) + +(rule + (targets tezos_protocol_009_PsFLoren.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_009_PsFLoren.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -233,8 +240,7 @@ (name tezos_protocol_009_PsFLoren_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-009-PsFLoren.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_010_PtGRANAD/lib_client/protocol_client_context.ml b/src/proto_010_PtGRANAD/lib_client/protocol_client_context.ml index 1a8add9504627d30b8ee56a86109f4eb03a38dbf..53f6350e07a3a94690c0c7be64849f9e9b7c5995 100644 --- a/src/proto_010_PtGRANAD/lib_client/protocol_client_context.ml +++ b/src/proto_010_PtGRANAD/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_010_PtGRANAD/lib_protocol/dune b/src/proto_010_PtGRANAD/lib_protocol/dune index e069200650eaeb283a825a7e0a336e6a5ca52916..d014fc0940ba2d3b653763e34f2883fb5d386a2a 100644 --- a/src/proto_010_PtGRANAD/lib_protocol/dune +++ b/src/proto_010_PtGRANAD/lib_protocol/dune @@ -130,7 +130,7 @@ (:standard) -w -6-7-9-16-29-32-51-68 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_010_PtGRANAD)) (install (package tezos-protocol-010-PtGRANAD) @@ -142,7 +142,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_010_PtGRANAD.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_010_PtGRANAD\ninclude Tezos_raw_protocol_010_PtGRANAD.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV\"\nlet name = Tezos_protocol_environment_010_PtGRANAD.Environment.Name.name\ninclude Tezos_raw_protocol_010_PtGRANAD\ninclude Tezos_raw_protocol_010_PtGRANAD.Main\n"))) + +(rule + (targets tezos_protocol_010_PtGRANAD.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_010_PtGRANAD.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -243,8 +250,7 @@ (name tezos_protocol_010_PtGRANAD_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-010-PtGRANAD.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -6-7-9-16-29-32-51-68 diff --git a/src/proto_011_PtHangz2/lib_client/mockup.ml b/src/proto_011_PtHangz2/lib_client/mockup.ml index 2e3c535bbb13fdf62f336cd3b12734ee139cedd4..675651e960da7db613d37e097cbbc928b917881b 100644 --- a/src/proto_011_PtHangz2/lib_client/mockup.ml +++ b/src/proto_011_PtHangz2/lib_client/mockup.ml @@ -766,7 +766,7 @@ type block = { hash : Block_hash.t; header : Block_header.t; operations : Operation.packed list; - context : Protocol.Environment.Context.t; + context : Environment.Context.t; } module Forge = struct @@ -809,7 +809,7 @@ let initial_context chain_id (header : Block_header.shell_header) add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> add ctxt ["protocol_parameters"] proto_params) >>= fun ctxt -> - Protocol.Main.init ctxt header >|= Protocol.Environment.wrap_tzresult + Protocol.Main.init ctxt header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let ({ timestamp = predecessor_timestamp; @@ -839,7 +839,7 @@ let initial_context chain_id (header : Block_header.shell_header) ~predecessor_fitness ~predecessor ~timestamp - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun value_of_key -> (* In the mockup mode, reactivity is important and there are @@ -851,7 +851,7 @@ let initial_context chain_id (header : Block_header.shell_header) predecessor context `Lazy - (fun key -> value_of_key key >|= Protocol.Environment.wrap_tzresult) + (fun key -> value_of_key key >|= Environment.wrap_tzresult) >>=? fun context -> return context let mem_init : @@ -957,7 +957,7 @@ let migrate : let Tezos_protocol_environment.{block_hash; context; block_header} = rpc_context in - Protocol.Main.init context block_header >|= Protocol.Environment.wrap_tzresult + Protocol.Main.init context block_header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let rpc_context = Tezos_protocol_environment.{block_hash; block_header; context} diff --git a/src/proto_011_PtHangz2/lib_client/protocol_client_context.ml b/src/proto_011_PtHangz2/lib_client/protocol_client_context.ml index 1a8add9504627d30b8ee56a86109f4eb03a38dbf..53f6350e07a3a94690c0c7be64849f9e9b7c5995 100644 --- a/src/proto_011_PtHangz2/lib_client/protocol_client_context.ml +++ b/src/proto_011_PtHangz2/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_011_PtHangz2/lib_client_sapling/dune b/src/proto_011_PtHangz2/lib_client_sapling/dune index 593ba47dfd004f31f90ef1625d59f63ed593e1a2..23950c5cd2f751f74204070ff4c0706ecc6de819 100644 --- a/src/proto_011_PtHangz2/lib_client_sapling/dune +++ b/src/proto_011_PtHangz2/lib_client_sapling/dune @@ -13,8 +13,7 @@ tezos-signer-backends tezos-client-011-PtHangz2 tezos-client-011-PtHangz2.commands - tezos-protocol-011-PtHangz2 - tezos-protocol-011-PtHangz2.environment) + tezos-protocol-011-PtHangz2) (library_flags (:standard -linkall)) (flags (:standard) @@ -24,5 +23,4 @@ -open Tezos_client_base -open Tezos_client_011_PtHangz2 -open Tezos_client_011_PtHangz2_commands - -open Tezos_protocol_011_PtHangz2 - -open Tezos_protocol_environment_011_PtHangz2)) + -open Tezos_protocol_011_PtHangz2)) diff --git a/src/proto_011_PtHangz2/lib_protocol/dune b/src/proto_011_PtHangz2/lib_protocol/dune index 215979b1906e88dfbb5229c675ca1d28abea7982..93c52754f3a92828af4e015600967c05eba70e8b 100644 --- a/src/proto_011_PtHangz2/lib_protocol/dune +++ b/src/proto_011_PtHangz2/lib_protocol/dune @@ -143,7 +143,7 @@ (:standard) -w -51 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_011_PtHangz2)) (install (package tezos-protocol-011-PtHangz2) @@ -155,7 +155,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_011_PtHangz2.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_011_PtHangz2\ninclude Tezos_raw_protocol_011_PtHangz2.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx\"\nlet name = Tezos_protocol_environment_011_PtHangz2.Environment.Name.name\ninclude Tezos_raw_protocol_011_PtHangz2\ninclude Tezos_raw_protocol_011_PtHangz2.Main\n"))) + +(rule + (targets tezos_protocol_011_PtHangz2.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_011_PtHangz2.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -264,8 +271,7 @@ (name tezos_protocol_011_PtHangz2_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-011-PtHangz2.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -51 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 8c6c9fdd6d667984fe4f668b2895b2bc14abf502..f3f8431021b4347451cd451fe3aa054b03cac207 100644 --- a/src/proto_012_Psithaca/lib_benchmark/test/test_helpers.ml +++ b/src/proto_012_Psithaca/lib_benchmark/test/test_helpers.ml @@ -77,5 +77,5 @@ let typecheck_by_tezos = ~legacy:false (Micheline.root node) bef - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun _ -> return_unit )) diff --git a/src/proto_012_Psithaca/lib_benchmarks_proto/dune b/src/proto_012_Psithaca/lib_benchmarks_proto/dune index cab7ecc383ca130d7e8f2d54f09da0a72b98582d..08b76ef44d76c498239d543b79d97846024e6944 100644 --- a/src/proto_012_Psithaca/lib_benchmarks_proto/dune +++ b/src/proto_012_Psithaca/lib_benchmarks_proto/dune @@ -15,7 +15,6 @@ tezos-benchmark-012-Psithaca tezos-benchmark-type-inference-012-Psithaca tezos-protocol-012-Psithaca - tezos-protocol-012-Psithaca.raw tezos-crypto tezos-shell-benchmarks tezos-micheline @@ -35,7 +34,7 @@ -open Tezos_benchmark_012_Psithaca -open Tezos_benchmark_type_inference_012_Psithaca -open Tezos_protocol_012_Psithaca - -open Tezos_raw_protocol_012_Psithaca + -open Tezos_protocol_012_Psithaca.Protocol -open Tezos_crypto -open Tezos_micheline -open Tezos_012_Psithaca_test_helpers diff --git a/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_benchmarks.ml index 5ce5c4ff0693fc7cf3e84b3aeea81f152cddc084..3f242235d02f97046d61d12123948edbea5188a0 100644 --- a/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_benchmarks.ml @@ -95,7 +95,7 @@ module Apply_diff_bench : Benchmark.S = struct Lazy_storage_kind.Sapling_state.Id.parse_z state_id in Alpha_context.Sapling.(state_from_id ctxt external_state_id) - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (state, ctxt) -> Format.eprintf "state hash: %d@." (Hashtbl.hash state.diff) ; Format.eprintf diff --git a/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_generation.ml b/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_generation.ml index b07bebe1eda69838eb63ff1d99a83ea1eae05f22..acda81b3de27b10a76cb42beb19493ec7cb12f30 100644 --- a/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_generation.ml +++ b/src/proto_012_Psithaca/lib_benchmarks_proto/sapling_generation.ml @@ -189,7 +189,7 @@ let rec add_root nb_root ctxt id vk index size diff state = add_input Protocol.Sapling_storage.empty_diff vk index size 0L state >>=? fun (diff_to_add, {position = size; _}, new_idx) -> Protocol.Sapling_storage.apply_diff ctxt id diff_to_add - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (ctxt, _) -> (* We call it nb_root -1 because one root is already present*) add_root @@ -296,7 +296,7 @@ let make_inputs to_forge local_state proving_ctx sk vk root anti_replay = to_forge let init_fresh_sapling_state ctxt = - let open Protocol.Environment.Error_monad in + let open Environment.Error_monad in Protocol.Lazy_storage_diff.fresh Protocol.Lazy_storage_kind.Sapling_state ~temporary:false @@ -323,7 +323,7 @@ let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) * Protocol.Lazy_storage_kind.Sapling_state.Id.t) tzresult Lwt.t = - init_fresh_sapling_state ctxt >|= Protocol.Environment.wrap_tzresult + init_fresh_sapling_state ctxt >|= Environment.wrap_tzresult >>=? fun (ctxt, id) -> let index_start = Tezos_sapling.Core.Client.Viewing_key.default_index in let sk, vk = generate_spending_and_viewing_keys state in @@ -336,8 +336,7 @@ let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) ~index:index_start state >>=? fun (diff, to_forge) -> - Protocol.Sapling_storage.apply_diff ctxt id diff - >|= Protocol.Environment.wrap_tzresult + Protocol.Sapling_storage.apply_diff ctxt id diff >|= Environment.wrap_tzresult >>=? fun (ctxt, _size) -> return (diff, to_forge, sk, vk, ctxt, id) let prepare_seeded_state @@ -556,6 +555,6 @@ let generate (save_to : string) (tx_count : int) match result with Ok txs -> save ~filename:save_to ~txs | Error _ -> () let apply_diff ctxt id diff = - let open Protocol.Environment.Error_monad in + let open Environment.Error_monad in Sapling_storage.apply_diff (alpha_to_raw ctxt) id diff >>=? fun (ctxt, size) -> return (raw_to_alpha ctxt, size) diff --git a/src/proto_012_Psithaca/lib_client/mockup.ml b/src/proto_012_Psithaca/lib_client/mockup.ml index 7932f4aa5cdfa3697e653cf21f40c6cb0886ed24..9355426d3cee4bd771ce9dd9469254b0f1ae8809 100644 --- a/src/proto_012_Psithaca/lib_client/mockup.ml +++ b/src/proto_012_Psithaca/lib_client/mockup.ml @@ -856,7 +856,7 @@ type block = { hash : Block_hash.t; header : Block_header.t; operations : Operation.packed list; - context : Protocol.Environment.Context.t; + context : Environment.Context.t; } module Forge = struct @@ -911,8 +911,8 @@ let initial_context chain_id (header : Block_header.shell_header) add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> add ctxt ["protocol_parameters"] proto_params) >>= fun ctxt -> - Protocol.Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> - Protocol.Main.init ctxt header >|= Protocol.Environment.wrap_tzresult + Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> + Protocol.Main.init ctxt header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let ({ timestamp = predecessor_timestamp; @@ -942,7 +942,7 @@ let initial_context chain_id (header : Block_header.shell_header) ~predecessor_fitness ~predecessor ~timestamp - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun value_of_key -> (* In the mockup mode, reactivity is important and there are @@ -954,7 +954,7 @@ let initial_context chain_id (header : Block_header.shell_header) predecessor context `Lazy - (fun key -> value_of_key key >|= Protocol.Environment.wrap_tzresult) + (fun key -> value_of_key key >|= Environment.wrap_tzresult) >>=? fun context -> return context let mem_init : @@ -1106,8 +1106,8 @@ let migrate : let Tezos_protocol_environment.{block_hash; context; block_header} = rpc_context in - Protocol.Environment.Updater.activate context Protocol.hash >>= fun context -> - Protocol.Main.init context block_header >|= Protocol.Environment.wrap_tzresult + Environment.Updater.activate context Protocol.hash >>= fun context -> + Protocol.Main.init context block_header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let rpc_context = Tezos_protocol_environment.{block_hash; block_header; context} diff --git a/src/proto_012_Psithaca/lib_client/protocol_client_context.ml b/src/proto_012_Psithaca/lib_client/protocol_client_context.ml index 1731670b6716a93884ba9a98ab27ab0c4091ca8c..1e683ed8f26f40d6d651661b3de4a12bee9c4a44 100644 --- a/src/proto_012_Psithaca/lib_client/protocol_client_context.ml +++ b/src/proto_012_Psithaca/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_012_Psithaca/lib_client_sapling/dune b/src/proto_012_Psithaca/lib_client_sapling/dune index 7af8c25abc368b164ccbde50937a89aa3fc7db53..dd8ecbadf7caabff88b8816cbff8d4ca1926fb45 100644 --- a/src/proto_012_Psithaca/lib_client_sapling/dune +++ b/src/proto_012_Psithaca/lib_client_sapling/dune @@ -13,8 +13,7 @@ tezos-signer-backends tezos-client-012-Psithaca tezos-client-012-Psithaca.commands - tezos-protocol-012-Psithaca - tezos-protocol-012-Psithaca.environment) + tezos-protocol-012-Psithaca) (library_flags (:standard -linkall)) (flags (:standard) @@ -24,5 +23,4 @@ -open Tezos_client_base -open Tezos_client_012_Psithaca -open Tezos_client_012_Psithaca_commands - -open Tezos_protocol_012_Psithaca - -open Tezos_protocol_environment_012_Psithaca)) + -open Tezos_protocol_012_Psithaca)) diff --git a/src/proto_012_Psithaca/lib_delegate/baking_scheduling.ml b/src/proto_012_Psithaca/lib_delegate/baking_scheduling.ml index 5f5bbcd514052e592977a310696c9e4597581f56..a12e4d95decd2abd5d7368a4dddce95066652e21 100644 --- a/src/proto_012_Psithaca/lib_delegate/baking_scheduling.ml +++ b/src/proto_012_Psithaca/lib_delegate/baking_scheduling.ml @@ -359,7 +359,7 @@ let compute_next_potential_baking_time_at_next_level state = possibly means the baker has been late. *) (if Time.Protocol.(now < min_possible_time) then ok Round.zero else - Protocol.Environment.wrap_tzresult + Environment.wrap_tzresult @@ Round.round_of_timestamp round_durations ~predecessor_timestamp @@ -582,7 +582,7 @@ let create_round_durations constants = let delay_increment_per_round = constants.parametric.delay_increment_per_round in - Protocol.Environment.wrap_tzresult + Environment.wrap_tzresult (Round.Durations.create ~first_round_duration ~delay_increment_per_round) let create_initial_state cctxt ?(synchronize = true) ~chain config @@ -683,8 +683,7 @@ let compute_bootstrap_event state = else (* Otherwise, trigger the end of round to check whether we need to propose at this level or not *) - Protocol.Environment.wrap_tzresult - @@ Round.pred state.round_state.current_round + Environment.wrap_tzresult @@ Round.pred state.round_state.current_round >>? fun ending_round -> ok @@ Baking_state.Timeout (End_of_round {ending_round}) diff --git a/src/proto_012_Psithaca/lib_delegate/test/dune b/src/proto_012_Psithaca/lib_delegate/test/dune index faa3114eceba4dc467d0123abe06c4a91e896e04..2d6d86e638552368667ae1c24bf94cd1745ecdb9 100644 --- a/src/proto_012_Psithaca/lib_delegate/test/dune +++ b/src/proto_012_Psithaca/lib_delegate/test/dune @@ -8,7 +8,6 @@ tezos-micheline tezos-client-012-Psithaca tezos-protocol-012-Psithaca - tezos-protocol-012-Psithaca.environment tezos-base-test-helpers tezos-baking-012-Psithaca.mockup-simulator tezos-baking-012-Psithaca @@ -23,7 +22,6 @@ -open Tezos_micheline -open Tezos_client_012_Psithaca -open Tezos_protocol_012_Psithaca - -open Tezos_protocol_environment_012_Psithaca -open Tezos_base_test_helpers -open Tezos_012_Psithaca_mockup_simulator -open Tezos_baking_012_Psithaca)) diff --git a/src/proto_012_Psithaca/lib_plugin/test/dune b/src/proto_012_Psithaca/lib_plugin/test/dune index ddd216c1640d626fa85426cad8f313a71adb28ed..5ac2e496fba4cca3f35ef1e1ef5c12b20ba8b263 100644 --- a/src/proto_012_Psithaca/lib_plugin/test/dune +++ b/src/proto_012_Psithaca/lib_plugin/test/dune @@ -12,7 +12,6 @@ tezos-stdlib-unix tezos-micheline tezos-protocol-plugin-012-Psithaca - tezos-protocol-012-Psithaca.environment tezos-protocol-012-Psithaca tezos-protocol-012-Psithaca.parameters tezos-012-Psithaca-test-helpers) @@ -23,7 +22,6 @@ -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_012_Psithaca - -open Tezos_protocol_environment_012_Psithaca -open Tezos_protocol_012_Psithaca -open Tezos_protocol_012_Psithaca.Protocol -open Tezos_protocol_012_Psithaca_parameters diff --git a/src/proto_012_Psithaca/lib_protocol/dune b/src/proto_012_Psithaca/lib_protocol/dune index 18e3ab22a4bdb8a6b5d2cc7a71aefb3b8bbc690c..e4dd44af0205b98ce53ca22b3ec3f0fd7a8adfa0 100644 --- a/src/proto_012_Psithaca/lib_protocol/dune +++ b/src/proto_012_Psithaca/lib_protocol/dune @@ -160,7 +160,7 @@ (:standard) -w -51 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_012_Psithaca)) (install (package tezos-protocol-012-Psithaca) @@ -172,7 +172,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_012_Psithaca.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_012_Psithaca\ninclude Tezos_raw_protocol_012_Psithaca.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A\"\nlet name = Tezos_protocol_environment_012_Psithaca.Environment.Name.name\ninclude Tezos_raw_protocol_012_Psithaca\ninclude Tezos_raw_protocol_012_Psithaca.Main\n"))) + +(rule + (targets tezos_protocol_012_Psithaca.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_012_Psithaca.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -298,8 +305,7 @@ (name tezos_protocol_012_Psithaca_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-012-Psithaca.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -51 diff --git a/src/proto_012_Psithaca/lib_protocol/test/helpers/dune b/src/proto_012_Psithaca/lib_protocol/test/helpers/dune index 43128051c6bd0631553ba227a6b1465e3ea1053b..d57be0bedaaa325f9810fc29d9bee75cce018a9a 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/helpers/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/helpers/dune @@ -17,7 +17,6 @@ tezos-protocol-012-Psithaca.parameters tezos-protocol-environment tezos-protocol-plugin-012-Psithaca - tezos-protocol-012-Psithaca.environment tezos-shell-services) (flags (:standard) @@ -28,5 +27,4 @@ -open Tezos_protocol_012_Psithaca -open Tezos_client_012_Psithaca -open Tezos_protocol_plugin_012_Psithaca - -open Tezos_protocol_environment_012_Psithaca -open Tezos_shell_services)) diff --git a/src/proto_012_Psithaca/lib_protocol/test/helpers/error_monad_operators.ml b/src/proto_012_Psithaca/lib_protocol/test/helpers/error_monad_operators.ml index 61eb43e4020acba617795a08b2562883917d96ae..4069cfa71371db77d3099b47f27285a8453752d8 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/helpers/error_monad_operators.ml +++ b/src/proto_012_Psithaca/lib_protocol/test/helpers/error_monad_operators.ml @@ -1,5 +1,3 @@ -open Protocol - let ( >>=?? ) x y = x >>= function | Ok s -> y s diff --git a/src/proto_012_Psithaca/lib_protocol/test/helpers/script_big_map.mli b/src/proto_012_Psithaca/lib_protocol/test/helpers/script_big_map.mli index d3875195820ab9f3caf9f2a7c105606417818cb3..d10ab478df61ce878d910d6b87909e7ca495b95b 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/helpers/script_big_map.mli +++ b/src/proto_012_Psithaca/lib_protocol/test/helpers/script_big_map.mli @@ -28,7 +28,7 @@ val update : ('key, 'value) Protocol.Script_typed_ir.big_map -> Protocol.Alpha_context.t -> (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) - Protocol.Environment.Error_monad.tzresult + Environment.Error_monad.tzresult Lwt.t (** Convert a list to a [Script_big_map]. If the list contains duplicate keys, @@ -40,5 +40,5 @@ val of_list : ('key * 'value) list -> Protocol.Alpha_context.t -> (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) - Protocol.Environment.Error_monad.tzresult + Environment.Error_monad.tzresult Lwt.t diff --git a/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/test_sapling.ml index 132ee9de62342ad7af3c118c1e4389520b42f67a..0e4bbc8a52fd4af2d7d46b6748a46f147fa7101e 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_012_Psithaca/lib_protocol/test/integration/michelson/test_sapling.ml @@ -760,7 +760,7 @@ module Interpreter_tests = struct List.exists (function | Environment.Ecoproto_error - (Tezos_raw_protocol_012_Psithaca.Script_tc_errors + (Tezos_protocol_012_Psithaca.Protocol.Script_tc_errors .Unexpected_forged_value _) -> true | _ -> false) diff --git a/src/proto_012_Psithaca/lib_protocol/test/unit/dune b/src/proto_012_Psithaca/lib_protocol/test/unit/dune index e5838098e220a5fa925e6eb9d6e50dedc72c4fec..2b705f0b192f112965220985361904bbf0a8fd0c 100644 --- a/src/proto_012_Psithaca/lib_protocol/test/unit/dune +++ b/src/proto_012_Psithaca/lib_protocol/test/unit/dune @@ -13,7 +13,6 @@ tezos-protocol-environment tezos-stdlib-unix tezos-protocol-012-Psithaca - tezos-protocol-012-Psithaca.environment tezos-012-Psithaca-test-helpers alcotest-lwt) (flags @@ -24,7 +23,6 @@ -open Tezos_micheline -open Tezos_client_012_Psithaca -open Tezos_protocol_012_Psithaca - -open Tezos_protocol_environment_012_Psithaca -open Tezos_012_Psithaca_test_helpers)) (rule diff --git a/src/proto_013_PtJakart/bin_tx_rollup_client/dune b/src/proto_013_PtJakart/bin_tx_rollup_client/dune index cf9430bf95d9888d5a50e3e6ea8c3a56eb0ba696..2040f0219fc25b3a616661336972e4780b75c5df 100644 --- a/src/proto_013_PtJakart/bin_tx_rollup_client/dune +++ b/src/proto_013_PtJakart/bin_tx_rollup_client/dune @@ -14,7 +14,6 @@ tezos-client-base-unix tezos-stdlib-unix tezos-tx-rollup-013-PtJakart - tezos-protocol-013-PtJakart.raw uri) (link_flags (:standard) @@ -24,9 +23,9 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_013_PtJakart + -open Tezos_protocol_013_PtJakart.Protocol -open Tezos_client_013_PtJakart -open Tezos_client_013_PtJakart_commands -open Tezos_client_base_unix -open Tezos_stdlib_unix - -open Tezos_tx_rollup_013_PtJakart - -open Tezos_raw_protocol_013_PtJakart)) + -open Tezos_tx_rollup_013_PtJakart)) diff --git a/src/proto_013_PtJakart/lib_benchmark/test/test_helpers.ml b/src/proto_013_PtJakart/lib_benchmark/test/test_helpers.ml index 189147add7336d0a7561cec601437660a4cbeeaa..3c972483b27581cddfffc6e35b1afe48d3d3fa52 100644 --- a/src/proto_013_PtJakart/lib_benchmark/test/test_helpers.ml +++ b/src/proto_013_PtJakart/lib_benchmark/test/test_helpers.ml @@ -85,5 +85,5 @@ let typecheck_by_tezos = ~legacy:false (Micheline.root node) bef - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun _ -> return_unit )) diff --git a/src/proto_013_PtJakart/lib_benchmarks_proto/dune b/src/proto_013_PtJakart/lib_benchmarks_proto/dune index cf8a353a83734385779fcdd619d1804f5820128d..502bf84fb185a1f204eda03e0145d44db457923f 100644 --- a/src/proto_013_PtJakart/lib_benchmarks_proto/dune +++ b/src/proto_013_PtJakart/lib_benchmarks_proto/dune @@ -15,7 +15,6 @@ tezos-benchmark-013-PtJakart tezos-benchmark-type-inference-013-PtJakart tezos-protocol-013-PtJakart - tezos-protocol-013-PtJakart.raw tezos-crypto tezos-shell-benchmarks tezos-micheline @@ -35,7 +34,7 @@ -open Tezos_benchmark_013_PtJakart -open Tezos_benchmark_type_inference_013_PtJakart -open Tezos_protocol_013_PtJakart - -open Tezos_raw_protocol_013_PtJakart + -open Tezos_protocol_013_PtJakart.Protocol -open Tezos_crypto -open Tezos_micheline -open Tezos_013_PtJakart_test_helpers diff --git a/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_benchmarks.ml index c1571830c6d48674bf2f31769a019ca10474e2b8..791175b702c4b736ab74d4a53445b562232d6e20 100644 --- a/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_benchmarks.ml @@ -96,7 +96,7 @@ module Apply_diff_bench : Benchmark.S = struct Lazy_storage_kind.Sapling_state.Id.parse_z state_id in Alpha_context.Sapling.(state_from_id ctxt external_state_id) - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (state, ctxt) -> Format.eprintf "state hash: %d@." (Hashtbl.hash state.diff) ; Format.eprintf diff --git a/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_generation.ml b/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_generation.ml index 15b69c5e1208a006878e2b7f4179f2d100f04d3c..4ae2852bb4e71fdcf0413e723ce94e04bbbfe7ff 100644 --- a/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_generation.ml +++ b/src/proto_013_PtJakart/lib_benchmarks_proto/sapling_generation.ml @@ -189,7 +189,7 @@ let rec add_root nb_root ctxt id vk index size diff state = add_input Protocol.Sapling_storage.empty_diff vk index size 0L state >>=? fun (diff_to_add, {position = size; _}, new_idx) -> Protocol.Sapling_storage.apply_diff ctxt id diff_to_add - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (ctxt, _) -> (* We call it nb_root -1 because one root is already present*) add_root @@ -296,7 +296,7 @@ let make_inputs to_forge local_state proving_ctx sk vk root anti_replay = to_forge let init_fresh_sapling_state ctxt = - let open Protocol.Environment.Error_monad in + let open Environment.Error_monad in Protocol.Lazy_storage_diff.fresh Protocol.Lazy_storage_kind.Sapling_state ~temporary:false @@ -323,7 +323,7 @@ let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) * Protocol.Lazy_storage_kind.Sapling_state.Id.t) tzresult Lwt.t = - init_fresh_sapling_state ctxt >|= Protocol.Environment.wrap_tzresult + init_fresh_sapling_state ctxt >|= Environment.wrap_tzresult >>=? fun (ctxt, id) -> let index_start = Tezos_sapling.Core.Client.Viewing_key.default_index in let sk, vk = generate_spending_and_viewing_keys state in @@ -336,8 +336,7 @@ let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) ~index:index_start state >>=? fun (diff, to_forge) -> - Protocol.Sapling_storage.apply_diff ctxt id diff - >|= Protocol.Environment.wrap_tzresult + Protocol.Sapling_storage.apply_diff ctxt id diff >|= Environment.wrap_tzresult >>=? fun (ctxt, _size) -> return (diff, to_forge, sk, vk, ctxt, id) let prepare_seeded_state @@ -561,6 +560,6 @@ let generate (save_to : string) (tx_count : int) match result with Ok txs -> save ~filename:save_to ~txs | Error _ -> () let apply_diff ctxt id diff = - let open Protocol.Environment.Error_monad in + let open Environment.Error_monad in Sapling_storage.apply_diff (alpha_to_raw ctxt) id diff >>=? fun (ctxt, size) -> return (raw_to_alpha ctxt, size) diff --git a/src/proto_013_PtJakart/lib_client/mockup.ml b/src/proto_013_PtJakart/lib_client/mockup.ml index bd5c848edf191f140aae436c51aa2dfe61d4d069..b4849201b12ce561914c010fec62c7cca8bf897b 100644 --- a/src/proto_013_PtJakart/lib_client/mockup.ml +++ b/src/proto_013_PtJakart/lib_client/mockup.ml @@ -1181,7 +1181,7 @@ type block = { hash : Block_hash.t; header : Block_header.t; operations : Operation.packed list; - context : Protocol.Environment.Context.t; + context : Environment.Context.t; } module Forge = struct @@ -1236,8 +1236,8 @@ let initial_context chain_id (header : Block_header.shell_header) add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> add ctxt ["protocol_parameters"] proto_params) >>= fun ctxt -> - Protocol.Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> - Protocol.Main.init ctxt header >|= Protocol.Environment.wrap_tzresult + Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> + Protocol.Main.init ctxt header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let ({ timestamp = predecessor_timestamp; @@ -1267,7 +1267,7 @@ let initial_context chain_id (header : Block_header.shell_header) ~predecessor_fitness ~predecessor ~timestamp - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun value_of_key -> (* In the mockup mode, reactivity is important and there are @@ -1279,7 +1279,7 @@ let initial_context chain_id (header : Block_header.shell_header) predecessor context `Lazy - (fun key -> value_of_key key >|= Protocol.Environment.wrap_tzresult) + (fun key -> value_of_key key >|= Environment.wrap_tzresult) >>=? fun context -> return context let mem_init : @@ -1431,8 +1431,8 @@ let migrate : let Tezos_protocol_environment.{block_hash; context; block_header} = rpc_context in - Protocol.Environment.Updater.activate context Protocol.hash >>= fun context -> - Protocol.Main.init context block_header >|= Protocol.Environment.wrap_tzresult + Environment.Updater.activate context Protocol.hash >>= fun context -> + Protocol.Main.init context block_header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let rpc_context = Tezos_protocol_environment.{block_hash; block_header; context} diff --git a/src/proto_013_PtJakart/lib_client/protocol_client_context.ml b/src/proto_013_PtJakart/lib_client/protocol_client_context.ml index 886d256b9c0b4369ea34a4d68bff7f789224b580..1c2cc7dc4a638aff6c539434d3bf5ae991d824e6 100644 --- a/src/proto_013_PtJakart/lib_client/protocol_client_context.ml +++ b/src/proto_013_PtJakart/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific procotol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_013_PtJakart/lib_client_sapling/dune b/src/proto_013_PtJakart/lib_client_sapling/dune index f44d1bd7425c4d4dfbd4db6d0c18392ebff76fc5..affedc828da4efbf9a18ad0307c83a405342061b 100644 --- a/src/proto_013_PtJakart/lib_client_sapling/dune +++ b/src/proto_013_PtJakart/lib_client_sapling/dune @@ -14,7 +14,6 @@ tezos-client-013-PtJakart tezos-client-013-PtJakart.commands tezos-protocol-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-protocol-plugin-013-PtJakart) (library_flags (:standard -linkall)) (flags @@ -26,5 +25,4 @@ -open Tezos_client_013_PtJakart -open Tezos_client_013_PtJakart_commands -open Tezos_protocol_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_protocol_plugin_013_PtJakart)) diff --git a/src/proto_013_PtJakart/lib_delegate/baking_scheduling.ml b/src/proto_013_PtJakart/lib_delegate/baking_scheduling.ml index 22e097f7ce24b6a92f8c85529b9f01567c775b26..52472819c5c1cc948856ac0294371640d0b25e47 100644 --- a/src/proto_013_PtJakart/lib_delegate/baking_scheduling.ml +++ b/src/proto_013_PtJakart/lib_delegate/baking_scheduling.ml @@ -359,7 +359,7 @@ let compute_next_potential_baking_time_at_next_level state = possibly means the baker has been late. *) (if Time.Protocol.(now < min_possible_time) then ok Round.zero else - Protocol.Environment.wrap_tzresult + Environment.wrap_tzresult @@ Round.round_of_timestamp round_durations ~predecessor_timestamp @@ -582,7 +582,7 @@ let create_round_durations constants = let delay_increment_per_round = constants.parametric.delay_increment_per_round in - Protocol.Environment.wrap_tzresult + Environment.wrap_tzresult (Round.Durations.create ~first_round_duration ~delay_increment_per_round) let create_initial_state cctxt ?(synchronize = true) ~chain config @@ -683,8 +683,7 @@ let compute_bootstrap_event state = else (* Otherwise, trigger the end of round to check whether we need to propose at this level or not *) - Protocol.Environment.wrap_tzresult - @@ Round.pred state.round_state.current_round + Environment.wrap_tzresult @@ Round.pred state.round_state.current_round >>? fun ending_round -> ok @@ Baking_state.Timeout (End_of_round {ending_round}) diff --git a/src/proto_013_PtJakart/lib_delegate/test/dune b/src/proto_013_PtJakart/lib_delegate/test/dune index 4760ea838d82c3bf74612408d7e81abc4555f70e..fa43175332ca962a5716d19a536be080c724883d 100644 --- a/src/proto_013_PtJakart/lib_delegate/test/dune +++ b/src/proto_013_PtJakart/lib_delegate/test/dune @@ -8,7 +8,6 @@ tezos-micheline tezos-client-013-PtJakart tezos-protocol-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-base-test-helpers tezos-baking-013-PtJakart.mockup-simulator tezos-baking-013-PtJakart @@ -23,7 +22,6 @@ -open Tezos_micheline -open Tezos_client_013_PtJakart -open Tezos_protocol_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_base_test_helpers -open Tezos_013_PtJakart_mockup_simulator -open Tezos_baking_013_PtJakart)) diff --git a/src/proto_013_PtJakart/lib_injector/dune b/src/proto_013_PtJakart/lib_injector/dune index 3d92746595bbf1c6f0231ecda1660c2be640d926..89e798a35dd6e53ed853872d1345cf7225dc935e 100644 --- a/src/proto_013_PtJakart/lib_injector/dune +++ b/src/proto_013_PtJakart/lib_injector/dune @@ -9,7 +9,6 @@ tezos-base tezos-crypto tezos-protocol-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-micheline tezos-client-013-PtJakart tezos-client-base @@ -25,7 +24,6 @@ -open Tezos_base -open Tezos_crypto -open Tezos_protocol_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_micheline -open Tezos_client_013_PtJakart -open Tezos_client_base diff --git a/src/proto_013_PtJakart/lib_plugin/test/dune b/src/proto_013_PtJakart/lib_plugin/test/dune index b7ed56e2ab4e7b15f9dad142a25df28785cc8150..b2b2b3904dc1a8f57afc2915881284b740975c8a 100644 --- a/src/proto_013_PtJakart/lib_plugin/test/dune +++ b/src/proto_013_PtJakart/lib_plugin/test/dune @@ -13,7 +13,6 @@ tezos-stdlib-unix tezos-micheline tezos-protocol-plugin-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-protocol-013-PtJakart tezos-protocol-013-PtJakart.parameters tezos-013-PtJakart-test-helpers) @@ -24,7 +23,6 @@ -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_protocol_013_PtJakart -open Tezos_protocol_013_PtJakart.Protocol -open Tezos_protocol_013_PtJakart_parameters diff --git a/src/proto_013_PtJakart/lib_protocol/dune b/src/proto_013_PtJakart/lib_protocol/dune index 46802dc360d8f211d87a1db4031cf0a1f80c16a8..81f44e87c6082ef4ba51e13d33d09c0477f8afb6 100644 --- a/src/proto_013_PtJakart/lib_protocol/dune +++ b/src/proto_013_PtJakart/lib_protocol/dune @@ -225,7 +225,7 @@ (:standard) -w -51 -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_013_PtJakart)) (install (package tezos-protocol-013-PtJakart) @@ -237,7 +237,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_013_PtJakart.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_013_PtJakart\ninclude Tezos_raw_protocol_013_PtJakart.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY\"\nlet name = Tezos_protocol_environment_013_PtJakart.Environment.Name.name\ninclude Tezos_raw_protocol_013_PtJakart\ninclude Tezos_raw_protocol_013_PtJakart.Main\n"))) + +(rule + (targets tezos_protocol_013_PtJakart.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_013_PtJakart.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -429,8 +436,7 @@ (name tezos_protocol_013_PtJakart_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-013-PtJakart.raw) + tezos-protocol-environment.sigs) (flags (:standard) -w -51 diff --git a/src/proto_013_PtJakart/lib_protocol/test/helpers/dune b/src/proto_013_PtJakart/lib_protocol/test/helpers/dune index 72aaee09a31e45c53e8abf4ee2d17ac83b9b475b..27e9f1afd3575e1679274232aabc27cc343391a7 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/helpers/dune +++ b/src/proto_013_PtJakart/lib_protocol/test/helpers/dune @@ -17,7 +17,6 @@ tezos-protocol-013-PtJakart.parameters tezos-protocol-environment tezos-protocol-plugin-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-shell-services) (flags (:standard) @@ -28,5 +27,4 @@ -open Tezos_protocol_013_PtJakart -open Tezos_client_013_PtJakart -open Tezos_protocol_plugin_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_shell_services)) diff --git a/src/proto_013_PtJakart/lib_protocol/test/helpers/error_monad_operators.ml b/src/proto_013_PtJakart/lib_protocol/test/helpers/error_monad_operators.ml index 61eb43e4020acba617795a08b2562883917d96ae..4069cfa71371db77d3099b47f27285a8453752d8 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/helpers/error_monad_operators.ml +++ b/src/proto_013_PtJakart/lib_protocol/test/helpers/error_monad_operators.ml @@ -1,5 +1,3 @@ -open Protocol - let ( >>=?? ) x y = x >>= function | Ok s -> y s diff --git a/src/proto_013_PtJakart/lib_protocol/test/helpers/script_big_map.mli b/src/proto_013_PtJakart/lib_protocol/test/helpers/script_big_map.mli index 29e7738520c337d9620a42145f1bf593c027d80f..0a6bcc4d51ade0f8ba124118e20258f77fbf9577 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/helpers/script_big_map.mli +++ b/src/proto_013_PtJakart/lib_protocol/test/helpers/script_big_map.mli @@ -28,7 +28,7 @@ val update : ('key, 'value) Protocol.Script_typed_ir.big_map -> Protocol.Alpha_context.t -> (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) - Protocol.Environment.Error_monad.tzresult + Environment.Error_monad.tzresult Lwt.t (** Convert a list to a [Script_big_map]. If the list contains duplicate keys, @@ -40,5 +40,5 @@ val of_list : ('key * 'value) list -> Protocol.Alpha_context.t -> (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) - Protocol.Environment.Error_monad.tzresult + Environment.Error_monad.tzresult Lwt.t diff --git a/src/proto_013_PtJakart/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_013_PtJakart/lib_protocol/test/integration/michelson/test_sapling.ml index f22fb8c0f05991c8959a92e5cfa919607f07fcf3..e8bf27f8a7f6ca692acf2a9f051c2038174f9666 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_013_PtJakart/lib_protocol/test/integration/michelson/test_sapling.ml @@ -840,7 +840,7 @@ module Interpreter_tests = struct List.exists (function | Environment.Ecoproto_error - (Tezos_raw_protocol_013_PtJakart.Script_tc_errors + (Tezos_protocol_013_PtJakart.Protocol.Script_tc_errors .Unexpected_forged_value _) -> true | _ -> false) diff --git a/src/proto_013_PtJakart/lib_protocol/test/pbt/test_bitset.ml b/src/proto_013_PtJakart/lib_protocol/test/pbt/test_bitset.ml index 56c84b4d69446b0c3f695222ab7272a51645ec45..641838f8cf9f2f1cd0affa277578553956f91316 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_013_PtJakart/lib_protocol/test/pbt/test_bitset.ml @@ -48,7 +48,7 @@ let gen_storage = | Error e -> Alcotest.failf "An unxpected error %a occurred when generating Bitset.t" - Protocol.Environment.Error_monad.pp_trace + Environment.Error_monad.pp_trace e let test_get_set (c, ofs) = @@ -65,7 +65,7 @@ let test_get_set (c, ofs) = | Error e -> Alcotest.failf "Unexpected error: %a" - Protocol.Environment.Error_monad.pp_trace + Environment.Error_monad.pp_trace e | Ok res -> res) (0 -- 63) diff --git a/src/proto_013_PtJakart/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_013_PtJakart/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index e460ebb3469d75126ce86f818610cef1249f91e2..f566d4d55566cfa250646dfd06c932100969adce 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_013_PtJakart/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -149,7 +149,7 @@ let v1_batch = tests here as the bytes length stays the same. *) let bytes = Bls12_381.G2.(to_compressed_bytes (random ())) in let aggregated_signature = - Protocol.Environment.Bls_signature.unsafe_signature_of_bytes bytes + Environment.Bls_signature.unsafe_signature_of_bytes bytes in V1.{aggregated_signature; contents} diff --git a/src/proto_013_PtJakart/lib_protocol/test/unit/dune b/src/proto_013_PtJakart/lib_protocol/test/unit/dune index 5ee97703d133e8b2b269d7fe7596fdd67fd81f9d..830504a9979ad47242a5ad0584c6d208d1d49864 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/unit/dune +++ b/src/proto_013_PtJakart/lib_protocol/test/unit/dune @@ -13,7 +13,6 @@ tezos-protocol-environment tezos-stdlib-unix tezos-protocol-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-013-PtJakart-test-helpers alcotest-lwt tezos-stdlib) @@ -25,7 +24,6 @@ -open Tezos_micheline -open Tezos_client_013_PtJakart -open Tezos_protocol_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_013_PtJakart_test_helpers -open Tezos_stdlib)) diff --git a/src/proto_013_PtJakart/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_013_PtJakart/lib_protocol/test/unit/test_merkle_list.ml index ff70a153fba787858eb2de4bace61c6628eafdae..207692cf643b2ae3536701193ee84e5b2a113799 100644 --- a/src/proto_013_PtJakart/lib_protocol/test/unit/test_merkle_list.ml +++ b/src/proto_013_PtJakart/lib_protocol/test/unit/test_merkle_list.ml @@ -31,7 +31,6 @@ Subject: test the ad-hoc merkle tree structure implemented to encode lists *) -open Protocol open Merkle_list_helper let assert_invalid_pos : 'a Environment.Error_monad.tzresult -> _ = function diff --git a/src/proto_013_PtJakart/lib_tx_rollup/daemon.ml b/src/proto_013_PtJakart/lib_tx_rollup/daemon.ml index d41a8603c9403a3bb99505186162b93cd9e38645..8f6ab58e4a12729239d9cfb81e3bc291afd43c80 100644 --- a/src/proto_013_PtJakart/lib_tx_rollup/daemon.ml +++ b/src/proto_013_PtJakart/lib_tx_rollup/daemon.ml @@ -49,7 +49,6 @@ let parse_tx_rollup_l2_address : error (Error.Tx_rollup_invalid_l2_address loc) let parse_ticketer : Script.node -> Contract.t tzresult = - let open Protocol in let open Micheline in function | Bytes (_loc, bytes) (* As unparsed with [Optimized]. *) -> diff --git a/src/proto_013_PtJakart/lib_tx_rollup/dune b/src/proto_013_PtJakart/lib_tx_rollup/dune index 9b80e9e2875b6129a9714b64a7484ecfda61c699..babae59d36a8b5bbfe773856e3c6917e8b56e6b9 100644 --- a/src/proto_013_PtJakart/lib_tx_rollup/dune +++ b/src/proto_013_PtJakart/lib_tx_rollup/dune @@ -10,7 +10,6 @@ tezos-base tezos-crypto tezos-protocol-013-PtJakart - tezos-protocol-013-PtJakart.environment tezos-client-013-PtJakart tezos-client-commands tezos-context.encoding @@ -38,7 +37,6 @@ -open Tezos_base -open Tezos_crypto -open Tezos_protocol_013_PtJakart - -open Tezos_protocol_environment_013_PtJakart -open Tezos_client_013_PtJakart -open Tezos_client_commands -open Tezos_baking_013_PtJakart_commands diff --git a/src/proto_alpha/bin_tx_rollup_client/dune b/src/proto_alpha/bin_tx_rollup_client/dune index 689f1653b61ed14d5617c2afd083f7de982bf78a..a6993f75fc9e227d7363d783f98fdfad3f0f5ccf 100644 --- a/src/proto_alpha/bin_tx_rollup_client/dune +++ b/src/proto_alpha/bin_tx_rollup_client/dune @@ -14,7 +14,6 @@ tezos-client-base-unix tezos-stdlib-unix tezos-tx-rollup-alpha - tezos-protocol-alpha.raw uri) (link_flags (:standard) @@ -24,9 +23,9 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha + -open Tezos_protocol_alpha.Protocol -open Tezos_client_alpha -open Tezos_client_alpha_commands -open Tezos_client_base_unix -open Tezos_stdlib_unix - -open Tezos_tx_rollup_alpha - -open Tezos_raw_protocol_alpha)) + -open Tezos_tx_rollup_alpha)) diff --git a/src/proto_alpha/lib_benchmark/test/test_helpers.ml b/src/proto_alpha/lib_benchmark/test/test_helpers.ml index 5baf5e4ce0fdc8e2f7ba03ea173ee225a1a1f9de..27cafed554977682b96e3155f5122bed91e85872 100644 --- a/src/proto_alpha/lib_benchmark/test/test_helpers.ml +++ b/src/proto_alpha/lib_benchmark/test/test_helpers.ml @@ -86,5 +86,5 @@ let typecheck_by_tezos = ~legacy:false (Micheline.root node) bef - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun _ -> return_unit )) diff --git a/src/proto_alpha/lib_benchmarks_proto/dune b/src/proto_alpha/lib_benchmarks_proto/dune index 7de0ac3e8dd77c1b2cd946b31952c10776cb6e48..f31b8568ca1449c8d6c9d7b685862d7c05f7eaa6 100644 --- a/src/proto_alpha/lib_benchmarks_proto/dune +++ b/src/proto_alpha/lib_benchmarks_proto/dune @@ -15,7 +15,6 @@ tezos-benchmark-alpha tezos-benchmark-type-inference-alpha tezos-protocol-alpha - tezos-protocol-alpha.raw tezos-crypto tezos-shell-benchmarks tezos-micheline @@ -35,7 +34,7 @@ -open Tezos_benchmark_alpha -open Tezos_benchmark_type_inference_alpha -open Tezos_protocol_alpha - -open Tezos_raw_protocol_alpha + -open Tezos_protocol_alpha.Protocol -open Tezos_crypto -open Tezos_micheline -open Tezos_alpha_test_helpers diff --git a/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml index d71f34e633ee5d8c9dc6be52b52f7477e97e1885..d5885eeebb4ef6c2453451ab5755f60bfcd2e176 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sapling_benchmarks.ml @@ -96,7 +96,7 @@ module Apply_diff_bench : Benchmark.S = struct Lazy_storage_kind.Sapling_state.Id.parse_z state_id in Alpha_context.Sapling.(state_from_id ctxt external_state_id) - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (state, ctxt) -> Format.eprintf "state hash: %d@." (Hashtbl.hash state.diff) ; Format.eprintf diff --git a/src/proto_alpha/lib_benchmarks_proto/sapling_generation.ml b/src/proto_alpha/lib_benchmarks_proto/sapling_generation.ml index bbcfabd52ec0f1de02c18845619a442fa7f63312..9c2766e22a2f372a99df6ca4b00495ee4d3db4e5 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sapling_generation.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sapling_generation.ml @@ -191,7 +191,7 @@ let rec add_root nb_root ctxt id vk index size diff state = add_input Protocol.Sapling_storage.empty_diff vk index size 0L state >>=? fun (diff_to_add, {position = size; _}, new_idx) -> Protocol.Sapling_storage.apply_diff ctxt id diff_to_add - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (ctxt, _) -> (* We call it nb_root -1 because one root is already present*) add_root @@ -298,7 +298,7 @@ let make_inputs to_forge local_state proving_ctx sk vk root anti_replay = to_forge let init_fresh_sapling_state ctxt = - let open Protocol.Environment.Error_monad in + let open Environment.Error_monad in Protocol.Lazy_storage_diff.fresh Protocol.Lazy_storage_kind.Sapling_state ~temporary:false @@ -325,7 +325,7 @@ let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) * Protocol.Lazy_storage_kind.Sapling_state.Id.t) tzresult Lwt.t = - init_fresh_sapling_state ctxt >|= Protocol.Environment.wrap_tzresult + init_fresh_sapling_state ctxt >|= Environment.wrap_tzresult >>=? fun (ctxt, id) -> let index_start = Tezos_sapling.Core.Client.Viewing_key.default_index in let sk, vk = generate_spending_and_viewing_keys state in @@ -339,7 +339,7 @@ let prepare_seeded_state_internal ~(nb_input : int) ~(nb_nf : int) state >>=? fun (diff, to_forge) -> Protocol.Sapling_storage.apply_diff ctxt id (reverse diff) - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun (ctxt, _size) -> return (diff, to_forge, sk, vk, ctxt, id) let prepare_seeded_state @@ -583,6 +583,6 @@ let generate (save_to : string) (tx_count : int) match result with Ok txs -> save ~filename:save_to ~txs | Error _ -> () let apply_diff ctxt id diff = - let open Protocol.Environment.Error_monad in + let open Environment.Error_monad in Sapling_storage.apply_diff (alpha_to_raw ctxt) id diff >>=? fun (ctxt, size) -> return (raw_to_alpha ctxt, size) diff --git a/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml index 6afea8f679e9aa47584700529ebd418fb76535df..b32c2bc9d0e1eb4827aaa586168271831a781eac 100644 --- a/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -182,7 +182,7 @@ end module Irmin_context = Tezos_context_memory.Context_binary -exception Error of Protocol.Environment.Error_monad.error +exception Error of Environment.Error_monad.error module Prover_storage : Tx_rollup_l2_storage_sig.STORAGE diff --git a/src/proto_alpha/lib_client/mockup.ml b/src/proto_alpha/lib_client/mockup.ml index 77d712cb1b866a81055f92a1629d05398a05ac73..ec022f0cc1f663140e53af68c2c4f12874622bc4 100644 --- a/src/proto_alpha/lib_client/mockup.ml +++ b/src/proto_alpha/lib_client/mockup.ml @@ -1360,7 +1360,7 @@ type block = { hash : Block_hash.t; header : Block_header.t; operations : Operation.packed list; - context : Protocol.Environment.Context.t; + context : Environment.Context.t; } module Forge = struct @@ -1415,8 +1415,8 @@ let initial_context chain_id (header : Block_header.shell_header) add empty ["version"] (Bytes.of_string "genesis") >>= fun ctxt -> add ctxt ["protocol_parameters"] proto_params) >>= fun ctxt -> - Protocol.Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> - Protocol.Main.init chain_id ctxt header >|= Protocol.Environment.wrap_tzresult + Environment.Updater.activate ctxt Protocol.hash >>= fun ctxt -> + Protocol.Main.init chain_id ctxt header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let ({ timestamp = predecessor_timestamp; @@ -1446,7 +1446,7 @@ let initial_context chain_id (header : Block_header.shell_header) ~predecessor_fitness ~predecessor ~timestamp - >|= Protocol.Environment.wrap_tzresult + >|= Environment.wrap_tzresult >>=? fun value_of_key -> (* In the mockup mode, reactivity is important and there are @@ -1458,7 +1458,7 @@ let initial_context chain_id (header : Block_header.shell_header) predecessor context `Lazy - (fun key -> value_of_key key >|= Protocol.Environment.wrap_tzresult) + (fun key -> value_of_key key >|= Environment.wrap_tzresult) >>=? fun context -> return context let mem_init : @@ -1610,9 +1610,8 @@ let migrate : let Tezos_protocol_environment.{block_hash; context; block_header} = rpc_context in - Protocol.Environment.Updater.activate context Protocol.hash >>= fun context -> - Protocol.Main.init chain context block_header - >|= Protocol.Environment.wrap_tzresult + Environment.Updater.activate context Protocol.hash >>= fun context -> + Protocol.Main.init chain context block_header >|= Environment.wrap_tzresult >>=? fun {context; _} -> let rpc_context = Tezos_protocol_environment.{block_hash; block_header; context} diff --git a/src/proto_alpha/lib_client/protocol_client_context.ml b/src/proto_alpha/lib_client/protocol_client_context.ml index e745abd0afd8fdf901a5a3bfb00d228d50a14584..be5745a532e86d56822509833c9cb38505ead052 100644 --- a/src/proto_alpha/lib_client/protocol_client_context.ml +++ b/src/proto_alpha/lib_client/protocol_client_context.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end @@ -38,8 +38,7 @@ class type rpc_context = inherit RPC_context.generic inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -76,8 +75,7 @@ class wrap_rpc_context (t : RPC_context.generic) : rpc_context = (** Abstracts variables and in protocol RPCs prefixed by "/chains//blocks//...". *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end @@ -98,15 +96,13 @@ class type full = with the node. A client context is defined by mapping all RPCs protocol-generic to a specific protocol. *) inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple (** Protocol RPCs exposed through the environment (using an additional chainpath). *) inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context end (** From a [Client_context.full], the class allows to call RPCs from @@ -116,8 +112,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_alpha/lib_client_sapling/dune b/src/proto_alpha/lib_client_sapling/dune index 5d714cd77fd814b50391474dd388c7b7dc0f1864..29bac8436d1add7e4afd7bae92baabe56fdd3f29 100644 --- a/src/proto_alpha/lib_client_sapling/dune +++ b/src/proto_alpha/lib_client_sapling/dune @@ -14,7 +14,6 @@ tezos-client-alpha tezos-client-alpha.commands tezos-protocol-alpha - tezos-protocol-alpha.environment tezos-protocol-plugin-alpha) (library_flags (:standard -linkall)) (flags @@ -26,5 +25,4 @@ -open Tezos_client_alpha -open Tezos_client_alpha_commands -open Tezos_protocol_alpha - -open Tezos_protocol_environment_alpha -open Tezos_protocol_plugin_alpha)) diff --git a/src/proto_alpha/lib_delegate/baking_scheduling.ml b/src/proto_alpha/lib_delegate/baking_scheduling.ml index 488d16c8457f253e9fa80d4a8267539562b4df80..38d42a06cc3df5e395c0c4bea0b847273fc490a0 100644 --- a/src/proto_alpha/lib_delegate/baking_scheduling.ml +++ b/src/proto_alpha/lib_delegate/baking_scheduling.ml @@ -357,7 +357,7 @@ let compute_next_potential_baking_time_at_next_level state = possibly means the baker has been late. *) (if Time.Protocol.(now < min_possible_time) then ok Round.zero else - Protocol.Environment.wrap_tzresult + Environment.wrap_tzresult @@ Round.round_of_timestamp round_durations ~predecessor_timestamp @@ -580,7 +580,7 @@ let create_round_durations constants = let delay_increment_per_round = constants.parametric.delay_increment_per_round in - Protocol.Environment.wrap_tzresult + Environment.wrap_tzresult (Round.Durations.create ~first_round_duration ~delay_increment_per_round) let create_initial_state cctxt ?(synchronize = true) ~chain config @@ -681,8 +681,7 @@ let compute_bootstrap_event state = else (* Otherwise, trigger the end of round to check whether we need to propose at this level or not *) - Protocol.Environment.wrap_tzresult - @@ Round.pred state.round_state.current_round + Environment.wrap_tzresult @@ Round.pred state.round_state.current_round >>? fun ending_round -> ok @@ Baking_state.Timeout (End_of_round {ending_round}) diff --git a/src/proto_alpha/lib_delegate/test/dune b/src/proto_alpha/lib_delegate/test/dune index aa4bcd20c7fb8a824640576d223ec9d8a12aea6c..e2d734e974fb1cc65ae0314e23f00955baf63017 100644 --- a/src/proto_alpha/lib_delegate/test/dune +++ b/src/proto_alpha/lib_delegate/test/dune @@ -8,7 +8,6 @@ tezos-micheline tezos-client-alpha tezos-protocol-alpha - tezos-protocol-alpha.environment tezos-base-test-helpers tezos-baking-alpha.mockup-simulator tezos-baking-alpha @@ -23,7 +22,6 @@ -open Tezos_micheline -open Tezos_client_alpha -open Tezos_protocol_alpha - -open Tezos_protocol_environment_alpha -open Tezos_base_test_helpers -open Tezos_alpha_mockup_simulator -open Tezos_baking_alpha)) diff --git a/src/proto_alpha/lib_injector/dune b/src/proto_alpha/lib_injector/dune index 096b822a7a88d7dad64eb9c52e0a0a18e740cb28..2e54e3ea214fa702125c0f61d4238536049ee906 100644 --- a/src/proto_alpha/lib_injector/dune +++ b/src/proto_alpha/lib_injector/dune @@ -9,7 +9,6 @@ tezos-base tezos-crypto tezos-protocol-alpha - tezos-protocol-alpha.environment tezos-micheline tezos-client-alpha tezos-client-base @@ -25,7 +24,6 @@ -open Tezos_base -open Tezos_crypto -open Tezos_protocol_alpha - -open Tezos_protocol_environment_alpha -open Tezos_micheline -open Tezos_client_alpha -open Tezos_client_base diff --git a/src/proto_alpha/lib_plugin/plugin_errors.ml b/src/proto_alpha/lib_plugin/plugin_errors.ml index 0b8881215a28d3471d859a1917dc4ccfaccdf306..61179616fdd3160cfe251fc3f8f3d100f097534d 100644 --- a/src/proto_alpha/lib_plugin/plugin_errors.ml +++ b/src/proto_alpha/lib_plugin/plugin_errors.ml @@ -25,8 +25,6 @@ (* *) (*****************************************************************************) -open Protocol - type Environment.Error_monad.error += Cannot_parse_operation (* `Branch *) type Environment.Error_monad.error += Cannot_serialize_log diff --git a/src/proto_alpha/lib_plugin/test/dune b/src/proto_alpha/lib_plugin/test/dune index 234101ef4fa274f8663d838f10f35b5ef0d415e6..8217d9534bc0ed5f9d60f5e9c2979d6c9f849691 100644 --- a/src/proto_alpha/lib_plugin/test/dune +++ b/src/proto_alpha/lib_plugin/test/dune @@ -13,7 +13,6 @@ tezos-stdlib-unix tezos-micheline tezos-protocol-plugin-alpha - tezos-protocol-alpha.environment tezos-protocol-alpha tezos-protocol-alpha.parameters tezos-alpha-test-helpers) @@ -24,7 +23,6 @@ -open Tezos_base_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_environment_alpha -open Tezos_protocol_alpha -open Tezos_protocol_alpha.Protocol -open Tezos_protocol_alpha_parameters diff --git a/src/proto_alpha/lib_protocol/dune b/src/proto_alpha/lib_protocol/dune index a14172d55b10fa99320b5eb609d5856faadc1de8..07ebb2fc5bf117f709e339b4a3e20aed7d14c10f 100644 --- a/src/proto_alpha/lib_protocol/dune +++ b/src/proto_alpha/lib_protocol/dune @@ -249,7 +249,7 @@ (flags (:standard) -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_alpha)) (install (package tezos-protocol-alpha) @@ -261,7 +261,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_alpha.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_alpha\ninclude Tezos_raw_protocol_alpha.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK\"\nlet name = Tezos_protocol_environment_alpha.Environment.Name.name\ninclude Tezos_raw_protocol_alpha\ninclude Tezos_raw_protocol_alpha.Main\n"))) + +(rule + (targets tezos_protocol_alpha.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_alpha.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -480,8 +487,7 @@ (name tezos_protocol_alpha_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-alpha.raw) + tezos-protocol-environment.sigs) (flags (:standard) -nopervasives) diff --git a/src/proto_alpha/lib_protocol/test/helpers/dune b/src/proto_alpha/lib_protocol/test/helpers/dune index c8393950cf91134e7abcba9676063973b7240efc..5fa328d81a1cd8f4b9337929da57f35f0f4d166e 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/dune +++ b/src/proto_alpha/lib_protocol/test/helpers/dune @@ -17,7 +17,6 @@ tezos-protocol-alpha.parameters tezos-protocol-environment tezos-protocol-plugin-alpha - tezos-protocol-alpha.environment tezos-shell-services) (flags (:standard) @@ -28,5 +27,4 @@ -open Tezos_protocol_alpha -open Tezos_client_alpha -open Tezos_protocol_plugin_alpha - -open Tezos_protocol_environment_alpha -open Tezos_shell_services)) diff --git a/src/proto_alpha/lib_protocol/test/helpers/error_monad_operators.ml b/src/proto_alpha/lib_protocol/test/helpers/error_monad_operators.ml index 7dd424c4c9a7b910b8636c8110083aa63d268c26..9157c0b35a258b7697facdddec467cd30b0dd7e2 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/error_monad_operators.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/error_monad_operators.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Protocol - let ( >>=?? ) x y = x >>= function | Ok s -> y s diff --git a/src/proto_alpha/lib_protocol/test/helpers/script_big_map.mli b/src/proto_alpha/lib_protocol/test/helpers/script_big_map.mli index 29e7738520c337d9620a42145f1bf593c027d80f..0a6bcc4d51ade0f8ba124118e20258f77fbf9577 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/script_big_map.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/script_big_map.mli @@ -28,7 +28,7 @@ val update : ('key, 'value) Protocol.Script_typed_ir.big_map -> Protocol.Alpha_context.t -> (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) - Protocol.Environment.Error_monad.tzresult + Environment.Error_monad.tzresult Lwt.t (** Convert a list to a [Script_big_map]. If the list contains duplicate keys, @@ -40,5 +40,5 @@ val of_list : ('key * 'value) list -> Protocol.Alpha_context.t -> (('key, 'value) Protocol.Script_typed_ir.big_map * Protocol.Alpha_context.t) - Protocol.Environment.Error_monad.tzresult + Environment.Error_monad.tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml index df7bf0f1908f31e6da0f5e10de6d33598155b913..134109df095bb2e2005bf4dffe0b3720d325f189 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml @@ -848,7 +848,7 @@ module Interpreter_tests = struct List.exists (function | Environment.Ecoproto_error - (Tezos_raw_protocol_alpha.Script_tc_errors + (Tezos_protocol_alpha.Protocol.Script_tc_errors .Unexpected_forged_value _) -> true | _ -> false) diff --git a/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml index 6959af79539a2cb75cbad67eb200dbf8c29400e1..0a31ad4390d62d620a6884e2c9725e77a5eaf8fa 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_sc_rollup_wasm.ml @@ -38,7 +38,7 @@ open Alpha_context module Context_binary = Tezos_context_memory.Context_binary module Tree : - Protocol.Environment.Context.TREE + Environment.Context.TREE with type t = Context_binary.t and type tree = Context_binary.tree and type key = string list diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml b/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml index 56c84b4d69446b0c3f695222ab7272a51645ec45..641838f8cf9f2f1cd0affa277578553956f91316 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml @@ -48,7 +48,7 @@ let gen_storage = | Error e -> Alcotest.failf "An unxpected error %a occurred when generating Bitset.t" - Protocol.Environment.Error_monad.pp_trace + Environment.Error_monad.pp_trace e let test_get_set (c, ofs) = @@ -65,7 +65,7 @@ let test_get_set (c, ofs) = | Error e -> Alcotest.failf "Unexpected error: %a" - Protocol.Environment.Error_monad.pp_trace + Environment.Error_monad.pp_trace e | Ok res -> res) (0 -- 63) diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index 99e3a4eaedcd341e3d63230c514be2d206c7e4bb..19adadbc3a57f29a8660be9d66f35abacf0a1189 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -146,7 +146,7 @@ let v1_batch = tests here as the bytes length stays the same. *) let bytes = Bls12_381.G2.(to_compressed_bytes (random ())) in let aggregated_signature = - Protocol.Environment.Bls_signature.unsafe_signature_of_bytes bytes + Environment.Bls_signature.unsafe_signature_of_bytes bytes in V1.{aggregated_signature; contents} diff --git a/src/proto_alpha/lib_protocol/test/unit/dune b/src/proto_alpha/lib_protocol/test/unit/dune index 6e3bae54db29c285bec0408e24f64b5f6e024ac0..b840f665aa6983504614d10fe9e4224f0562b022 100644 --- a/src/proto_alpha/lib_protocol/test/unit/dune +++ b/src/proto_alpha/lib_protocol/test/unit/dune @@ -13,7 +13,6 @@ tezos-protocol-environment tezos-stdlib-unix tezos-protocol-alpha - tezos-protocol-alpha.environment tezos-alpha-test-helpers alcotest-lwt tezos-stdlib) @@ -25,7 +24,6 @@ -open Tezos_micheline -open Tezos_client_alpha -open Tezos_protocol_alpha - -open Tezos_protocol_environment_alpha -open Tezos_alpha_test_helpers -open Tezos_stdlib)) diff --git a/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml index ff70a153fba787858eb2de4bace61c6628eafdae..207692cf643b2ae3536701193ee84e5b2a113799 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml @@ -31,7 +31,6 @@ Subject: test the ad-hoc merkle tree structure implemented to encode lists *) -open Protocol open Merkle_list_helper let assert_invalid_pos : 'a Environment.Error_monad.tzresult -> _ = function diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml index cfaaf9e6df6c651b0ae01953cba906a832d8fcec..af7ef4619671f046452113498bd4bc2de46276b3 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -36,7 +36,7 @@ module Context_binary = Tezos_context_memory.Context_binary (* We first instantiate an arithmetic PVM capable of generating proofs. *) module Tree : - Protocol.Environment.Context.TREE + Environment.Context.TREE with type t = Context_binary.t and type tree = Context_binary.tree and type key = string list diff --git a/src/proto_alpha/lib_tx_rollup/daemon.ml b/src/proto_alpha/lib_tx_rollup/daemon.ml index 3874d3085fd2b50cba888f257a0ffae1a3594d5d..c06ed081dc0086b20743f08755c0b6193c1b0da8 100644 --- a/src/proto_alpha/lib_tx_rollup/daemon.ml +++ b/src/proto_alpha/lib_tx_rollup/daemon.ml @@ -50,7 +50,6 @@ let parse_tx_rollup_l2_address : error (Error.Tx_rollup_invalid_l2_address loc) let parse_ticketer : Script.node -> Contract.t tzresult = - let open Protocol in let open Micheline in function | Bytes (_loc, bytes) (* As unparsed with [Optimized]. *) -> diff --git a/src/proto_alpha/lib_tx_rollup/dune b/src/proto_alpha/lib_tx_rollup/dune index eeab8dfb11f8a6adfb42fe0094af5d396ea5e72f..efe1688d81533c6a0d895a69d8ab84216f37ea67 100644 --- a/src/proto_alpha/lib_tx_rollup/dune +++ b/src/proto_alpha/lib_tx_rollup/dune @@ -10,7 +10,6 @@ tezos-base tezos-crypto tezos-protocol-alpha - tezos-protocol-alpha.environment tezos-client-alpha tezos-client-commands tezos-context.encoding @@ -38,7 +37,6 @@ -open Tezos_base -open Tezos_crypto -open Tezos_protocol_alpha - -open Tezos_protocol_environment_alpha -open Tezos_client_alpha -open Tezos_client_commands -open Tezos_baking_alpha_commands diff --git a/src/proto_demo_counter/lib_client/protocol_client_context.ml b/src/proto_demo_counter/lib_client/protocol_client_context.ml index 0341e5fd84313156373f4663a3a718a4ba77db4d..f3cb8228a41b682f2d3b15b7b7d7a3e4b38e439f 100644 --- a/src/proto_demo_counter/lib_client/protocol_client_context.ml +++ b/src/proto_demo_counter/lib_client/protocol_client_context.ml @@ -28,8 +28,7 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end @@ -38,8 +37,7 @@ class wrap_full (t : Client_context.full) : full = inherit Client_context.proxy_context t inherit - [Shell_services.chain, Shell_services.block] Protocol.Environment - .proto_rpc_context + [Shell_services.chain, Shell_services.block] Environment.proto_rpc_context (t :> RPC_context.t) Shell_services.Blocks.path end diff --git a/src/proto_demo_counter/lib_client/protocol_client_context.mli b/src/proto_demo_counter/lib_client/protocol_client_context.mli index c2e270fc137ca00095620431bd0459619663d431..70b26388e57d5673fb3fa3e0e799d5bad96a30bc 100644 --- a/src/proto_demo_counter/lib_client/protocol_client_context.mli +++ b/src/proto_demo_counter/lib_client/protocol_client_context.mli @@ -28,8 +28,7 @@ class type full = inherit Client_context.full inherit - [Shell_services.chain * Shell_services.block] Protocol.Environment - .RPC_context + [Shell_services.chain * Shell_services.block] Environment.RPC_context .simple end diff --git a/src/proto_demo_counter/lib_protocol/dune b/src/proto_demo_counter/lib_protocol/dune index cc1185e17d5eb8e6cb95a8517f1dfa18e459114a..2792a4894dd6c633470abde3f7faae3aacd717ba 100644 --- a/src/proto_demo_counter/lib_protocol/dune +++ b/src/proto_demo_counter/lib_protocol/dune @@ -53,7 +53,7 @@ (flags (:standard) -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_demo_counter)) (install (package tezos-protocol-demo-counter) @@ -65,7 +65,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_demo_counter.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoDemoCounterDemoCounterDemoCounterDemoCou4LSpdT\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_demo_counter\ninclude Tezos_raw_protocol_demo_counter.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoDemoCounterDemoCounterDemoCounterDemoCou4LSpdT\"\nlet name = Tezos_protocol_environment_demo_counter.Environment.Name.name\ninclude Tezos_raw_protocol_demo_counter\ninclude Tezos_raw_protocol_demo_counter.Main\n"))) + +(rule + (targets tezos_protocol_demo_counter.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_demo_counter.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -86,8 +93,7 @@ (name tezos_protocol_demo_counter_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-demo-counter.raw) + tezos-protocol-environment.sigs) (flags (:standard) -nopervasives) diff --git a/src/proto_demo_noops/lib_protocol/dune b/src/proto_demo_noops/lib_protocol/dune index d1dfb9af0a6b8f5b1fb2ba67c2b4c2ad41477840..350476206e836ec952b5b54e1848b216ef7ceaf8 100644 --- a/src/proto_demo_noops/lib_protocol/dune +++ b/src/proto_demo_noops/lib_protocol/dune @@ -44,7 +44,7 @@ (flags (:standard) -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_demo_noops)) (install (package tezos-protocol-demo-noops) @@ -56,7 +56,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_demo_noops.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_demo_noops\ninclude Tezos_raw_protocol_demo_noops.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp\"\nlet name = Tezos_protocol_environment_demo_noops.Environment.Name.name\ninclude Tezos_raw_protocol_demo_noops\ninclude Tezos_raw_protocol_demo_noops.Main\n"))) + +(rule + (targets tezos_protocol_demo_noops.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_demo_noops.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -67,8 +74,7 @@ (name tezos_protocol_demo_noops_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-demo-noops.raw) + tezos-protocol-environment.sigs) (flags (:standard) -nopervasives) diff --git a/src/proto_genesis/lib_client/protocol_client_context.ml b/src/proto_genesis/lib_client/protocol_client_context.ml index bb2058fddfc218e573fcf1052a85dd9f08407999..497124ef8148b8c54a667138b043717a8889af04 100644 --- a/src/proto_genesis/lib_client/protocol_client_context.ml +++ b/src/proto_genesis/lib_client/protocol_client_context.ml @@ -26,7 +26,7 @@ module Genesis_block_services = Block_services.Make (Protocol) (Protocol) module Lifted_protocol = struct - include Protocol.Environment.Lift (Protocol) + include Environment.Lift (Protocol) let hash = Protocol.hash end diff --git a/src/proto_genesis/lib_protocol/dune b/src/proto_genesis/lib_protocol/dune index d098d481f392805e57a24b2cec000599c2cde293..8dcdf53ca6b9092b2c91ba8837e94023df237be8 100644 --- a/src/proto_genesis/lib_protocol/dune +++ b/src/proto_genesis/lib_protocol/dune @@ -44,7 +44,7 @@ (flags (:standard) -nopervasives) - (modules Protocol)) + (modules Protocol Tezos_protocol_genesis)) (install (package tezos-protocol-genesis) @@ -56,7 +56,14 @@ (action (write-file %{targets} - "module Environment = Tezos_protocol_environment_genesis.Environment\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im\"\nlet name = Environment.Name.name\ninclude Tezos_raw_protocol_genesis\ninclude Tezos_raw_protocol_genesis.Main\n"))) + "\nlet hash = Tezos_crypto.Protocol_hash.of_b58check_exn \"ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im\"\nlet name = Tezos_protocol_environment_genesis.Environment.Name.name\ninclude Tezos_raw_protocol_genesis\ninclude Tezos_raw_protocol_genesis.Main\n"))) + +(rule + (targets tezos_protocol_genesis.ml) + (action + (write-file + %{targets} + "\nmodule Environment = Tezos_protocol_environment_genesis.Environment\nmodule Protocol = Protocol\n"))) (rule (alias runtest_compile_protocol) @@ -69,8 +76,7 @@ (name tezos_protocol_genesis_functor) (libraries tezos-protocol-environment - tezos-protocol-environment.sigs - tezos-protocol-genesis.raw) + tezos-protocol-environment.sigs) (flags (:standard) -nopervasives)