~ todos
This commit is contained in:
parent
650264f21e
commit
0ab6bc7b3e
11 changed files with 15 additions and 31 deletions
|
|
@ -1,8 +1,4 @@
|
|||
(* TODO
|
||||
have a currency agnostic amount_lib.ml
|
||||
and specialize amount.ml to Config.currency??
|
||||
|
||||
have safe amount arithmetic *)
|
||||
(* TODO implement operations on amounts *)
|
||||
open Syntax
|
||||
|
||||
type sign =
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@ module Bytes64 = struct
|
|||
~decode:of_octets Caqti_type.octets
|
||||
end
|
||||
|
||||
(* TODO error response
|
||||
- use GANA error codes
|
||||
https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/registry.rec *)
|
||||
module ErrorDetail = struct
|
||||
type t = {
|
||||
code: int;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ let accept_header_value =
|
|||
let avail_languages_header_value =
|
||||
Fmt.str "%a" (Fmt.array ~sep:(Fmt.any ", ") Fmt.string) Assets.Language.arr
|
||||
|
||||
(* TODO Cohttp raises on invalid *)
|
||||
(* TODO better headers_lib
|
||||
Cohttp raises on invalid *)
|
||||
let select_mimetype headers =
|
||||
let opt = Vif.Headers.get headers "accept" in
|
||||
Cohttp.Accept.media_ranges opt
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
open Syntax
|
||||
open Crypto
|
||||
|
||||
(* TODO better error type *)
|
||||
type 'a result = ('a, string) Result.t
|
||||
|
||||
module type S = sig
|
||||
|
|
@ -33,8 +32,8 @@ module Make (Conn : Pg.CONN) : S = struct
|
|||
|
||||
let conn = (module Conn : Pg.CONN)
|
||||
|
||||
(* TODO
|
||||
error "key not found", either:
|
||||
(* TODO better error
|
||||
can only be "key not found", either:
|
||||
- we tried to sign with a key that is not ours
|
||||
- key was revoked
|
||||
- bad keyring state *)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
(* TODO
|
||||
can we avoid amount tuple boilerplate?
|
||||
clean up caqti error type
|
||||
|
||||
transaction
|
||||
|
||||
GNU Taler use of db-events?
|
||||
it seems caqti/pgx does not support it *)
|
||||
GNU Taler use of db-events? it seems caqti/pgx does not support it *)
|
||||
|
||||
module type CONN = Caqti_miou.CONNECTION
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
(* TODO response
|
||||
use ErrorDetail *)
|
||||
|
||||
let encode_error_detail err =
|
||||
match Api.(encode ErrorDetail.jsont err) with
|
||||
| Error e -> Fmt.failwith "json encoding error on `ErrorDetail`: %s." e
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ let split_in_periodes ~start ~end_ =
|
|||
in
|
||||
go acc start end_
|
||||
|
||||
(* TODO do not exceed lookahead (probably more important...) *)
|
||||
(* TODO do not exceed lookahead *)
|
||||
(* try to not generate keys with validity start in the past *)
|
||||
let gen_additional_keys_until_lookahead ~now l =
|
||||
let start =
|
||||
|
|
@ -118,7 +118,6 @@ let gen_additional_keys_until_lookahead ~now l =
|
|||
let new_keys = List.map (fun (t1, t2) -> gen_key t1 t2) periodes in
|
||||
new_keys
|
||||
|
||||
(* TODO config *)
|
||||
let sm_key_fpath =
|
||||
Result.get_ok
|
||||
@@
|
||||
|
|
@ -221,5 +220,5 @@ end
|
|||
- more checks
|
||||
- sign: check timestamps before signing
|
||||
- schedule tasks
|
||||
- !lock
|
||||
- ! use lock
|
||||
*)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
let ( let* ) o f = match o with Ok v -> f v | Error _ as e -> e
|
||||
let ( let+ ) o f = match o with Ok v -> Ok (f v) | Error _ as e -> e
|
||||
|
||||
(* TODO use polymorphic variant for errors *)
|
||||
(* TODO better errors
|
||||
use polymorphic variant for errors
|
||||
use GANA error codes:
|
||||
https://git.gnunet.org/gana.git/tree/gnu-taler-error-codes/registry.rec *)
|
||||
let unwrap_err_msg o = match o with Error (`Msg e) -> Error e | Ok v -> Ok v
|
||||
|
||||
let unwrap_err_caqti o =
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ module Timestamp : sig
|
|||
val of_absolute : TimeAbsolute.t -> t
|
||||
val of_ptime : Ptime.t -> t
|
||||
|
||||
(* TODO add pp *)
|
||||
(* - *)
|
||||
val bin : t Bin.t
|
||||
val caqti : t Caqti_type.t
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ let () =
|
|||
check Timestamp.jsont {|{"t_s": "never"}|};
|
||||
check_bad Timestamp.jsont {|{"t_s": "123456780"}|};
|
||||
check_bad Timestamp.jsont {|{"t_s": "agagou"}|};
|
||||
|
||||
(* TODO CS not implemented *)
|
||||
check_bad DenominationKey.jsont
|
||||
{|{"cipher": "CS", "age_mask": 18, "cs_pub": "ouhagag"}|};
|
||||
()
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ let keys content =
|
|||
else Fmt.error "version incompatible"
|
||||
in
|
||||
|
||||
(* TODO validate ExchangeWireAccount
|
||||
need hash over json *)
|
||||
(* TODO json hash
|
||||
validate wire *)
|
||||
let* () =
|
||||
let open AggregateTransferFee in
|
||||
v.wire_fees
|
||||
|
|
@ -52,7 +52,7 @@ let keys content =
|
|||
match opt with
|
||||
| None -> Fmt.error "exchange_pub is not in signkeys list"
|
||||
| Some _sk ->
|
||||
(* TODO add a --now option?
|
||||
(* todo add a --now option if we want to validate timestamps
|
||||
let now = Timestamp.of_ptime (Ptime_clock.now ()) in
|
||||
if Signkey.is_valid_at ~timestamp:now sk then Ok ()
|
||||
else Fmt.error "exchange_pub is not valid at the current time"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue