This commit is contained in:
parent
af355249fc
commit
06b96ddd09
2 changed files with 3 additions and 4 deletions
|
|
@ -15,7 +15,6 @@ open Crypto
|
||||||
open Signatures
|
open Signatures
|
||||||
module DenominationHash = Hash.DenominationHash
|
module DenominationHash = Hash.DenominationHash
|
||||||
|
|
||||||
let encode_exn jsont v = Jsont_bytesrw.encode_string jsont v |> Result.get_ok
|
|
||||||
let encode jsont v = Jsont_bytesrw.encode_string jsont v
|
let encode jsont v = Jsont_bytesrw.encode_string jsont v
|
||||||
let decode jsont v = Jsont_bytesrw.decode_string jsont v
|
let decode jsont v = Jsont_bytesrw.decode_string jsont v
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -234,12 +234,12 @@ let keys req server _env =
|
||||||
let* last_issue_date =
|
let* last_issue_date =
|
||||||
match Vif.Queries.get req "last_issue_date" with
|
match Vif.Queries.get req "last_issue_date" with
|
||||||
| [] -> Ok None
|
| [] -> Ok None
|
||||||
| v :: _ -> (
|
| s :: _ -> (
|
||||||
match int_of_string_opt v with
|
match Int64.of_string_opt s with
|
||||||
| None ->
|
| None ->
|
||||||
Error
|
Error
|
||||||
"invalid `?last_issue_date` query param, int_of_string failure"
|
"invalid `?last_issue_date` query param, int_of_string failure"
|
||||||
| Some n -> Ok (Some (Time.Timestamp.of_s (Int64.of_int n))))
|
| Some n -> Ok (Some (Timestamp.of_s n)))
|
||||||
in
|
in
|
||||||
let* v = mk_keys ~db_conn keys ~last_issue_date in
|
let* v = mk_keys ~db_conn keys ~last_issue_date in
|
||||||
let s = Api.encode_exn jsont v in
|
let s = Api.encode_exn jsont v in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue