From 2e477ebb26361370f0984b0bc370259700148adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=83=C2=A9goire=20Henry?= Date: Fri, 27 Oct 2017 19:54:28 +0200 Subject: [PATCH] Rename `tezos_protocol_registerer.ml` --- src/Makefile | 2 +- src/Makefile.files | 6 +++--- .../{tezos_protocol_registerer.ml => registerer.ml} | 1 + .../{tezos_protocol_registerer.mli => registerer.mli} | 0 src/compiler/tezos_compiler.ml | 4 ++-- src/compiler/tezos_compiler_embedded_cmis.mli | 2 +- src/node/shell/state.ml | 4 ++-- src/node/updater/updater.ml | 4 ++-- 8 files changed, 12 insertions(+), 11 deletions(-) rename src/compiler/{tezos_protocol_registerer.ml => registerer.ml} (99%) rename src/compiler/{tezos_protocol_registerer.mli => registerer.mli} (100%) diff --git a/src/Makefile b/src/Makefile index 29a09f57d..3e312bf1e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -57,7 +57,7 @@ ${COMPILER_OBJS}: SOURCE_DIRECTORIES=${COMPILER_SOURCE_DIRECTORIES} ${COMPILER_OBJS}: TARGET="(compiler.cmxa)" ${COMPILER_OBJS}: OPENED_MODULES=${COMPILER_OPENED_MODULES} -compiler/tezos_protocol_registerer.cmi: EXTRA_OCAMLFLAGS = -opaque +compiler/registerer.cmi: EXTRA_OCAMLFLAGS = -opaque .INTERMEDIATE: compiler/tezos_compiler_embedded_cmis.ml compiler/tezos_compiler_embedded_cmis.cmx: compiler/tezos_compiler_embedded_cmis.cmi diff --git a/src/Makefile.files b/src/Makefile.files index 7e2fd7036..1dca8bde5 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -152,20 +152,20 @@ $(shell ocamlfind query stdlib)/camlinternalFormatBasics.cmi: \ COMPILER_EMBEDDED_CMIS := \ $(shell ocamlfind query stdlib)/camlinternalFormatBasics.cmi \ ${PACKED_SIGS_V1}.cmi \ - compiler/tezos_protocol_registerer.cmi + compiler/registerer.cmi COMPILER_IMPLS := \ compiler_main.ml \ COMPILER_LIB_INTFS := \ compiler/tezos_compiler_embedded_cmis.mli \ - compiler/tezos_protocol_registerer.mli \ + compiler/registerer.mli \ compiler/packer.mli \ compiler/tezos_compiler.mli \ COMPILER_LIB_IMPLS := \ compiler/tezos_compiler_embedded_cmis.ml \ - compiler/tezos_protocol_registerer.ml \ + compiler/registerer.ml \ compiler/packer.ml \ compiler/tezos_compiler.ml \ diff --git a/src/compiler/tezos_protocol_registerer.ml b/src/compiler/registerer.ml similarity index 99% rename from src/compiler/tezos_protocol_registerer.ml rename to src/compiler/registerer.ml index aa7546b69..688902d96 100644 --- a/src/compiler/tezos_protocol_registerer.ml +++ b/src/compiler/registerer.ml @@ -25,3 +25,4 @@ let get_exn hash = VersionTable.find versions hash let get hash = try Some (get_exn hash) with Not_found -> None + diff --git a/src/compiler/tezos_protocol_registerer.mli b/src/compiler/registerer.mli similarity index 100% rename from src/compiler/tezos_protocol_registerer.mli rename to src/compiler/registerer.mli diff --git a/src/compiler/tezos_compiler.ml b/src/compiler/tezos_compiler.ml index 9689847d0..b603789eb 100644 --- a/src/compiler/tezos_compiler.ml +++ b/src/compiler/tezos_compiler.ml @@ -115,7 +115,7 @@ let tezos_protocol_env = let register_env = let open Tezos_compiler_embedded_cmis in [ - "Tezos_protocol_registerer", tezos_protocol_registerer_cmi ; + "registerer", registerer_cmi ; ] @@ -319,7 +319,7 @@ let main () = create_file register_file (Printf.sprintf "module Name = struct let name = %S end\n\ - \ let () = Tezos_protocol_registerer.register Name.name (module %s.Make)" + \ let () = Registerer.register Name.name (module %s.Make)" (Protocol_hash.to_b58check hash) functor_unit) ; let register_object = compile_ml ~for_pack register_file in diff --git a/src/compiler/tezos_compiler_embedded_cmis.mli b/src/compiler/tezos_compiler_embedded_cmis.mli index aa624839f..45088e5dc 100644 --- a/src/compiler/tezos_compiler_embedded_cmis.mli +++ b/src/compiler/tezos_compiler_embedded_cmis.mli @@ -9,4 +9,4 @@ val camlinternalFormatBasics_cmi: string val tezos_protocol_environment_sigs_v1_cmi: string -val tezos_protocol_registerer_cmi: string +val registerer_cmi: string diff --git a/src/node/shell/state.ml b/src/node/shell/state.ml index b3c31cd2e..e7be16f41 100644 --- a/src/node/shell/state.ml +++ b/src/node/shell/state.ml @@ -586,7 +586,7 @@ module Registred_protocol = struct end let build_v1 hash = - let (module F) = Tezos_protocol_registerer.get_exn hash in + let (module F) = Registerer.get_exn hash in let module Name = struct let name = Protocol_hash.to_b58check hash end in @@ -605,7 +605,7 @@ module Registred_protocol = struct VersionTable.create 20 let mem hash = - VersionTable.mem versions hash || Tezos_protocol_registerer.mem hash + VersionTable.mem versions hash || Registerer.mem hash let get_exn hash = try VersionTable.find versions hash diff --git a/src/node/updater/updater.ml b/src/node/updater/updater.ml index 54a14bb5b..0326a9087 100644 --- a/src/node/updater/updater.ml +++ b/src/node/updater/updater.ml @@ -101,11 +101,11 @@ let do_compile hash p = Lwt.return false let compile hash p = - if Tezos_protocol_registerer.mem hash then + if Registerer.mem hash then Lwt.return true else begin do_compile hash p >>= fun success -> - let loaded = Tezos_protocol_registerer.mem hash in + let loaded = Registerer.mem hash in if success && not loaded then log_error "Internal error while compiling %a" Protocol_hash.pp hash; Lwt.return loaded