wip denom caqti; section_name issue
This commit is contained in:
parent
c41ca5b4e2
commit
e870972808
4 changed files with 90 additions and 24 deletions
|
|
@ -2,7 +2,6 @@ open Crypto
|
||||||
|
|
||||||
type t = {
|
type t = {
|
||||||
pub: rsa_pub;
|
pub: rsa_pub;
|
||||||
section_name: string;
|
|
||||||
value: Amount.t;
|
value: Amount.t;
|
||||||
stamp_start: Timestamp.t;
|
stamp_start: Timestamp.t;
|
||||||
stamp_expire_withdraw: Timestamp.t;
|
stamp_expire_withdraw: Timestamp.t;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@ open Syntax
|
||||||
open Api
|
open Api
|
||||||
|
|
||||||
module Keys_get = struct
|
module Keys_get = struct
|
||||||
let mk_future_denom ~sm
|
let mk_future_denom ~sm ~section_name
|
||||||
({
|
({
|
||||||
pub;
|
pub;
|
||||||
section_name;
|
|
||||||
value;
|
value;
|
||||||
stamp_start;
|
stamp_start;
|
||||||
stamp_expire_withdraw;
|
stamp_expire_withdraw;
|
||||||
|
|
@ -75,7 +74,8 @@ module Keys_get = struct
|
||||||
let future_denoms =
|
let future_denoms =
|
||||||
Secmod.get_denoms_data sm
|
Secmod.get_denoms_data sm
|
||||||
|> List.filter (fun k -> Option.is_none k.Denom_data.master_sig)
|
|> List.filter (fun k -> Option.is_none k.Denom_data.master_sig)
|
||||||
|> List.map (fun denom -> mk_future_denom ~sm denom)
|
|> List.map (fun denom ->
|
||||||
|
mk_future_denom ~sm ~section_name:"TODO section_name" denom)
|
||||||
in
|
in
|
||||||
let master_pub = Config.Exchange.master_public_key in
|
let master_pub = Config.Exchange.master_public_key in
|
||||||
let denom_secmod_public_key = Secmod.get_sm_key_pub sm in
|
let denom_secmod_public_key = Secmod.get_sm_key_pub sm in
|
||||||
|
|
|
||||||
103
src/pg.ml
103
src/pg.ml
|
|
@ -42,6 +42,22 @@ module Caqti_type = struct
|
||||||
let wire_method = Caqti_type.string
|
let wire_method = Caqti_type.string
|
||||||
let payto_uri = Caqti_type.string
|
let payto_uri = Caqti_type.string
|
||||||
|
|
||||||
|
include struct
|
||||||
|
(* alias for hash *)
|
||||||
|
|
||||||
|
let fullpayto_hash = FullPaytoHash.caqti
|
||||||
|
let nomalizaedpayto_hash = NormalizedPaytoHash.caqti
|
||||||
|
let denomination_hash = DenominationHash.caqti
|
||||||
|
let privatecontract_hash = PrivateContractHash.caqti
|
||||||
|
let extensionspolicy_hash = ExtensionsPolicyHash.caqti
|
||||||
|
let merchantwire_hash = MerchantWireHash.caqti
|
||||||
|
let agecommitment_hash = AgeCommitmentHash.caqti
|
||||||
|
let blindedcoin_hash = BlindedCoinHash.caqti
|
||||||
|
let coinpub_hash = CoinPubHash.caqti
|
||||||
|
let outputcommitment_hash = OutputCommitmentHash.caqti
|
||||||
|
let planchets_hash = HashPlanchetsP.caqti
|
||||||
|
end
|
||||||
|
|
||||||
let signkey_data =
|
let signkey_data =
|
||||||
let master_sig = Bin_sig.ExchangeSigningKeyValidity.caqti in
|
let master_sig = Bin_sig.ExchangeSigningKeyValidity.caqti in
|
||||||
custom
|
custom
|
||||||
|
|
@ -63,6 +79,76 @@ module Caqti_type = struct
|
||||||
})
|
})
|
||||||
(t5 eddsa_pub time time time master_sig)
|
(t5 eddsa_pub time time time master_sig)
|
||||||
|
|
||||||
|
let denom_data =
|
||||||
|
let master_sig = Bin_sig.DenominationKeyValidity.caqti in
|
||||||
|
custom
|
||||||
|
~encode:(fun
|
||||||
|
Denom_data.
|
||||||
|
{
|
||||||
|
pub;
|
||||||
|
value;
|
||||||
|
stamp_start;
|
||||||
|
stamp_expire_withdraw;
|
||||||
|
stamp_expire_deposit;
|
||||||
|
stamp_expire_legal;
|
||||||
|
fee_withdraw;
|
||||||
|
fee_deposit;
|
||||||
|
fee_refresh;
|
||||||
|
fee_refund;
|
||||||
|
age_mask;
|
||||||
|
h_pub;
|
||||||
|
master_sig;
|
||||||
|
}
|
||||||
|
->
|
||||||
|
match master_sig with
|
||||||
|
| None -> Error "denom_data master_sig is none"
|
||||||
|
| Some master_sig ->
|
||||||
|
Ok
|
||||||
|
( pub,
|
||||||
|
value,
|
||||||
|
stamp_start,
|
||||||
|
stamp_expire_withdraw,
|
||||||
|
stamp_expire_deposit,
|
||||||
|
stamp_expire_legal,
|
||||||
|
fee_withdraw,
|
||||||
|
fee_deposit,
|
||||||
|
fee_refresh,
|
||||||
|
fee_refund,
|
||||||
|
age_mask,
|
||||||
|
(h_pub, master_sig) ))
|
||||||
|
~decode:(fun
|
||||||
|
( pub,
|
||||||
|
value,
|
||||||
|
stamp_start,
|
||||||
|
stamp_expire_withdraw,
|
||||||
|
stamp_expire_deposit,
|
||||||
|
stamp_expire_legal,
|
||||||
|
fee_withdraw,
|
||||||
|
fee_deposit,
|
||||||
|
fee_refresh,
|
||||||
|
fee_refund,
|
||||||
|
age_mask,
|
||||||
|
(h_pub, master_sig) )
|
||||||
|
->
|
||||||
|
Ok
|
||||||
|
{
|
||||||
|
pub;
|
||||||
|
value;
|
||||||
|
stamp_start;
|
||||||
|
stamp_expire_withdraw;
|
||||||
|
stamp_expire_deposit;
|
||||||
|
stamp_expire_legal;
|
||||||
|
fee_withdraw;
|
||||||
|
fee_deposit;
|
||||||
|
fee_refresh;
|
||||||
|
fee_refund;
|
||||||
|
age_mask;
|
||||||
|
h_pub;
|
||||||
|
master_sig= Some master_sig;
|
||||||
|
})
|
||||||
|
(t12 rsa_pub amount time time time time amount amount amount amount int
|
||||||
|
(t2 denomination_hash master_sig))
|
||||||
|
|
||||||
let account_restrictions =
|
let account_restrictions =
|
||||||
custom
|
custom
|
||||||
~encode:(fun l -> Api.encode (Jsont.list AccountRestriction.jsont) l)
|
~encode:(fun l -> Api.encode (Jsont.list AccountRestriction.jsont) l)
|
||||||
|
|
@ -122,22 +208,6 @@ module Caqti_type = struct
|
||||||
Caqti_type.(
|
Caqti_type.(
|
||||||
t9 time time amount amount amount time_span int32 time_span master_sig)
|
t9 time time amount amount amount time_span int32 time_span master_sig)
|
||||||
|
|
||||||
include struct
|
|
||||||
(* alias for hash *)
|
|
||||||
|
|
||||||
let fullpayto_hash = FullPaytoHash.caqti
|
|
||||||
let nomalizaedpayto_hash = NormalizedPaytoHash.caqti
|
|
||||||
let denomination_hash = DenominationHash.caqti
|
|
||||||
let privatecontract_hash = PrivateContractHash.caqti
|
|
||||||
let extensionspolicy_hash = ExtensionsPolicyHash.caqti
|
|
||||||
let merchantwire_hash = MerchantWireHash.caqti
|
|
||||||
let agecommitment_hash = AgeCommitmentHash.caqti
|
|
||||||
let blindedcoin_hash = BlindedCoinHash.caqti
|
|
||||||
let coinpub_hash = CoinPubHash.caqti
|
|
||||||
let outputcommitment_hash = OutputCommitmentHash.caqti
|
|
||||||
let planchets_hash = HashPlanchetsP.caqti
|
|
||||||
end
|
|
||||||
|
|
||||||
include Caqti_request.Infix
|
include Caqti_request.Infix
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -204,7 +274,6 @@ let add_denomination_key =
|
||||||
Denom_data.
|
Denom_data.
|
||||||
{
|
{
|
||||||
pub;
|
pub;
|
||||||
section_name= _;
|
|
||||||
value;
|
value;
|
||||||
stamp_start;
|
stamp_start;
|
||||||
stamp_expire_withdraw;
|
stamp_expire_withdraw;
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@ let db_lookup_denom_data conn ~section_name priv =
|
||||||
Denom_data.
|
Denom_data.
|
||||||
{
|
{
|
||||||
pub;
|
pub;
|
||||||
section_name;
|
|
||||||
value;
|
value;
|
||||||
stamp_start;
|
stamp_start;
|
||||||
stamp_expire_withdraw;
|
stamp_expire_withdraw;
|
||||||
|
|
@ -294,7 +293,7 @@ let make_new_signkey () =
|
||||||
let make_new_denom
|
let make_new_denom
|
||||||
Config.Coin.
|
Config.Coin.
|
||||||
{
|
{
|
||||||
section_name;
|
section_name= _;
|
||||||
value;
|
value;
|
||||||
duration_withdraw;
|
duration_withdraw;
|
||||||
duration_spend;
|
duration_spend;
|
||||||
|
|
@ -325,7 +324,6 @@ let make_new_denom
|
||||||
Denom_data.
|
Denom_data.
|
||||||
{
|
{
|
||||||
pub;
|
pub;
|
||||||
section_name;
|
|
||||||
value;
|
value;
|
||||||
stamp_start;
|
stamp_start;
|
||||||
stamp_expire_withdraw;
|
stamp_expire_withdraw;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue