Skip to content

Commit

Permalink
implement delegate keys command (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvid authored Jul 13, 2021
1 parent 862a746 commit b225993
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions module/x/gravity/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,22 @@ func CmdSetDelegateKeys() *cobra.Command {
cmd := &cobra.Command{
Use: "set-delegate-keys [validator-address] [orchestrator-address] [ethereum-address]",
Args: cobra.ExactArgs(3),
Short: "", // TODO(levi) provide short description
Short: "Set gravity delegate keys",
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}

var ( // args
valAddr sdk.ValAddress // TODO(levi) init and validate from args[0]
orcAddr sdk.AccAddress // TODO(levi) init and validate from args[1]
ethAddr string // TODO(levi) init and validate from args[2]
)
valAddr, err := sdk.ValAddressFromHex(args[0])
if err != nil {
return err
}
orcAddr, err := sdk.AccAddressFromHex(args[1])
if err != nil {
return err
}
ethAddr := args[2]

msg := types.NewMsgDelegateKeys(valAddr, orcAddr, ethAddr)
if err = msg.ValidateBasic(); err != nil {
Expand Down

0 comments on commit b225993

Please sign in to comment.