+ DenomCommon
This commit is contained in:
parent
2570b162db
commit
b5f9e602a3
1 changed files with 39 additions and 0 deletions
39
src/api.ml
39
src/api.ml
|
|
@ -924,3 +924,42 @@ module RecoupDenoms = struct
|
||||||
|> mem "h_denom_pub" HashCode.jsont ~enc:h_denom_pub
|
|> mem "h_denom_pub" HashCode.jsont ~enc:h_denom_pub
|
||||||
|> finish
|
|> finish
|
||||||
end
|
end
|
||||||
|
|
||||||
|
module DenomCommon = struct
|
||||||
|
type t = {
|
||||||
|
master_sig: DenominationKeyValidityPS.t;
|
||||||
|
stamp_start: Timestamp.t;
|
||||||
|
stamp_expire_withdraw: Timestamp.t;
|
||||||
|
stamp_expire_deposit: Timestamp.t;
|
||||||
|
stamp_expire_legal: Timestamp.t;
|
||||||
|
lost: bool option;
|
||||||
|
}
|
||||||
|
|
||||||
|
let jsont =
|
||||||
|
let make master_sig stamp_start stamp_expire_withdraw stamp_expire_deposit
|
||||||
|
stamp_expire_legal lost =
|
||||||
|
{
|
||||||
|
master_sig;
|
||||||
|
stamp_start;
|
||||||
|
stamp_expire_withdraw;
|
||||||
|
stamp_expire_deposit;
|
||||||
|
stamp_expire_legal;
|
||||||
|
lost;
|
||||||
|
}
|
||||||
|
in
|
||||||
|
let master_sig v = v.master_sig in
|
||||||
|
let stamp_start v = v.stamp_start in
|
||||||
|
let stamp_expire_withdraw v = v.stamp_expire_withdraw in
|
||||||
|
let stamp_expire_deposit v = v.stamp_expire_deposit in
|
||||||
|
let stamp_expire_legal v = v.stamp_expire_legal in
|
||||||
|
let lost v = v.lost in
|
||||||
|
let open Jsont.Object in
|
||||||
|
map ~kind:"DenomCommon" make
|
||||||
|
|> mem "master_sig" DenominationKeyValidityPS.jsont ~enc:master_sig
|
||||||
|
|> mem "stamp_start" Timestamp.jsont ~enc:stamp_start
|
||||||
|
|> mem "stamp_expire_withdraw" Timestamp.jsont ~enc:stamp_expire_withdraw
|
||||||
|
|> mem "stamp_expire_deposit" Timestamp.jsont ~enc:stamp_expire_deposit
|
||||||
|
|> mem "stamp_expire_legal" Timestamp.jsont ~enc:stamp_expire_legal
|
||||||
|
|> mem "lost" (Jsont.option Jsont.bool) ~enc:lost
|
||||||
|
|> finish
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue