From a9fcb4cb603d836f0b83c120bc2d1176d860ffc8 Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Fri, 29 Jul 2022 17:54:48 +0200 Subject: [PATCH] Proto: Rename a module which do not follow coding style guidelines --- .../lib_protocol/alpha_context.mli | 8 +++--- .../lib_protocol/sc_rollup_arith.ml | 6 ++-- .../lib_protocol/sc_rollup_arith.mli | 4 +-- .../lib_protocol/sc_rollup_wasm.ml | 6 ++-- .../lib_protocol/sc_rollup_wasm.mli | 4 +-- src/proto_alpha/lib_protocol/sc_rollups.ml | 28 +++++++++---------- src/proto_alpha/lib_protocol/sc_rollups.mli | 4 +-- .../test/integration/test_sc_rollup_wasm.ml | 2 +- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index ea9b41662629..61df5307ac2c 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3150,7 +3150,7 @@ module Sc_rollup : sig val reference_initial_state_hash : State_hash.t - module ProtocolImplementation : + module Protocol_implementation : PVM.S with type context = Context.t and type state = Context.tree @@ -3205,7 +3205,7 @@ module Sc_rollup : sig context -> input option -> state -> (proof, error) result Lwt.t end - module ProtocolImplementation : + module Protocol_implementation : PVM.S with type context = Context.t and type state = Context.tree @@ -3279,10 +3279,10 @@ module Sc_rollup : sig | Unencodable of (module PVM_with_proof) | Arith_pvm_with_proof of (module PVM_with_proof - with type proof = ArithPVM.ProtocolImplementation.proof) + with type proof = ArithPVM.Protocol_implementation.proof) | Wasm_2_0_0_pvm_with_proof of (module PVM_with_proof - with type proof = Wasm_2_0_0PVM.ProtocolImplementation.proof) + with type proof = Wasm_2_0_0PVM.Protocol_implementation.proof) val wrapped_proof_kind_exn : wrapped_proof -> Kind.t diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index e069a051e2f2..1933e8932513 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -28,7 +28,7 @@ module PS = Sc_rollup_PVM_sem (* This is the state hash of reference that both the prover of the node - and the verifier of the protocol {!ProtocolImplementation} have to + and the verifier of the protocol {!Protocol_implementation} have to agree on (if they do, it means they are using the same tree structure). @@ -40,7 +40,7 @@ module PS = Sc_rollup_PVM_sem Utlimately, the value of this constant is decided by the prover of reference (the only need is for it to be compatible with - {!ProtocolImplementation}.) + {!Protocol_implementation}.) Its value is the result of the following snippet @@ -1203,7 +1203,7 @@ module Make (Context : P) : end end -module ProtocolImplementation = Make (struct +module Protocol_implementation = Make (struct module Tree = struct include Context.Tree diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli index 0c79c48654e9..74aede909576 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli @@ -132,14 +132,14 @@ type 'a proof = { requested : Sc_rollup_PVM_sem.input_request; } -module ProtocolImplementation : +module Protocol_implementation : S with type context = Context.t and type state = Context.tree and type proof = Context.Proof.tree Context.Proof.t proof (** This is the state hash of reference that both the prover of the - node and the verifier of the protocol {!ProtocolImplementation} + node and the verifier of the protocol {!Protocol_implementation} have to agree on (if they do, it means they are using the same tree structure). *) val reference_initial_state_hash : Sc_rollup_repr.State_hash.t diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml index 0f069fe94ad1..cedfd122e072 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml @@ -27,7 +27,7 @@ module V2_0_0 = struct (* This is the state hash of reference that both the prover of the - node and the verifier of the protocol {!ProtocolImplementation} + node and the verifier of the protocol {!Protocol_implementation} have to agree on (if they do, it means they are using the same tree structure). @@ -39,7 +39,7 @@ module V2_0_0 = struct Utlimately, the value of this constant is decided by the prover of reference (the only need is for it to be compatible with - {!ProtocolImplementation}.) + {!Protocol_implementation}.) Its value is the result of the following snippet @@ -442,7 +442,7 @@ module V2_0_0 = struct end end - module ProtocolImplementation = Make (struct + module Protocol_implementation = Make (struct module Tree = struct include Context.Tree diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli index 5fc1f7d26a08..01a3da0feba1 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli @@ -96,14 +96,14 @@ module V2_0_0 : sig and type proof = Context.proof proof (** This PVM is used for verification in the Protocol. [produce_proof] always returns [None]. *) - module ProtocolImplementation : + module Protocol_implementation : S with type context = Context.t and type state = Context.tree and type proof = Context.Proof.tree Context.Proof.t proof (** This is the state hash of reference that both the prover of the - node and the verifier of the protocol {!ProtocolImplementation} + node and the verifier of the protocol {!Protocol_implementation} have to agree on (if they do, it means they are using the same tree structure). *) val reference_initial_state_hash : Sc_rollup_repr.State_hash.t diff --git a/src/proto_alpha/lib_protocol/sc_rollups.ml b/src/proto_alpha/lib_protocol/sc_rollups.ml index 69d3a3adf66b..8b048f662d6f 100644 --- a/src/proto_alpha/lib_protocol/sc_rollups.ml +++ b/src/proto_alpha/lib_protocol/sc_rollups.ml @@ -85,10 +85,10 @@ module Kind = struct | _ -> None let example_arith_pvm = - (module Sc_rollup_arith.ProtocolImplementation : PVM.S) + (module Sc_rollup_arith.Protocol_implementation : PVM.S) let wasm_2_0_0_pvm = - (module Sc_rollup_wasm.V2_0_0.ProtocolImplementation : PVM.S) + (module Sc_rollup_wasm.V2_0_0.Protocol_implementation : PVM.S) let pvm_of = function | Example_arith -> example_arith_pvm @@ -129,10 +129,10 @@ type wrapped_proof = | Unencodable of (module PVM_with_proof) | Arith_pvm_with_proof of (module PVM_with_proof - with type proof = Sc_rollup_arith.ProtocolImplementation.proof) + with type proof = Sc_rollup_arith.Protocol_implementation.proof) | Wasm_2_0_0_pvm_with_proof of (module PVM_with_proof - with type proof = Sc_rollup_wasm.V2_0_0.ProtocolImplementation.proof) + with type proof = Sc_rollup_wasm.V2_0_0.Protocol_implementation.proof) let wrapped_proof_module p = match p with @@ -163,19 +163,19 @@ let wrapped_proof_encoding = case ~title:"Arithmetic PVM with proof" (Tag 0) - Sc_rollup_arith.ProtocolImplementation.proof_encoding + Sc_rollup_arith.Protocol_implementation.proof_encoding (function | Arith_pvm_with_proof pvm -> let (module P : PVM_with_proof with type proof = - Sc_rollup_arith.ProtocolImplementation.proof) = + Sc_rollup_arith.Protocol_implementation.proof) = pvm in Some P.proof | _ -> None) (fun proof -> let module P = struct - include Sc_rollup_arith.ProtocolImplementation + include Sc_rollup_arith.Protocol_implementation let proof = proof end in @@ -183,19 +183,19 @@ let wrapped_proof_encoding = case ~title:"Wasm 2.0.0 PVM with proof" (Tag 1) - Sc_rollup_wasm.V2_0_0.ProtocolImplementation.proof_encoding + Sc_rollup_wasm.V2_0_0.Protocol_implementation.proof_encoding (function | Wasm_2_0_0_pvm_with_proof pvm -> let (module P : PVM_with_proof with type proof = - Sc_rollup_wasm.V2_0_0.ProtocolImplementation.proof) = + Sc_rollup_wasm.V2_0_0.Protocol_implementation.proof) = pvm in Some P.proof | _ -> None) (fun proof -> let module P = struct - include Sc_rollup_wasm.V2_0_0.ProtocolImplementation + include Sc_rollup_wasm.V2_0_0.Protocol_implementation let proof = proof end in @@ -212,7 +212,7 @@ let wrap_proof pvm_with_proof = Option.map (fun arith_proof -> let module P_arith = struct - include Sc_rollup_arith.ProtocolImplementation + include Sc_rollup_arith.Protocol_implementation let proof = arith_proof end in @@ -221,13 +221,13 @@ let wrap_proof pvm_with_proof = (Data_encoding.Binary.to_bytes_opt P.proof_encoding P.proof) (fun bytes -> Data_encoding.Binary.of_bytes_opt - Sc_rollup_arith.ProtocolImplementation.proof_encoding + Sc_rollup_arith.Protocol_implementation.proof_encoding bytes)) | Some Kind.Wasm_2_0_0 -> Option.map (fun wasm_proof -> let module P_wasm2_0_0 = struct - include Sc_rollup_wasm.V2_0_0.ProtocolImplementation + include Sc_rollup_wasm.V2_0_0.Protocol_implementation let proof = wasm_proof end in @@ -236,5 +236,5 @@ let wrap_proof pvm_with_proof = (Data_encoding.Binary.to_bytes_opt P.proof_encoding P.proof) (fun bytes -> Data_encoding.Binary.of_bytes_opt - Sc_rollup_wasm.V2_0_0.ProtocolImplementation.proof_encoding + Sc_rollup_wasm.V2_0_0.Protocol_implementation.proof_encoding bytes)) diff --git a/src/proto_alpha/lib_protocol/sc_rollups.mli b/src/proto_alpha/lib_protocol/sc_rollups.mli index 373bb8a90593..0a6091428d42 100644 --- a/src/proto_alpha/lib_protocol/sc_rollups.mli +++ b/src/proto_alpha/lib_protocol/sc_rollups.mli @@ -98,10 +98,10 @@ type wrapped_proof = | Unencodable of (module PVM_with_proof) | Arith_pvm_with_proof of (module PVM_with_proof - with type proof = Sc_rollup_arith.ProtocolImplementation.proof) + with type proof = Sc_rollup_arith.Protocol_implementation.proof) | Wasm_2_0_0_pvm_with_proof of (module PVM_with_proof - with type proof = Sc_rollup_wasm.V2_0_0.ProtocolImplementation.proof) + with type proof = Sc_rollup_wasm.V2_0_0.Protocol_implementation.proof) (** Unwrap a [wrapped_proof] into a first-class module. *) val wrapped_proof_module : wrapped_proof -> (module PVM_with_proof) 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 99ff45f6802f..d52416008b3d 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 @@ -105,7 +105,7 @@ module WASM_P : return None end -module Verifier = Alpha_context.Sc_rollup.Wasm_2_0_0PVM.ProtocolImplementation +module Verifier = Alpha_context.Sc_rollup.Wasm_2_0_0PVM.Protocol_implementation module Prover = Alpha_context.Sc_rollup.Wasm_2_0_0PVM.Make (WASM_P) (* Helpers *) -- GitLab