handle global_fees; add do_management.sh
This commit is contained in:
parent
28872cb239
commit
7305a1b7b5
11 changed files with 210 additions and 20 deletions
|
|
@ -75,3 +75,54 @@ let revoke_signkey ~output ~master_key ~signkey =
|
|||
let* s = Api.encode Api.SignkeyRevocationSignature.jsont v in
|
||||
let* () = write_file output s in
|
||||
Ok ()
|
||||
|
||||
let global_fees ~output ~master_key ~start_date ~end_date ~history_fee
|
||||
~account_fee ~purse_fee ~history_expiration ~purse_account_limit
|
||||
~purse_timeout =
|
||||
let open Crypto in
|
||||
let* key = read_file master_key in
|
||||
let* key = EddsaPrivateKey.of_octets key in
|
||||
let* purse_account_limit =
|
||||
match
|
||||
purse_account_limit >= 0
|
||||
&& purse_account_limit <= Int32.to_int Int32.max_int
|
||||
with
|
||||
| false -> Error "invalid purse_account_limit value"
|
||||
| true -> Ok (Int32.of_int purse_account_limit)
|
||||
in
|
||||
let master_sig =
|
||||
let open Bin_sig.GlobalFees in
|
||||
(* TODO KYC *)
|
||||
let kyc_timeout = None in
|
||||
let kyc_fee = Amount.dummy_value in
|
||||
sign_f ~f:(EddsaSignature.sign ~key)
|
||||
{
|
||||
start_date;
|
||||
end_date;
|
||||
purse_timeout;
|
||||
kyc_timeout;
|
||||
history_expiration;
|
||||
history_fee;
|
||||
kyc_fee;
|
||||
account_fee;
|
||||
purse_fee;
|
||||
purse_account_limit;
|
||||
}
|
||||
in
|
||||
let global_fees =
|
||||
Api.GlobalFees.
|
||||
{
|
||||
start_date;
|
||||
end_date;
|
||||
purse_timeout;
|
||||
history_expiration;
|
||||
history_fee;
|
||||
account_fee;
|
||||
purse_fee;
|
||||
purse_account_limit;
|
||||
master_sig;
|
||||
}
|
||||
in
|
||||
let* s = Api.encode Api.GlobalFees.jsont global_fees in
|
||||
let* () = write_file output s in
|
||||
Ok ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue