Module Evm_node_lib_dev.Misc

now () returns the current time.

val with_timing : (Ptime.span -> unit Lwt.t) -> (unit -> 'a Lwt.t) -> 'a Lwt.t

with_timing event k computes how much time k () takes to be computed and advertises it with event.

val with_timing_f_e : ('a -> Ptime.span -> unit Lwt.t) -> (unit -> ('a, 'e) Stdlib.result Lwt.t) -> ('a, 'e) Stdlib.result Lwt.t

Same as with_timing, but (1) event receives the result of k in addition to the time necessary to compute it, and k is in the error monad, not just the Lwt monad.

val unwrap_error_monad : (unit -> 'a Tezos_base.TzPervasives.tzresult Lwt.t) -> 'a Lwt.t

unwrap_error_monad f execute f and fails with a Failure when the error monad returns an error.

normalize_hex str normalized an hexa-encoded string, i.e. lowercase it and remove prefix "0x" if it exists.

val interpolate : string -> (char * [ `Available of string | `Disabled of string ]) list -> string Tezos_base.TzPervasives.tzresult

interpolate str vars computes a new string when the variables specified in vars are replaced by their value.

We use a format similar to printf, that is %<c> where <c> is a character. vars is therefore a list of pair containing a character (the variable) and a string (its value).