+ AmlOfficerSetup
This commit is contained in:
parent
3bfbaf4ccd
commit
fb1d8efa3c
2 changed files with 68 additions and 16 deletions
47
src/api.ml
47
src/api.ml
|
|
@ -555,11 +555,7 @@ module DrainProfitsMessage = struct
|
||||||
debit_account_section: string;
|
debit_account_section: string;
|
||||||
credit_payto_uri: string;
|
credit_payto_uri: string;
|
||||||
wtid: B32.t;
|
wtid: B32.t;
|
||||||
(*
|
master_sig: MasterDrainProfitPS.t;
|
||||||
// TALER_MasterDrainProfitPS.
|
|
||||||
// Must have purpose TALER_SIGNATURE_MASTER_DRAIN_PROFITS.
|
|
||||||
*)
|
|
||||||
master_sig: EddsaSignature.t;
|
|
||||||
date: Timestamp.t;
|
date: Timestamp.t;
|
||||||
amount: Amount.t;
|
amount: Amount.t;
|
||||||
}
|
}
|
||||||
|
|
@ -587,8 +583,47 @@ module DrainProfitsMessage = struct
|
||||||
|> mem "debit_account_section" Jsont.string ~enc:debit_account_section
|
|> mem "debit_account_section" Jsont.string ~enc:debit_account_section
|
||||||
|> mem "credit_payto_uri" Jsont.string ~enc:credit_payto_uri
|
|> mem "credit_payto_uri" Jsont.string ~enc:credit_payto_uri
|
||||||
|> mem "wtid" B32.jsont ~enc:wtid
|
|> mem "wtid" B32.jsont ~enc:wtid
|
||||||
|> mem "master_sig" EddsaSignature.jsont ~enc:master_sig
|
|> mem "master_sig" MasterDrainProfitPS.jsont ~enc:master_sig
|
||||||
|> mem "date" Timestamp.jsont ~enc:date
|
|> mem "date" Timestamp.jsont ~enc:date
|
||||||
|> mem "amount" Amount.jsont ~enc:amount
|
|> mem "amount" Amount.jsont ~enc:amount
|
||||||
|> finish
|
|> finish
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module AmlOfficerSetup = struct
|
||||||
|
type t = {
|
||||||
|
officer_pub: EddsaPublicKey.t;
|
||||||
|
officer_name: string;
|
||||||
|
is_active: bool;
|
||||||
|
read_only: bool;
|
||||||
|
master_sig: MasterAmlOfficerStatusPS.t;
|
||||||
|
change_date: Timestamp.t;
|
||||||
|
}
|
||||||
|
|
||||||
|
let jsont =
|
||||||
|
let make officer_pub officer_name is_active read_only master_sig change_date
|
||||||
|
=
|
||||||
|
{
|
||||||
|
officer_pub;
|
||||||
|
officer_name;
|
||||||
|
is_active;
|
||||||
|
read_only;
|
||||||
|
master_sig;
|
||||||
|
change_date;
|
||||||
|
}
|
||||||
|
in
|
||||||
|
let officer_pub v = v.officer_pub in
|
||||||
|
let officer_name v = v.officer_name in
|
||||||
|
let is_active v = v.is_active in
|
||||||
|
let read_only v = v.read_only in
|
||||||
|
let master_sig v = v.master_sig in
|
||||||
|
let change_date v = v.change_date in
|
||||||
|
let open Jsont.Object in
|
||||||
|
map ~kind:"AmlOfficerSetup" make
|
||||||
|
|> mem "officer_pub" EddsaPublicKey.jsont ~enc:officer_pub
|
||||||
|
|> mem "officer_name" Jsont.string ~enc:officer_name
|
||||||
|
|> mem "is_active" Jsont.bool ~enc:is_active
|
||||||
|
|> mem "read_only" Jsont.bool ~enc:read_only
|
||||||
|
|> mem "master_sig" MasterAmlOfficerStatusPS.jsont ~enc:master_sig
|
||||||
|
|> mem "change_date" Timestamp.jsont ~enc:change_date
|
||||||
|
|> finish
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -488,6 +488,33 @@ module MasterDrainProfitPS = struct
|
||||||
include MK (R)
|
include MK (R)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module MasterAmlOfficerStatusPS = struct
|
||||||
|
module R = struct
|
||||||
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY *)
|
||||||
|
type r = {
|
||||||
|
change_date: TimestampNBO.t;
|
||||||
|
officer_pub: AmlOfficerPublicKeyP.t;
|
||||||
|
h_officer_name: Hash_64_cstr.t;
|
||||||
|
is_active: int32;
|
||||||
|
}
|
||||||
|
|
||||||
|
let bin =
|
||||||
|
let open Bin in
|
||||||
|
Purpose.make_bin Taler_signatures.master_aml_key @@ fun _purpose ->
|
||||||
|
record (fun _purpose change_date officer_pub h_officer_name is_active ->
|
||||||
|
{ change_date; officer_pub; h_officer_name; is_active })
|
||||||
|
|+ Purpose.field _purpose
|
||||||
|
|+ field TimestampNBO.bin (fun t -> t.change_date)
|
||||||
|
|+ field AmlOfficerPublicKeyP.bin (fun t -> t.officer_pub)
|
||||||
|
|+ field Hash_64_cstr.bin (fun t -> t.h_officer_name)
|
||||||
|
|+ field beint32 (fun t -> t.is_active)
|
||||||
|
|> sealr
|
||||||
|
end
|
||||||
|
|
||||||
|
include R
|
||||||
|
include MK (R)
|
||||||
|
end
|
||||||
|
|
||||||
(* ### BIN IMPL END ### *)
|
(* ### BIN IMPL END ### *)
|
||||||
|
|
||||||
module WithdrawRequestPS = struct
|
module WithdrawRequestPS = struct
|
||||||
|
|
@ -955,16 +982,6 @@ module CoinPurseRefundConfirmationPS = struct
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
module MasterAmlOfficerStatusPS = struct
|
|
||||||
(* purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY *)
|
|
||||||
type t = {
|
|
||||||
change_date: TimestampNBO.t;
|
|
||||||
officer_pub: AmlOfficerPublicKeyP.t;
|
|
||||||
h_officer_name: Hash_64_cstr.t;
|
|
||||||
is_active: int;
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
module AmlDecisionPS = struct
|
module AmlDecisionPS = struct
|
||||||
(* purpose.purpose = TALER_SIGNATURE_AML_DECISION *)
|
(* purpose.purpose = TALER_SIGNATURE_AML_DECISION *)
|
||||||
type t = {
|
type t = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue