Client: use source_param instead of alias_param
This commit is contained in:
parent
3765c39477
commit
19843b96b0
@ -21,7 +21,7 @@ let commands () =
|
||||
(args5 max_priority_arg endorsement_delay_arg
|
||||
Daemon.baking_switch Daemon.endorsement_switch Daemon.denunciation_switch)
|
||||
(prefixes [ "launch" ; "daemon" ]
|
||||
@@ seq_of_param Client_keys.Public_key_hash.alias_param)
|
||||
@@ seq_of_param Client_keys.Public_key_hash.source_param)
|
||||
(fun (max_priority, endorsement_delay, baking, endorsement, denunciation) delegates cctxt ->
|
||||
let (endorsement, baking, denunciation) =
|
||||
if (not endorsement) && (not baking) && (not denunciation)
|
||||
@ -31,18 +31,18 @@ let commands () =
|
||||
command ~group ~desc: "Forge and inject an endorsement operation."
|
||||
(args1 max_priority_arg)
|
||||
(prefixes [ "endorse"; "for" ]
|
||||
@@ Client_keys.Public_key_hash.alias_param
|
||||
@@ Client_keys.Public_key_hash.source_param
|
||||
~name:"baker" ~desc: "name of the delegate owning the endorsement right"
|
||||
@@ stop)
|
||||
(fun max_priority (_, delegate) cctxt ->
|
||||
(fun max_priority delegate cctxt ->
|
||||
endorse_block cctxt ?max_priority delegate) ;
|
||||
command ~group ~desc: "Forge and inject block using the delegate rights."
|
||||
(args3 max_priority_arg force_switch free_baking_switch)
|
||||
(prefixes [ "bake"; "for" ]
|
||||
@@ Client_keys.Public_key_hash.alias_param
|
||||
@@ Client_keys.Public_key_hash.source_param
|
||||
~name:"baker" ~desc: "name of the delegate owning the baking right"
|
||||
@@ stop)
|
||||
(fun (max_priority, force, free_baking) (_, delegate) cctxt ->
|
||||
(fun (max_priority, force, free_baking) delegate cctxt ->
|
||||
bake_block cctxt cctxt#block
|
||||
~force ?max_priority ~free_baking delegate) ;
|
||||
command ~group ~desc: "Forge and inject a seed-nonce revelation operation."
|
||||
|
@ -105,4 +105,4 @@ let run_daemon cctxt ?max_priority ~endorsement_delay delegates ~endorsement ~ba
|
||||
~delay:endorsement_delay
|
||||
~min_date:((Time.add (Time.now ()) (Int64.neg 1800L)))
|
||||
~endorsement ~baking ~denunciation
|
||||
(List.map snd delegates)
|
||||
delegates
|
||||
|
@ -51,7 +51,7 @@ val run_daemon:
|
||||
#Proto_alpha.full ->
|
||||
?max_priority:int ->
|
||||
endorsement_delay:int ->
|
||||
('a * public_key_hash) list ->
|
||||
public_key_hash list ->
|
||||
endorsement:bool ->
|
||||
baking:bool ->
|
||||
denunciation:bool ->
|
||||
|
@ -187,17 +187,17 @@ let commands () =
|
||||
@@ RawContractAlias.fresh_alias_param
|
||||
~name: "new" ~desc: "name of the new contract"
|
||||
@@ prefix "for"
|
||||
@@ Public_key_hash.alias_param
|
||||
@@ Public_key_hash.source_param
|
||||
~name: "mgr" ~desc: "manager of the new contract"
|
||||
@@ prefix "transferring"
|
||||
@@ tez_param
|
||||
~name: "qty" ~desc: "amount taken from source"
|
||||
@@ prefix "from"
|
||||
@@ ContractAlias.alias_param
|
||||
@@ ContractAlias.destination_param
|
||||
~name:"src" ~desc: "name of the source contract"
|
||||
@@ stop)
|
||||
begin fun (fee, delegate, delegatable, force)
|
||||
new_contract (_, manager_pkh) balance (_, source) (cctxt : Proto_alpha.full) ->
|
||||
new_contract manager_pkh balance (_, source) (cctxt : Proto_alpha.full) ->
|
||||
RawContractAlias.of_fresh cctxt force new_contract >>=? fun alias_name ->
|
||||
source_to_keys cctxt cctxt#block source >>=? fun (src_pk, src_sk) ->
|
||||
originate_account
|
||||
@ -224,13 +224,13 @@ let commands () =
|
||||
@@ RawContractAlias.fresh_alias_param
|
||||
~name: "new" ~desc: "name of the new contract"
|
||||
@@ prefix "for"
|
||||
@@ Public_key_hash.alias_param
|
||||
@@ Public_key_hash.source_param
|
||||
~name: "mgr" ~desc: "manager of the new contract"
|
||||
@@ prefix "transferring"
|
||||
@@ tez_param
|
||||
~name: "qty" ~desc: "amount taken from source"
|
||||
@@ prefix "from"
|
||||
@@ ContractAlias.alias_param
|
||||
@@ ContractAlias.destination_param
|
||||
~name:"src" ~desc: "name of the source contract"
|
||||
@@ prefix "running"
|
||||
@@ Program.source_param
|
||||
@ -238,7 +238,7 @@ let commands () =
|
||||
Combine with -init if the storage type is not unit."
|
||||
@@ stop)
|
||||
begin fun (fee, delegate, force, delegatable, spendable, initial_storage, no_print_source)
|
||||
alias_name (_, manager) balance (_, source) program (cctxt : Proto_alpha.full) ->
|
||||
alias_name manager balance (_, source) program (cctxt : Proto_alpha.full) ->
|
||||
RawContractAlias.of_fresh cctxt force alias_name >>=? fun alias_name ->
|
||||
Lwt.return (Micheline_parser.no_parsing_error program) >>=? fun { expanded = code } ->
|
||||
source_to_keys cctxt cctxt#block source >>=? fun (src_pk, src_sk) ->
|
||||
@ -290,11 +290,11 @@ let commands () =
|
||||
command ~group ~desc: "Register the public key hash as a delegate."
|
||||
(args1 fee_arg)
|
||||
(prefixes [ "register" ; "key" ]
|
||||
@@ Public_key_hash.alias_param
|
||||
@@ Public_key_hash.source_param
|
||||
~name: "mgr" ~desc: "the delegate key"
|
||||
@@ prefixes [ "as" ; "delegate" ]
|
||||
@@ stop)
|
||||
begin fun fee (_, src_pkh) cctxt ->
|
||||
begin fun fee src_pkh cctxt ->
|
||||
Client_keys.get_key cctxt src_pkh >>=? fun (_, src_pk, src_sk) ->
|
||||
register_as_delegate cctxt
|
||||
~fee cctxt#block ~manager_sk:src_sk src_pk >>=? fun oph ->
|
||||
|
@ -192,9 +192,9 @@ let commands () =
|
||||
@@ Clic.param ~name:"type" ~desc:"type of the data"
|
||||
data_parameter
|
||||
@@ prefixes [ "for" ]
|
||||
@@ Client_keys.Secret_key.alias_param
|
||||
@@ Client_keys.Secret_key.source_param
|
||||
@@ stop)
|
||||
(fun () data typ (_, sk) cctxt ->
|
||||
(fun () data typ sk cctxt ->
|
||||
Client_proto_programs.hash_and_sign data typ sk cctxt#block cctxt >>= begin function
|
||||
| Ok (hash, signature) ->
|
||||
cctxt#message "@[<v 0>Hash: %S@,Signature: %S@]" hash signature
|
||||
|
Loading…
Reference in New Issue
Block a user