+ type for signature
This commit is contained in:
parent
eb56150120
commit
577b2117a4
5 changed files with 217 additions and 201 deletions
19
src/api.ml
19
src/api.ml
|
|
@ -6,6 +6,7 @@
|
|||
- better types
|
||||
- issues with "never" = uint64_max *)
|
||||
open Crypto
|
||||
open Bin_signature
|
||||
|
||||
let encode_exn jsont v = Jsont_bytesrw.encode_string jsont v |> Result.get_ok
|
||||
let encode jsont v = Jsont_bytesrw.encode_string jsont v
|
||||
|
|
@ -138,7 +139,7 @@ module FutureSignKey = struct
|
|||
stamp_start: Timestamp.t;
|
||||
stamp_expire: Timestamp.t;
|
||||
stamp_end: Timestamp.t;
|
||||
signkey_secmod_sig: EddsaSignature.t;
|
||||
signkey_secmod_sig: SigningKeyAnnouncementPS.t;
|
||||
}
|
||||
|
||||
let jsont =
|
||||
|
|
@ -156,7 +157,8 @@ module FutureSignKey = struct
|
|||
|> mem "stamp_start" Timestamp.jsont ~enc:stamp_start
|
||||
|> mem "stamp_expire" Timestamp.jsont ~enc:stamp_expire
|
||||
|> mem "stamp_end" Timestamp.jsont ~enc:stamp_end
|
||||
|> mem "signkey_secmod_sig" EddsaSignature.jsont ~enc:signkey_secmod_sig
|
||||
|> mem "signkey_secmod_sig" SigningKeyAnnouncementPS.jsont
|
||||
~enc:signkey_secmod_sig
|
||||
|> finish
|
||||
end
|
||||
|
||||
|
|
@ -173,7 +175,7 @@ module FutureDenom = struct
|
|||
fee_deposit: Amount.t;
|
||||
fee_refresh: Amount.t;
|
||||
fee_refund: Amount.t;
|
||||
denom_secmod_sig: Bin_signature.DenominationKeyAnnouncementPS.Sig.t;
|
||||
denom_secmod_sig: DenominationKeyAnnouncementPS.t;
|
||||
}
|
||||
|
||||
let jsont =
|
||||
|
|
@ -220,8 +222,7 @@ module FutureDenom = struct
|
|||
|> mem "fee_deposit" Amount.jsont ~enc:fee_deposit
|
||||
|> mem "fee_refresh" Amount.jsont ~enc:fee_refresh
|
||||
|> mem "fee_refund" Amount.jsont ~enc:fee_refund
|
||||
|> mem "denom_secmod_sig"
|
||||
Bin_signature.DenominationKeyAnnouncementPS.Sig.jsont
|
||||
|> mem "denom_secmod_sig" DenominationKeyAnnouncementPS.jsont
|
||||
~enc:denom_secmod_sig
|
||||
|> finish
|
||||
end
|
||||
|
|
@ -268,7 +269,7 @@ end
|
|||
module SignKeySignature = struct
|
||||
type t = {
|
||||
key: EddsaPublicKey.t;
|
||||
master_sig: EddsaSignature.t;
|
||||
master_sig: ExchangeSigningKeyValidityPS.t;
|
||||
}
|
||||
|
||||
let jsont =
|
||||
|
|
@ -278,14 +279,14 @@ module SignKeySignature = struct
|
|||
let open Jsont.Object in
|
||||
map ~kind:"SignKeySignature" make
|
||||
|> mem "key" EddsaPublicKey.jsont ~enc:key
|
||||
|> mem "master_sig" EddsaSignature.jsont ~enc:master_sig
|
||||
|> mem "master_sig" ExchangeSigningKeyValidityPS.jsont ~enc:master_sig
|
||||
|> finish
|
||||
end
|
||||
|
||||
module DenomSignature = struct
|
||||
type t = {
|
||||
h_denom_pub: HashCode.t;
|
||||
master_sig: EddsaSignature.t;
|
||||
master_sig: DenominationKeyValidityPS.t;
|
||||
}
|
||||
|
||||
let jsont =
|
||||
|
|
@ -295,7 +296,7 @@ module DenomSignature = struct
|
|||
let open Jsont.Object in
|
||||
map ~kind:"DenomSignature" make
|
||||
|> mem "h_denom_pub" HashCode.jsont ~enc:h_denom_pub
|
||||
|> mem "master_sig" EddsaSignature.jsont ~enc:master_sig
|
||||
|> mem "master_sig" DenominationKeyValidityPS.jsont ~enc:master_sig
|
||||
|> finish
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue