This commit is contained in:
swrup 2026-02-26 17:24:47 +01:00
parent a21ea0116a
commit ec31459b86

View file

@ -178,7 +178,22 @@ let yes_no = function
| s -> fail "expected `YES`/`NO` value, got `%s`" s | s -> fail "expected `YES`/`NO` value, got `%s`" s
let uri s = Uri.of_string s let uri s = Uri.of_string s
let amount s = s |> Amount.of_string |> unwrap
let amount =
let currency = ref None in
fun s ->
let amount = s |> Amount.of_string |> unwrap in
match !currency with
| None ->
currency := Some amount.currency;
amount
| Some cur -> (
match String.equal amount.currency cur with
| false ->
fail "only one kind of currency is supported, found: `%s` and `%s`."
amount.currency cur
| true -> amount)
let duration s = Config_duration.(s |> parse |> to_time_span) let duration s = Config_duration.(s |> parse |> to_time_span)
let ed25519 s = let ed25519 s =