Reindent all files

Now `make test` fails when sources are not indented correctly, the
indentation test is also executed in the CI.
This commit is contained in:
Pietro Abate 2017-11-13 16:34:00 +01:00 committed by Grégoire
parent 32a466556e
commit 6ecfca9396
112 changed files with 2096 additions and 2001 deletions

View File

@ -72,6 +72,11 @@ build:
dependencies:
- build
test:ocp-indent:
<<: *test_definition
script:
- jbuilder build @runtest_indent
test:utils:
<<: *test_definition
script:

62
jbuild
View File

@ -1 +1,63 @@
(jbuild_version 1)
(alias
((name runtest_indent)
(deps ( ;; Hack... list all directories
(glob_files scripts/*.ml)
(glob_files scripts/*.mli)
(glob_files src/*.ml)
(glob_files src/*.mli)
(glob_files src/attacker/*.ml)
(glob_files src/attacker/*.mli)
(glob_files src/client/*.ml)
(glob_files src/client/*.mli)
(glob_files src/client/embedded/alpha/*.ml)
(glob_files src/client/embedded/alpha/*.mli)
(glob_files src/client/embedded/demo/*.ml)
(glob_files src/client/embedded/demo/*.mli)
(glob_files src/client/embedded/genesis/*.ml)
(glob_files src/client/embedded/genesis/*.mli)
(glob_files src/compiler/*.ml)
(glob_files src/compiler/*.mli)
(glob_files src/environment/sigs_packer/*.ml)
(glob_files src/environment/sigs_packer/*.mli)
(glob_files src/environment/v1/*.ml)
(glob_files src/environment/v1/*.mli)
(glob_files src/micheline/*.ml)
(glob_files src/micheline/*.mli)
(glob_files src/minutils/*.ml)
(glob_files src/minutils/*.mli)
(glob_files src/node/db/*.ml)
(glob_files src/node/db/*.mli)
(glob_files src/node/main/*.ml)
(glob_files src/node/main/*.mli)
(glob_files src/node/net/*.ml)
(glob_files src/node/net/*.mli)
(glob_files src/node/shell/*.ml)
(glob_files src/node/shell/*.mli)
(glob_files src/node/updater/*.ml)
(glob_files src/node/updater/*.mli)
(glob_files src/proto/alpha/*.ml)
(glob_files src/proto/alpha/*.mli)
(glob_files src/proto/demo/*.ml)
(glob_files src/proto/demo/*.mli)
(glob_files src/proto/genesis/*.ml)
(glob_files src/proto/genesis/*.mli)
(glob_files src/utils/*.ml)
(glob_files src/utils/*.mli)
(glob_files test/lib/*.ml)
(glob_files test/lib/*.mli)
(glob_files test/p2p/*.ml)
(glob_files test/p2p/*.mli)
(glob_files test/proto_alpha/*.ml)
(glob_files test/proto_alpha/*.mli)
(glob_files test/shell/*.ml)
(glob_files test/shell/*.mli)
(glob_files test/utils/*.ml)
(glob_files test/utils/*.mli)
))
(action (run bash ${path:scripts/test-ocp-indent.sh}))))
(alias
((name runtest)
(deps ((alias runtest_indent)))))

22
scripts/test-ocp-indent.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
tmp_dir="$(mktemp -d -t tezos_build.XXXXXXXXXX)"
failed=no
for f in ` find \( -name _build -or \
-name .git -or \
-wholename ./src/environment/v1.ml -or \
-name registerer.ml \) -prune -or \
\( -name \*.ml -or -name \*.mli \) -print`; do
ff=$(basename $f)
ocp-indent $f > $tmp_dir/$ff
diff -u --color $f $tmp_dir/$ff
if [ $? -ne 0 ]; then
failed=yes
fi
rm -f $tmp_dir/$ff $tmp_dir/$ff.diff
done
if [ $failed = "yes" ]; then
exit 2
fi

View File

@ -53,5 +53,5 @@ let commands () = Cli_entries.[
) stream >>= fun () ->
cctxt.answer "Bootstrapped." >>= fun () ->
return ()
)
)
]

View File

@ -286,11 +286,11 @@ module Helpers = struct
end
(* type slot = *)
(* raw_level * int * timestamp option *)
(* let baking_possibilities *)
(* b c ?max_priority ?first_level ?last_level () = *)
(* call_error_service2 Services.Helpers.Context.Contract.baking_possibilities *)
(* b c (max_priority, first_level, last_level) *)
(* (\* let endorsement_possibilities b c ?max_priority ?first_level ?last_level () = *\) *)
(* call_error_service2 Services.Helpers.Context.Contract.endorsement_possibilities *)
(* b c (max_priority, first_level, last_level) *)
(* raw_level * int * timestamp option *)
(* let baking_possibilities *)
(* b c ?max_priority ?first_level ?last_level () = *)
(* call_error_service2 Services.Helpers.Context.Contract.baking_possibilities *)
(* b c (max_priority, first_level, last_level) *)
(* (\* let endorsement_possibilities b c ?max_priority ?first_level ?last_level () = *\) *)
(* call_error_service2 Services.Helpers.Context.Contract.endorsement_possibilities *)
(* b c (max_priority, first_level, last_level) *)

View File

@ -101,7 +101,7 @@ let load_embeded_cmis cmis = List.iter load_embeded_cmi cmis
the protocol first-class module into the [Updater.versions]
hashtable).
*)
*)
let tezos_protocol_env =

View File

@ -228,12 +228,12 @@ val sort : ('a -> 'a -> int) -> 'a array -> unit
Specification of the comparison function:
Let [a] be the array and [cmp] the comparison function. The following
must be true for all x, y, z in a :
- [cmp x y] > 0 if and only if [cmp y x] < 0
- if [cmp x y] >= 0 and [cmp y z] >= 0 then [cmp x z] >= 0
- [cmp x y] > 0 if and only if [cmp y x] < 0
- if [cmp x y] >= 0 and [cmp y z] >= 0 then [cmp x z] >= 0
When [Array.sort] returns, [a] contains the same elements as before,
reordered in such a way that for all i and j valid indices of [a] :
- [cmp a.(i) a.(j)] >= 0 if and only if i >= j
- [cmp a.(i) a.(j)] >= 0 if and only if i >= j
*)
val stable_sort : ('a -> 'a -> int) -> 'a array -> unit

View File

@ -49,7 +49,7 @@
Bytes are represented by the OCaml type [char].
@since 4.02.0
*)
*)
external length : bytes -> int = "%bytes_length"
(** Return the length (number of bytes) of the argument. *)

View File

@ -122,7 +122,7 @@ external to_int : int32 -> int = "%int32_to_int"
external of_float : float -> int32
= "caml_int32_of_float" "caml_int32_of_float_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Convert the given floating-point number to a 32-bit integer,
discarding the fractional part (truncate towards 0).
The result of the conversion is undefined if, after truncation,
@ -130,7 +130,7 @@ external of_float : float -> int32
external to_float : int32 -> float
= "caml_int32_to_float" "caml_int32_to_float_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Convert the given 32-bit integer to a floating-point number. *)
external of_string : string -> int32 = "caml_int32_of_string"
@ -147,7 +147,7 @@ val to_string : int32 -> string
external bits_of_float : float -> int32
= "caml_int32_bits_of_float" "caml_int32_bits_of_float_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Return the internal representation of the given float according
to the IEEE 754 floating-point 'single format' bit layout.
Bit 31 of the result represents the sign of the float;
@ -156,7 +156,7 @@ external bits_of_float : float -> int32
external float_of_bits : int32 -> float
= "caml_int32_float_of_bits" "caml_int32_float_of_bits_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Return the floating-point number whose internal representation,
according to the IEEE 754 floating-point 'single format' bit layout,
is the given [int32]. *)

View File

@ -122,7 +122,7 @@ external to_int : int64 -> int = "%int64_to_int"
external of_float : float -> int64
= "caml_int64_of_float" "caml_int64_of_float_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Convert the given floating-point number to a 64-bit integer,
discarding the fractional part (truncate towards 0).
The result of the conversion is undefined if, after truncation,
@ -130,7 +130,7 @@ external of_float : float -> int64
external to_float : int64 -> float
= "caml_int64_to_float" "caml_int64_to_float_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Convert the given 64-bit integer to a floating-point number. *)
@ -168,7 +168,7 @@ val to_string : int64 -> string
external bits_of_float : float -> int64
= "caml_int64_bits_of_float" "caml_int64_bits_of_float_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Return the internal representation of the given float according
to the IEEE 754 floating-point 'double format' bit layout.
Bit 63 of the result represents the sign of the float;
@ -177,7 +177,7 @@ external bits_of_float : float -> int64
external float_of_bits : int64 -> float
= "caml_int64_float_of_bits" "caml_int64_float_of_bits_unboxed"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Return the floating-point number whose internal representation,
according to the IEEE 754 floating-point 'double format' bit layout,
is the given [int64]. *)

View File

@ -20,7 +20,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)
*)
(* TEZOS CHANGES
@ -62,17 +62,17 @@
(** {2 Definitions and basics} *)
type +'a t
(** The type of threads returning a result of type ['a]. *)
(** The type of threads returning a result of type ['a]. *)
val return : 'a -> 'a t
(** [return e] is a thread whose return value is the value of the
(** [return e] is a thread whose return value is the value of the
expression [e]. *)
(* val fail : exn -> 'a t *)
(* (\** [fail e] is a thread that fails with the exception [e]. *\) *)
val bind : 'a t -> ('a -> 'b t) -> 'b t
(** [bind t f] is a thread which first waits for the thread [t] to
(** [bind t f] is a thread which first waits for the thread [t] to
terminate and then, if the thread succeeds, behaves as the
application of function [f] to the return value of [t]. If the
thread [t] fails, [bind t f] also fails, with the same
@ -88,37 +88,37 @@ val bind : 'a t -> ('a -> 'b t) -> 'b t
The result of a thread can be bound several time. *)
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
(** [t >>= f] is an alternative notation for [bind t f]. *)
(** [t >>= f] is an alternative notation for [bind t f]. *)
val (=<<) : ('a -> 'b t) -> 'a t -> 'b t
(** [f =<< t] is [t >>= f] *)
(** [f =<< t] is [t >>= f] *)
val map : ('a -> 'b) -> 'a t -> 'b t
(** [map f m] map the result of a thread. This is the same as [bind
(** [map f m] map the result of a thread. This is the same as [bind
m (fun x -> return (f x))] *)
val (>|=) : 'a t -> ('a -> 'b) -> 'b t
(** [m >|= f] is [map f m] *)
(** [m >|= f] is [map f m] *)
val (=|<) : ('a -> 'b) -> 'a t -> 'b t
(** [f =|< m] is [map f m] *)
(** [f =|< m] is [map f m] *)
(** {3 Pre-allocated threads} *)
val return_unit : unit t
(** [return_unit = return ()] *)
(** [return_unit = return ()] *)
val return_none : 'a option t
(** [return_none = return None] *)
(** [return_none = return None] *)
val return_nil : 'a list t
(** [return_nil = return \[\]] *)
(** [return_nil = return \[\]] *)
val return_true : bool t
(** [return_true = return true] *)
(** [return_true = return true] *)
val return_false : bool t
(** [return_false = return false] *)
(** [return_false = return false] *)
(* (\** {2 Thread storage} *\) *)
@ -223,7 +223,7 @@ val return_false : bool t
(* the list of threads that have not yet terminated. *\) *)
val join : unit t list -> unit t
(** [join l] waits for all threads in [l] to terminate. If one of
(** [join l] waits for all threads in [l] to terminate. If one of
the threads fails, then [join l] will fails with the same
exception as the first one to terminate.
@ -234,7 +234,7 @@ val join : unit t list -> unit t
(* (\** [t <?> t'] is the same as [choose [t; t']] *\) *)
val ( <&> ) : unit t -> unit t -> unit t
(** [t <&> t'] is the same as [join [t; t']] *)
(** [t <&> t'] is the same as [join [t; t']] *)
(* val async : (unit -> 'a t) -> unit *)
(* (\** [async f] starts a thread without waiting for the result. If it *)

View File

@ -18,7 +18,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)
*)
(** List helpers *)

View File

@ -18,7 +18,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)
*)
(** Mutable sequence of elements *)
@ -32,71 +32,71 @@
*)
type 'a t
(** Type of a sequence holding values of type ['a] *)
(** Type of a sequence holding values of type ['a] *)
type 'a node
(** Type of a node holding one value of type ['a] in a sequence *)
(** Type of a node holding one value of type ['a] in a sequence *)
(** {2 Operation on nodes} *)
val get : 'a node -> 'a
(** Returns the contents of a node *)
(** Returns the contents of a node *)
val set : 'a node -> 'a -> unit
(** Change the contents of a node *)
(** Change the contents of a node *)
val remove : 'a node -> unit
(** Removes a node from the sequence it is part of. It does nothing
(** Removes a node from the sequence it is part of. It does nothing
if the node has already been removed. *)
(** {2 Operations on sequence} *)
val create : unit -> 'a t
(** [create ()] creates a new empty sequence *)
(** [create ()] creates a new empty sequence *)
val is_empty : 'a t -> bool
(** Returns [true] iff the given sequence is empty *)
(** Returns [true] iff the given sequence is empty *)
val length : 'a t -> int
(** Returns the number of elemenets in the given sequence. This is a
(** Returns the number of elemenets in the given sequence. This is a
O(n) operation where [n] is the number of elements in the
sequence. *)
val add_l : 'a -> 'a t -> 'a node
(** [add_l x s] adds [x] to the left of the sequence [s] *)
(** [add_l x s] adds [x] to the left of the sequence [s] *)
val add_r : 'a -> 'a t -> 'a node
(** [add_l x s] adds [x] to the right of the sequence [s] *)
(** [add_l x s] adds [x] to the right of the sequence [s] *)
exception Empty
(** Exception raised by [take_l] and [tale_s] and when the sequence
(** Exception raised by [take_l] and [tale_s] and when the sequence
is empty *)
val take_l : 'a t -> 'a
(** [take_l x s] remove and returns the leftmost element of [s]
(** [take_l x s] remove and returns the leftmost element of [s]
@raise Empty if the sequence is empty *)
val take_r : 'a t -> 'a
(** [take_l x s] remove and returns the rightmost element of [s]
(** [take_l x s] remove and returns the rightmost element of [s]
@raise Empty if the sequence is empty *)
val take_opt_l : 'a t -> 'a option
(** [take_opt_l x s] remove and returns [Some x] where [x] is the
(** [take_opt_l x s] remove and returns [Some x] where [x] is the
leftmost element of [s] or [None] if [s] is empty *)
val take_opt_r : 'a t -> 'a option
(** [take_opt_l x s] remove and returns [Some x] where [x] is the
(** [take_opt_l x s] remove and returns [Some x] where [x] is the
rightmost element of [s] or [None] if [s] is empty *)
val transfer_l : 'a t -> 'a t -> unit
(** [transfer_l s1 s2] removes all elements of [s1] and add them at
(** [transfer_l s1 s2] removes all elements of [s1] and add them at
the left of [s2]. This operation runs in constant time and
space. *)
val transfer_r : 'a t -> 'a t -> unit
(** [transfer_r s1 s2] removes all elements of [s1] and add them at
(** [transfer_r s1 s2] removes all elements of [s1] and add them at
the right of [s2]. This operation runs in constant time and
space. *)
@ -105,51 +105,51 @@ val transfer_r : 'a t -> 'a t -> unit
(** Note: it is OK to remove a node while traversing a sequence *)
val iter_l : ('a -> unit) -> 'a t -> unit
(** [iter_l f s] applies [f] on all elements of [s] starting from
(** [iter_l f s] applies [f] on all elements of [s] starting from
the left *)
val iter_r : ('a -> unit) -> 'a t -> unit
(** [iter_l f s] applies [f] on all elements of [s] starting from
(** [iter_l f s] applies [f] on all elements of [s] starting from
the right *)
val iter_node_l : ('a node -> unit) -> 'a t -> unit
(** [iter_l f s] applies [f] on all nodes of [s] starting from
(** [iter_l f s] applies [f] on all nodes of [s] starting from
the left *)
val iter_node_r : ('a node -> unit) -> 'a t -> unit
(** [iter_l f s] applies [f] on all nodes of [s] starting from
(** [iter_l f s] applies [f] on all nodes of [s] starting from
the right *)
val fold_l : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
(** [fold_l f s] is:
(** [fold_l f s] is:
{[
fold_l f s x = f en (... (f e2 (f e1 x)))
]}
where [e1], [e2], ..., [en] are the elements of [s]
*)
*)
val fold_r : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
(** [fold_r f s] is:
(** [fold_r f s] is:
{[
fold_r f s x = f e1 (f e2 (... (f en x)))
]}
where [e1], [e2], ..., [en] are the elements of [s]
*)
*)
val find_node_opt_l : ('a -> bool) -> 'a t -> 'a node option
(** [find_node_opt_l f s] returns [Some x], where [x] is the first node of
(** [find_node_opt_l f s] returns [Some x], where [x] is the first node of
[s] starting from the left that satisfies [f] or [None] if none
exists. *)
val find_node_opt_r : ('a -> bool) -> 'a t -> 'a node option
(** [find_node_opt_r f s] returns [Some x], where [x] is the first node of
(** [find_node_opt_r f s] returns [Some x], where [x] is the first node of
[s] starting from the right that satisfies [f] or [None] if none
exists. *)
val find_node_l : ('a -> bool) -> 'a t -> 'a node
(** [find_node_l f s] returns the first node of [s] starting from the left
(** [find_node_l f s] returns the first node of [s] starting from the left
that satisfies [f] or raises [Not_found] if none exists. *)
val find_node_r : ('a -> bool) -> 'a t -> 'a node
(** [find_node_r f s] returns the first node of [s] starting from the right
(** [find_node_r f s] returns the first node of [s] starting from the right
that satisfies [f] or raises [Not_found] if none exists. *)

View File

@ -44,7 +44,7 @@
*)
module type OrderedType =
sig
sig
type t
(** The type of the map keys. *)
@ -56,11 +56,11 @@ module type OrderedType =
and [f e1 e2] is strictly positive if [e1] is greater than [e2].
Example: a suitable ordering function is the generic structural
comparison function {!Pervasives.compare}. *)
end
end
(** Input signature of the functor {!Map.Make}. *)
module type S =
sig
sig
type key
(** The type of the map keys. *)
@ -224,7 +224,7 @@ module type S =
key and the associated value for each binding of the map. *)
end
end
(** Output signature of the functor {!Map.Make}. *)
module Make (Ord : OrderedType) : S with type key = Ord.t

View File

@ -107,7 +107,7 @@ external __POS__ : string * int * int * int = "%loc_POS"
filename, [lnum] the line number, [cnum] the character position in
the line and [enum] the last character position in the line.
@since 4.02.0
*)
*)
external __LOC_OF__ : 'a -> string * 'a = "%loc_LOC"
(** [__LOC_OF__ expr] returns a pair [(loc, expr)] where [loc] is the
@ -122,7 +122,7 @@ external __LINE_OF__ : 'a -> int * 'a = "%loc_LINE"
line number at which the expression [expr] appears in the file
currently being parsed by the compiler.
@since 4.02.0
*)
*)
external __POS_OF__ : 'a -> (string * int * int * int) * 'a = "%loc_POS"
(** [__POS_OF__ expr] returns a pair [(loc,expr)], where [loc] is a
@ -132,7 +132,7 @@ external __POS_OF__ : 'a -> (string * int * int * int) * 'a = "%loc_POS"
line number, [cnum] the character position in the line and [enum]
the last character position in the line.
@since 4.02.0
*)
*)
(** {6 Composition operators} *)
@ -272,13 +272,13 @@ external ( /. ) : float -> float -> float = "%divfloat"
(** Floating-point division. *)
external ceil : float -> float = "caml_ceil_float" "ceil"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Round above to an integer value.
[ceil f] returns the least integer value greater than or equal to [f].
The result is returned as a float. *)
external floor : float -> float = "caml_floor_float" "floor"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** Round below to an integer value.
[floor f] returns the greatest integer value less than or
equal to [f].
@ -289,7 +289,7 @@ external abs_float : float -> float = "%absfloat"
external copysign : float -> float -> float
= "caml_copysign_float" "caml_copysign"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** [copysign x y] returns a float whose absolute value is that of [x]
and whose sign is that of [y]. If [x] is [nan], returns [nan].
If [y] is [nan], returns either [x] or [-. x], but it is not
@ -297,7 +297,7 @@ external copysign : float -> float -> float
@since 4.00.0 *)
external mod_float : float -> float -> float = "caml_fmod_float" "fmod"
[@@unboxed] [@@noalloc]
[@@unboxed] [@@noalloc]
(** [mod_float a b] returns the remainder of [a] with respect to
[b]. The returned value is [a -. n *. b], where [n]
is the quotient [a /. b] rounded towards zero to an integer. *)

View File

@ -45,7 +45,7 @@
*)
module type OrderedType =
sig
sig
type t
(** The type of the set elements. *)
@ -57,11 +57,11 @@ module type OrderedType =
and [f e1 e2] is strictly positive if [e1] is greater than [e2].
Example: a suitable ordering function is the generic structural
comparison function {!Pervasives.compare}. *)
end
end
(** Input signature of the functor {!Set.Make}. *)
module type S =
sig
sig
type elt
(** The type of the set elements. *)
@ -197,7 +197,7 @@ module type S =
This is usually more efficient than folding [add] over the list,
except perhaps for lists with many duplicated elements.
@since 4.02.0 *)
end
end
(** Output signature of the functor {!Set.Make}. *)
module Make (Ord : OrderedType) : S with type elt = Ord.t

View File

@ -41,7 +41,7 @@
substring of [s] if [len >= 0] and [start] and [start+len] are
valid positions in [s].
*)
*)
external length : string -> int = "%string_length"
(** Return the length (number of characters) of the given string. *)

View File

@ -30,7 +30,7 @@ val ediv_rem: t -> t -> (t * t)
(** Euclidean division and remainder. [ediv_rem a b] returns a pair [(q, r)]
such that [a = b * q + r] and [0 <= r < |b|].
Raises [Division_by_zero] if [b = 0].
*)
*)
external logand: t -> t -> t = "ml_z_logand" "ml_as_z_logand"
(** Bitwise logical and. *)
@ -44,20 +44,20 @@ external logxor: t -> t -> t = "ml_z_logxor" "ml_as_z_logxor"
external lognot: t -> t = "ml_z_lognot" "ml_as_z_lognot"
(** Bitwise logical negation.
The identity [lognot a]=[-a-1] always hold.
*)
*)
external shift_left: t -> int -> t = "ml_z_shift_left" "ml_as_z_shift_left"
(** Shifts to the left.
Equivalent to a multiplication by a power of 2.
The second argument must be non-negative.
*)
*)
external shift_right: t -> int -> t = "ml_z_shift_right" "ml_as_z_shift_right"
(** Shifts to the right.
This is an arithmetic shift,
equivalent to a division by a power of 2 with rounding towards -oo.
The second argument must be non-negative.
*)
*)
val to_string: t -> string
val of_string: string -> t

View File

@ -289,10 +289,10 @@ val register_dynamic_directory3:
(** Registring custom directory lookup. *)
type custom_lookup = RestoDirectory.custom_lookup
(* | CustomService of Description.service_descr * *)
(* ( Data_encoding.json option -> *)
(* Data_encoding.json Answer.answer Lwt.t ) *)
(* | CustomDirectory of Description.directory_descr *)
(* | CustomService of Description.service_descr * *)
(* ( Data_encoding.json option -> *)
(* Data_encoding.json Answer.answer Lwt.t ) *)
(* | CustomDirectory of Description.directory_descr *)
val register_custom_lookup:
?meth:meth ->

View File

@ -735,7 +735,7 @@ module Binary = struct
read: 'a. 'a t -> MBytes.t -> int -> int -> (int * 'a) ;
}
let rec length : type x. x t -> x -> int = fun e ->
let rec length : type x. x t -> x -> int = fun e ->
match e.encoding with
(* Fixed *)
| Null -> fun _ -> 0

View File

@ -49,4 +49,4 @@ val live_blocks:
[blocks] is the set of arity [n], that contains [b] and its [n-1]
predecessors. And where [operations] is the set of operations
included in those blocks.
*)
*)

View File

@ -332,7 +332,7 @@ let noop_callback = {
notify_branch = begin fun _gid _locator -> () end ;
notify_head = begin fun _gid _block _ops -> () end ;
disconnection = begin fun _gid -> () end ;
}
}
type t = db

View File

@ -38,7 +38,7 @@ let () =
(function Bad_data_dir -> Some () | _ -> None)
(fun () -> Bad_data_dir) ;
(** *)
(** *)
module Shared = struct
type 'a t = {

View File

@ -36,8 +36,8 @@ let get_unrevealed c level =
return (nonce_hash, delegate_to_reward, reward_amount)
(* let get_unrevealed_hash c level = *)
(* get_unrevealed c level >>=? fun (nonce_hash, _) -> *)
(* return nonce_hash *)
(* get_unrevealed c level >>=? fun (nonce_hash, _) -> *)
(* return nonce_hash *)
let record_hash c delegate_to_reward reward_amount nonce_hash =
let level = Level_storage.current c in

View File

@ -57,7 +57,7 @@ let () =
(fun (contract, expr) ->
Runtime_contract_error (contract, expr));
(* ---- interpreter ---------------------------------------------------------*)
(* ---- interpreter ---------------------------------------------------------*)
type 'tys stack =
| Item : 'ty * 'rest stack -> ('ty * 'rest) stack

View File

@ -11,7 +11,7 @@
type proposal = Protocol_hash.t
(* votes can be for, against or neutral.
Neutral serves to count towards a quorum *)
Neutral serves to count towards a quorum *)
type ballot = Yay | Nay | Pass
let ballot_encoding =

View File

@ -76,7 +76,7 @@ let begin_construction
~predecessor:_
~timestamp:_
?proto_header:_ () =
Fitness.to_int64 pred_fitness >>=? function pred_fitness ->
Fitness.to_int64 pred_fitness >>=? fun pred_fitness ->
let fitness = Int64.succ pred_fitness in
return { context ; fitness }

View File

@ -13,7 +13,7 @@
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)
*)
open Error_monad

View File

@ -368,9 +368,9 @@ module Make() = struct
(Format.pp_print_list pp)
(List.rev errors)
type error += Unclassified of string
type error += Unclassified of string
let () =
let () =
let id = "" in
let category = `Temporary in
let to_error msg = Unclassified msg in
@ -394,9 +394,9 @@ let () =
error_kinds :=
Error_kind { id; from_error ; category; encoding_case ; pp } :: !error_kinds
type error += Assert_error of string * string
type error += Assert_error of string * string
let () =
let () =
let id = "" in
let category = `Permanent in
let to_error (loc, msg) = Assert_error (loc, msg) in
@ -423,14 +423,14 @@ let () =
error_kinds :=
Error_kind { id; from_error ; category; encoding_case ; pp } :: !error_kinds
let _assert b loc fmt =
let _assert b loc fmt =
if b then
Format.ikfprintf (fun _ -> return ()) Format.str_formatter fmt
else
Format.kasprintf (fun msg -> fail (Assert_error (loc, msg))) fmt
let protect ~on_error t =
let protect ~on_error t =
t >>= function
| Ok res -> return res
| Error err -> on_error err

View File

@ -26,8 +26,8 @@
../scripts/client_lib.inc.sh
(glob_files contracts/*)
))
(locks (/tcp-port/18732
/tcp-port/19732))
(locks (/tcp-port/18731
/tcp-port/19731))
(action (run bash ${path:test_contracts.sh}))))
(alias
@ -46,3 +46,9 @@
/tcp-port/19731 /tcp-port/19732 /tcp-port/19733 /tcp-port/19734
/tcp-port/19735 /tcp-port/19736 /tcp-port/19737 /tcp-port/19738))
(action (run bash ${path:test_multinode.sh}))))
(alias
((name runtest)
(deps ((alias runtest_basic.sh)
(alias runtest_contracts.sh)
(alias runtest_multinode.sh)))))

View File

@ -18,7 +18,7 @@ let rpc_config = ref {
port = 8192 + Random.int 8192 ;
tls = false ;
logger = Client_rpcs.null_logger ;
}
}
let dictator_sk =
Ed25519.Secret_key.of_b58check_exn

View File

@ -278,9 +278,9 @@ assert_parses "PUSH (map int bool) (Map (Item 100 False))"
None) ];
assert_parses
"parameter int; \
return int; \
return int; \
storage unit; \
code {}"
code {}"
[ Prim ((), "parameter", [ Prim((), "int", [], None) ], None);
Prim ((), "return", [ Prim((), "int", [], None) ], None);
Prim ((), "storage", [ Prim((), "unit", [], None) ], None);

View File

@ -6,7 +6,7 @@ set -o pipefail
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
source $test_dir/lib/test_lib.inc.sh
start_node 2
start_node 1
activate_alpha
key1=foo