diff --git a/.ocamlformat b/.ocamlformat index 4823e7af..ba7cb18e 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -6,7 +6,7 @@ break-collection-expressions=wrap break-sequences=false break-infix-before-func=false dock-collection-brackets=true -break-separators=before +break-separators=after field-space=tight if-then-else=compact break-sequences=false diff --git a/src/config.ml b/src/config.ml index 304788ae..08fff141 100644 --- a/src/config.ml +++ b/src/config.ml @@ -27,9 +27,9 @@ let currency_to_string = function `Eur -> "EUR" (* Values that represent an amount are in the usual amount syntax: CURRENCY:VALUE.FRACTION, e.g. EUR:1.50. The FRACTION portion may extend up to 8 places. *) type value = { - currency: [ `Eur ] - ; value: int - ; fraction: int + currency: [ `Eur ]; + value: int; + fraction: int; } let currency_round_unit = { currency= `Eur; value= 0; fraction= 1 } diff --git a/src/headers_lib.ml b/src/headers_lib.ml index 3cd4b401..b26f5da1 100644 --- a/src/headers_lib.ml +++ b/src/headers_lib.ml @@ -21,8 +21,8 @@ end = struct (* type for the value of header field *) type header_etag_item = { - weak: bool - ; value: string + weak: bool; + value: string; } type header_value = diff --git a/src/mte.ml b/src/mte.ml index 7c551df1..1b77f44b 100644 --- a/src/mte.ml +++ b/src/mte.ml @@ -110,8 +110,8 @@ let routes = let open Vif.Route in (*let open Vif.Type in*) [ - get (rel /?? nil) --> hello; get (rel / "terms" /?? nil) --> Static.terms - ; get (rel / "privacy" /?? nil) --> Static.privacy + get (rel /?? nil) --> hello; get (rel / "terms" /?? nil) --> Static.terms; + get (rel / "privacy" /?? nil) --> Static.privacy; ] let () = @@ -125,8 +125,8 @@ let () = let devices = Vif.Devices. [ - Management.eddsa_online_key_device - ; Management.rsa_denomination_key_device + Management.eddsa_online_key_device; + Management.rsa_denomination_key_device; ] in let middlewares = Vif.Middlewares.[] in diff --git a/src/types.ml b/src/types.ml index 1774509e..4eb0d672 100644 --- a/src/types.ml +++ b/src/types.ml @@ -3,8 +3,8 @@ module Error_detail = struct (* TODO GANA error codes https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/registry.rec *) type t = { - code: int - ; hint: string option + code: int; + hint: string option; } end @@ -44,10 +44,10 @@ module Amount = struct Prefixed with '+' or '-' in certain contexts. When no sign is present, the amount is assumed to be positive. *) type t = { - sign: [ `Plus | `Minus ] option - ; currency: [ `Eur ] - ; value: Int64.t - ; fraction: Int64.t + sign: [ `Plus | `Minus ] option; + currency: [ `Eur ]; + value: Int64.t; + fraction: Int64.t; } let make ~sign ~currency ~value ~fraction = @@ -88,8 +88,8 @@ module Amount = struct let parse_sign = choice [ - char '+' *> return (Some `Plus); char '-' *> return (Some `Minus) - ; return None + char '+' *> return (Some `Plus); char '-' *> return (Some `Minus); + return None; ] in let parse_currency = string "EUR" *> return `Eur in @@ -132,7 +132,7 @@ module Eddsa = struct (* EdDSA signatures are transmitted as 64-bytes base32 binary-encoded objects with just the R and S values (base32_ binary-only). *) - (*type signature = string*) + type signature = string end module Rsa = struct @@ -152,16 +152,16 @@ end module Rsa_denomination_key = struct type t = { - age_mask: int - ; rsa_pub: string (* Rsa.pub *) + age_mask: int; + rsa_pub: string; (* Rsa.pub *) } end module CS_denomination_key = struct (* Clause Schnorr *) type t = { - age_mask: int - ; cs_pub: string + age_mask: int; + cs_pub: string; } end @@ -170,3 +170,22 @@ module Denomination_key = struct | Rsa of Rsa_denomination_key.t | CS of CS_denomination_key.t end + +module Future_sign_key = struct + type t = { + (* The actual exchange's EdDSA signing public key *) + key: Eddsa.pub; + (* Initial validity date for the signing key. *) + stamp_start: Timestamp.t; + (* Date when the exchange will stop using the signing key, allowed to overlap + slightly with the next signing key's validity to allow for clock skew. *) + stamp_expire: Timestamp.t; + (* Date when all signatures made by the signing key expire and should + henceforth no longer be considered valid in legal disputes. *) + stamp_end: Timestamp.t; + (* Signature over TALER_SigningKeyAnnouncementPS + for this signing key by the signkey security + module using purpose TALER_SIGNATURE_SM_SIGNING_KEY. *) + signkey_secmod_sig: Eddsa.signature; + } +end diff --git a/src/util.ml b/src/util.ml index dc7544c9..047ffc7e 100644 --- a/src/util.ml +++ b/src/util.ml @@ -10,11 +10,11 @@ end module Mimetype = struct let mimetype_extension_assoc = [ - (("text", "plain"), ".txt"); (("text", "markdown"), ".md") - ; (("text", "html"), ".html"); (("text", "html"), ".htm") - ; (("application", "pdf"), ".pdf"); (("image", "jpeg"), ".jpg") - ; (("image", "jpeg"), ".jpeg"); (("image", "png"), ".png") - ; (("image", "gif"), ".gif") + (("text", "plain"), ".txt"); (("text", "markdown"), ".md"); + (("text", "html"), ".html"); (("text", "html"), ".htm"); + (("application", "pdf"), ".pdf"); (("image", "jpeg"), ".jpg"); + (("image", "jpeg"), ".jpeg"); (("image", "png"), ".png"); + (("image", "gif"), ".gif"); ] let mimetype_l, _ = List.split mimetype_extension_assoc diff --git a/test/test.ml b/test/test.ml index 2f33d2f3..dac934bc 100644 --- a/test/test.ml +++ b/test/test.ml @@ -28,10 +28,10 @@ let () = let open Types.Amount in let v = { - sign= Some `Plus - ; currency= `Eur - ; value= Int64.of_int 25 - ; fraction= Int64.of_int 678 + sign= Some `Plus; + currency= `Eur; + value= Int64.of_int 25; + fraction= Int64.of_int 678; } in let s = to_string v in