+ AuditorDenominationKey

This commit is contained in:
swrup 2025-12-04 17:59:07 +01:00
parent e19db93d2c
commit 8a6ee6cfda
2 changed files with 84 additions and 17 deletions

View file

@ -840,3 +840,20 @@ module AggregateTransferFee = struct
|> mem "sig" MasterWireFeePS.jsont ~enc:sig_ |> mem "sig" MasterWireFeePS.jsont ~enc:sig_
|> finish |> finish
end end
module AuditorDenominationKey = struct
type t = {
denom_pub_h: HashCode.t;
auditor_sig: ExchangeKeyValidityPS.t;
}
let jsont =
let make denom_pub_h auditor_sig = { denom_pub_h; auditor_sig } in
let denom_pub_h v = v.denom_pub_h in
let auditor_sig v = v.auditor_sig in
let open Jsont.Object in
map ~kind:"AuditorDenominationKey" make
|> mem "denom_pub_h" HashCode.jsont ~enc:denom_pub_h
|> mem "auditor_sig" ExchangeKeyValidityPS.jsont ~enc:auditor_sig
|> finish
end

View file

@ -635,6 +635,73 @@ module MasterWireFeePS = struct
include MK (R) include MK (R)
end end
module ExchangeKeyValidityPS = struct
module R = struct
(* purpose.purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS *)
type r = {
auditor_url_hash: Hash_64_cstr.t;
master: MasterPublicKeyP.t;
start: TimeAbsoluteNBO.t;
expire_withdraw: TimeAbsoluteNBO.t;
expire_spend: TimeAbsoluteNBO.t;
expire_legal: TimeAbsoluteNBO.t;
value: AmountNBO.t;
fee_withdraw: AmountNBO.t;
fee_deposit: AmountNBO.t;
fee_refresh: AmountNBO.t;
denom_hash: DenominationHash.t;
}
let bin =
let open Bin in
Purpose.make_bin Taler_signatures.auditor_exchange_keys @@ fun _purpose ->
record
(fun
_purpose
auditor_url_hash
master
start
expire_withdraw
expire_spend
expire_legal
value
fee_withdraw
fee_deposit
fee_refresh
denom_hash
->
{
auditor_url_hash;
master;
start;
expire_withdraw;
expire_spend;
expire_legal;
value;
fee_withdraw;
fee_deposit;
fee_refresh;
denom_hash;
})
|+ Purpose.field _purpose
|+ field Hash_64_cstr.bin (fun t -> t.auditor_url_hash)
|+ field MasterPublicKeyP.bin (fun t -> t.master)
|+ field TimeAbsoluteNBO.bin (fun t -> t.start)
|+ field TimeAbsoluteNBO.bin (fun t -> t.expire_withdraw)
|+ field TimeAbsoluteNBO.bin (fun t -> t.expire_spend)
|+ field TimeAbsoluteNBO.bin (fun t -> t.expire_legal)
|+ field AmountNBO.bin (fun t -> t.value)
|+ field AmountNBO.bin (fun t -> t.fee_withdraw)
|+ field AmountNBO.bin (fun t -> t.fee_deposit)
|+ field AmountNBO.bin (fun t -> t.fee_refresh)
|+ field DenominationHash.bin (fun t -> t.denom_hash)
|> sealr
end
include R
include MK (R)
end
(* ### BIN IMPL END ### *) (* ### BIN IMPL END ### *)
module WithdrawRequestPS = struct module WithdrawRequestPS = struct
@ -783,23 +850,6 @@ module WireDepositDataPS = struct
} }
end end
module ExchangeKeyValidityPS = struct
(* purpose.purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS *)
type t = {
auditor_url_hash: Hash_64_cstr.t;
master: MasterPublicKeyP.t;
start: TimeAbsoluteNBO.t;
expire_withdraw: TimeAbsoluteNBO.t;
expire_spend: TimeAbsoluteNBO.t;
expire_legal: TimeAbsoluteNBO.t;
value: AmountNBO.t;
fee_withdraw: AmountNBO.t;
fee_deposit: AmountNBO.t;
fee_refresh: AmountNBO.t;
denom_hash: DenominationHash.t;
}
end
module PaymentResponsePS = struct module PaymentResponsePS = struct
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK *) (* purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK *)
type t = { h_contract_terms: PrivateContractHash.t } type t = { h_contract_terms: PrivateContractHash.t }