More renaming registred -> registered

This commit is contained in:
Grégoire Henry 2018-03-15 15:26:52 +01:00 committed by Benjamin Canou
parent 71ee3114a7
commit 5ac629f335
18 changed files with 40 additions and 40 deletions

View File

@ -92,7 +92,7 @@ let init_logger ?verbosity (log_config : Node_config_file.log) =
let init_node ?sandbox (config : Node_config_file.t) =
let patch_context json ctxt =
let module Proto = (val Registred_protocol.get_exn genesis.protocol) in
let module Proto = (val Registered_protocol.get_exn genesis.protocol) in
protect begin fun () ->
Proto.configure_sandbox ctxt json
end >|= function

View File

@ -31,7 +31,7 @@ end
let () =
Format.printf {|
let () =
let module Ignored = Tezos_protocol_updater.Registred_protocol.Register
let module Ignored = Tezos_protocol_updater.Registered_protocol.Register
(Tezos_embedded_protocol_environment_%s.Environment)
(Tezos_embedded_raw_protocol_%s.Main)
(Source) in

View File

@ -114,7 +114,7 @@ let check_liveness chain_state pred hash operations_hashes operations =
let apply_block
chain_state
pred (module Proto : Registred_protocol.T)
pred (module Proto : Registered_protocol.T)
hash (header: Block_header.t)
operations =
let pred_header = State.Block.header pred
@ -207,7 +207,7 @@ let check_chain_liveness chain_db hash (header: Block_header.t) =
let get_proto pred hash =
State.Block.context pred >>= fun pred_context ->
Context.get_protocol pred_context >>= fun pred_protocol_hash ->
match Registred_protocol.get pred_protocol_hash with
match Registered_protocol.get pred_protocol_hash with
| None ->
fail (Unavailable_protocol { block = hash ;
protocol = pred_protocol_hash })

View File

@ -32,7 +32,7 @@ val fetch_and_compile_protocol:
t ->
?peer:P2p_peer.Id.t ->
?timeout:float ->
Protocol_hash.t -> Registred_protocol.t tzresult Lwt.t
Protocol_hash.t -> Registered_protocol.t tzresult Lwt.t
val shutdown: t -> unit Lwt.t

View File

@ -547,7 +547,7 @@ module RPC = struct
| None -> Lwt.fail Not_found
| Some { context = ctxt } ->
Context.get_protocol ctxt >>= fun protocol_hash ->
let (module Proto) = Registred_protocol.get_exn protocol_hash in
let (module Proto) = Registered_protocol.get_exn protocol_hash in
Base58.complete str >>= fun l1 ->
Proto.complete_b58prefix ctxt str >>= fun l2 ->
Lwt.return (l1 @ l2)
@ -557,7 +557,7 @@ module RPC = struct
| None -> Lwt.return None
| Some rpc_context ->
Context.get_protocol rpc_context.context >>= fun protocol_hash ->
let (module Proto) = Registred_protocol.get_exn protocol_hash in
let (module Proto) = Registered_protocol.get_exn protocol_hash in
let dir = RPC_directory.map (fun () -> Lwt.return rpc_context) Proto.rpc_services in
Lwt.return (Some (RPC_directory.map (fun _ -> ()) dir))

View File

@ -54,7 +54,7 @@ type prevalidation_state =
-> prevalidation_state
and 'a proto =
(module Registred_protocol.T with type validation_state = 'a)
(module Registered_protocol.T with type validation_state = 'a)
let start_prevalidation
?protocol_data
@ -70,7 +70,7 @@ let start_prevalidation
Context.get_protocol predecessor_context >>= fun protocol ->
let predecessor = State.Block.hash predecessor in
begin
match Registred_protocol.get protocol with
match Registered_protocol.get protocol with
| None ->
(* FIXME. *)
(* This should not happen: it should be handled in the validator. *)

View File

@ -15,7 +15,7 @@ type 'a request =
| Request_validation: {
hash: Protocol_hash.t ;
protocol: Protocol.t ;
} -> Registred_protocol.t tzresult request
} -> Registered_protocol.t tzresult request
type message = Message: 'a request * 'a Lwt.u option -> message
@ -50,7 +50,7 @@ let rec worker_loop bv =
return ()
| Some wakener ->
if valid then
match Registred_protocol.get hash with
match Registered_protocol.get hash with
| Some protocol ->
Lwt.wakeup_later wakener (Ok protocol)
| None ->
@ -97,7 +97,7 @@ let shutdown { canceler ; worker } =
worker
let validate { messages } hash protocol =
match Registred_protocol.get hash with
match Registered_protocol.get hash with
| Some protocol ->
lwt_debug "previously validated protocol %a (before pipe)"
Protocol_hash.pp_short hash >>= fun () ->
@ -112,7 +112,7 @@ let validate { messages } hash protocol =
res
let fetch_and_compile_protocol pv ?peer ?timeout hash =
match Registred_protocol.get hash with
match Registered_protocol.get hash with
| Some proto -> return proto
| None ->
begin

View File

@ -14,7 +14,7 @@ val create: Distributed_db.t -> t
val validate:
t ->
Protocol_hash.t -> Protocol.t ->
Registred_protocol.t tzresult Lwt.t
Registered_protocol.t tzresult Lwt.t
val shutdown: t -> unit Lwt.t
@ -22,7 +22,7 @@ val fetch_and_compile_protocol:
t ->
?peer:P2p_peer.Id.t ->
?timeout:float ->
Protocol_hash.t -> Registred_protocol.t tzresult Lwt.t
Protocol_hash.t -> Registered_protocol.t tzresult Lwt.t
val fetch_and_compile_protocols:
t ->

View File

@ -30,7 +30,7 @@ let state_genesis_block =
let chain_id = Chain_id.of_block_hash genesis_hash
module Proto = (val Registred_protocol.get_exn genesis_protocol)
module Proto = (val Registered_protocol.get_exn genesis_protocol)
let incr_timestamp timestamp =
Time.add timestamp (Int64.add 1L (Random.int64 10L))

View File

@ -22,7 +22,7 @@ let genesis_protocol =
let genesis_time =
Time.of_seconds 0L
module Proto = (val Registred_protocol.get_exn genesis_protocol)
module Proto = (val Registered_protocol.get_exn genesis_protocol)
let genesis : State.Chain.genesis = {
time = genesis_time ;

View File

@ -30,8 +30,8 @@ val registered: Raw_context.t -> Ed25519.Public_key_hash.t -> bool Lwt.t
(** Updating the delegate of a contract.
When calling this function on an "implicit contract" this function
fails, unless when the registred delegate is the contract manager.
In the that case, the manager is now registred as a delegate. One
fails, unless when the registered delegate is the contract manager.
In the that case, the manager is now registered as a delegate. One
cannot unregister a delegate for now. The associate contract is
now 'undeletable'. *)
val set:
@ -41,13 +41,13 @@ val set:
type error +=
| Non_delegatable_contract of Contract_repr.contract (* `Permanent *)
(** Iterate on all registred delegates. *)
(** Iterate on all registered delegates. *)
val fold:
Raw_context.t ->
init:'a ->
f:(Ed25519.Public_key_hash.t -> 'a -> 'a Lwt.t) -> 'a Lwt.t
(** List all registred delegates. *)
(** List all registered delegates. *)
val list: Raw_context.t -> Ed25519.Public_key_hash.t list Lwt.t
(** Various functions to 'freeze' tokens. A frozen 'deposit' keeps its

View File

@ -185,7 +185,7 @@ module Contract : sig
end
(** Set of all registred delegates. *)
(** Set of all registered delegates. *)
module Delegates : Data_set_storage
with type t := Raw_context.t
and type elt = Ed25519.Public_key_hash.t

View File

@ -67,11 +67,11 @@ type ('q, 'i, 'o, 'e) types = ('q, 'i, 'o, 'e) Directory.types = {
error : 'e Json_encoding.encoding ;
}
type registred_service = Directory.registred_service =
type registered_service = Directory.registered_service =
| Service :
{ types : ('q, 'i, 'o, 'e) types ;
handler : ('q -> 'i -> ('o, 'e) Answer.t Lwt.t) ;
} -> registred_service
} -> registered_service
type lookup_error = Directory.lookup_error

View File

@ -65,11 +65,11 @@ type ('q, 'i, 'o, 'e) types = {
error : 'e Json_encoding.encoding ;
}
type registred_service =
type registered_service =
| Service :
{ types : ('q, 'i, 'o, 'e) types ;
handler : ('q -> 'i -> ('o, 'e) Answer.t Lwt.t) ;
} -> registred_service
} -> registered_service
type lookup_error =
[ `Not_found (* 404 *)
@ -78,7 +78,7 @@ type lookup_error =
]
(** Resolve a service. *)
val lookup: directory -> meth -> string list -> (registred_service, [> lookup_error ]) result Lwt.t
val lookup: directory -> meth -> string list -> (registered_service, [> lookup_error ]) result Lwt.t
val allowed_methods:
directory -> string list ->

View File

@ -114,7 +114,7 @@ module Make (Encoding : ENCODING) = struct
and 'key directory = 'key t
and 'key static_directory = {
services : 'key registred_service_builder MethMap.t ;
services : 'key registered_service_builder MethMap.t ;
subdirs : 'key static_subdirectories option
}
@ -122,16 +122,16 @@ module Make (Encoding : ENCODING) = struct
| Suffixes: 'key directory StringMap.t -> 'key static_subdirectories
| Arg: 'a Resto.Internal.arg * ('key * 'a) directory -> 'key static_subdirectories
and registred_service =
and registered_service =
| Service :
{ types : ('q, 'i, 'o, 'e) types ;
handler : ('q -> 'i -> ('o, 'e) Answer.t Lwt.t) ;
} -> registred_service
} -> registered_service
and 'key registred_service_builder = {
and 'key registered_service_builder = {
meth : Resto.meth ;
description : Encoding.schema Description.service ;
builder : 'key -> registred_service ;
builder : 'key -> registered_service ;
}
let empty = Empty
@ -154,7 +154,7 @@ module Make (Encoding : ENCODING) = struct
: type a b.
(a -> b) -> b static_directory -> a static_directory
= fun f t ->
{ services = MethMap.map (map_registred_service f) t.services ;
{ services = MethMap.map (map_registered_service f) t.services ;
subdirs = map_option (map_static_subdirectories f) t.subdirs ;
}
@ -169,9 +169,9 @@ module Make (Encoding : ENCODING) = struct
let dir = map_directory (fun (a, x) -> f a, x) dir in
Arg (arg, dir)
and map_registred_service
and map_registered_service
: type a b.
(a -> b) -> b registred_service_builder -> a registred_service_builder
(a -> b) -> b registered_service_builder -> a registered_service_builder
= fun f rs ->
{ rs with builder = (fun p -> rs.builder (f p)) }
@ -314,7 +314,7 @@ module Make (Encoding : ENCODING) = struct
and describe_service
: type a.
a registred_service_builder -> Encoding.schema Description.service
a registered_service_builder -> Encoding.schema Description.service
= fun { description ; _ } -> description
and describe_query
@ -382,7 +382,7 @@ module Make (Encoding : ENCODING) = struct
let lookup
: type a.
a directory -> a -> meth -> string list ->
(registred_service, lookup_error) result Lwt.t
(registered_service, lookup_error) result Lwt.t
= fun dir args meth path ->
resolve [] dir args path >>= function
| Error _ as err -> Lwt.return err

View File

@ -58,11 +58,11 @@ module Make (Encoding : ENCODING) : sig
error : 'error Encoding.t ;
}
type registred_service =
type registered_service =
| Service :
{ types : ('q, 'i, 'o, 'e) types ;
handler : ('q -> 'i -> ('o, 'e) Answer.t Lwt.t) ;
} -> registred_service
} -> registered_service
(** Dispatch tree *)
type 'prefix t
@ -77,7 +77,7 @@ module Make (Encoding : ENCODING) : sig
(** Resolve a service. *)
val lookup:
'prefix directory -> 'prefix ->
meth -> string list -> (registred_service, [> lookup_error ]) result Lwt.t
meth -> string list -> (registered_service, [> lookup_error ]) result Lwt.t
val allowed_methods:
'prefix directory -> 'prefix -> string list ->