JJ: Description from the destination commit:
~ JJ: Description from source commit: handle global_fees; add do_management.sh
This commit is contained in:
parent
67bd144bb0
commit
d6f1b704d7
11 changed files with 226 additions and 40 deletions
|
|
@ -9,6 +9,18 @@ let default_request_file = "request.json"
|
|||
(*let to_term_ret = function Error e -> `Error (false, e) | Ok () -> `Ok ()*)
|
||||
let to_term_ret = Fun.id
|
||||
|
||||
let timestamp =
|
||||
Arg.Conv.make ~docv:"timestamp argument" ~parser:Timestamp.of_string
|
||||
~pp:Timestamp.pp ()
|
||||
|
||||
let relative_time =
|
||||
Arg.Conv.make ~docv:"relative time argument" ~parser:Timestamp.Span.of_string
|
||||
~pp:Timestamp.Span.pp ()
|
||||
|
||||
let amount =
|
||||
Arg.Conv.make ~docv:"amount argument" ~parser:Amount.of_string ~pp:Amount.pp
|
||||
()
|
||||
|
||||
let setup_cmd =
|
||||
let doc = "Generate offline master keys" in
|
||||
let output =
|
||||
|
|
@ -94,6 +106,50 @@ let revoke_signkey_cmd =
|
|||
let+ output = output and+ master_key = master_key and+ signkey = signkey in
|
||||
revoke_signkey ~output ~master_key ~signkey |> to_term_ret
|
||||
|
||||
let global_fees_cmd =
|
||||
let doc = "Provides global fee configuration." in
|
||||
let start_date =
|
||||
Arg.(required & opt (some timestamp) None & info [ "start_date" ])
|
||||
in
|
||||
let end_date =
|
||||
Arg.(required & opt (some timestamp) None & info [ "end_date" ])
|
||||
in
|
||||
let history_fee =
|
||||
Arg.(required & opt (some amount) None & info [ "history_fee" ])
|
||||
in
|
||||
let account_fee =
|
||||
Arg.(required & opt (some amount) None & info [ "account_fee" ])
|
||||
in
|
||||
let purse_fee =
|
||||
Arg.(required & opt (some amount) None & info [ "purse_fee" ])
|
||||
in
|
||||
let history_expiration =
|
||||
Arg.(
|
||||
required & opt (some relative_time) None & info [ "history_expiration" ])
|
||||
in
|
||||
let purse_account_limit =
|
||||
Arg.(required & opt (some int) None & info [ "purse_account_limit" ])
|
||||
in
|
||||
let purse_timeout =
|
||||
Arg.(required & opt (some relative_time) None & info [ "purse_timeout" ])
|
||||
in
|
||||
Cmd.make (Cmd.info "global-fees" ~doc)
|
||||
@@
|
||||
let+ output = output
|
||||
and+ master_key = master_key
|
||||
and+ start_date = start_date
|
||||
and+ end_date = end_date
|
||||
and+ history_fee = history_fee
|
||||
and+ account_fee = account_fee
|
||||
and+ purse_fee = purse_fee
|
||||
and+ history_expiration = history_expiration
|
||||
and+ purse_account_limit = purse_account_limit
|
||||
and+ purse_timeout = purse_timeout in
|
||||
global_fees ~output ~master_key ~start_date ~end_date ~history_fee
|
||||
~account_fee ~purse_fee ~history_expiration ~purse_account_limit
|
||||
~purse_timeout
|
||||
|> to_term_ret
|
||||
|
||||
let cli =
|
||||
let info =
|
||||
let doc = "MTE Offline CLI tool" in
|
||||
|
|
@ -107,6 +163,7 @@ let cli =
|
|||
upload_cmd;
|
||||
revoke_denom_cmd;
|
||||
revoke_signkey_cmd;
|
||||
global_fees_cmd;
|
||||
]
|
||||
|
||||
let main () = Cmd.eval_result cli
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue