Skip to content

R4R: CLI flags to args#3503

Merged
jackzampolin merged 5 commits intodevelopfrom
jack/cli-args
Feb 7, 2019
Merged

R4R: CLI flags to args#3503
jackzampolin merged 5 commits intodevelopfrom
jack/cli-args

Conversation

@jackzampolin
Copy link
Copy Markdown
Contributor

cc @alessio and @alexanderbez

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

}

// MessageOutput respects CLI flags and outputs a message
func MessageOutput(cliCtx context.CLIContext, txBldr authtxb.TxBuilder, msgs []sdk.Msg, offline bool) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon MessageOutput is a misnomer as it does not describe this function's main purpose. What this function does is actually executing the transaction according to the flags set in the context. As a side effect, it prints the response.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you like this to be called?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HandleTxExecResponse? Dunno, it's a tricky one, though we'd better get it right now.

CC'ing @cwgoes @alexanderbez

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to go with GenerateOrBroadcastMsgs per discussions with @alessio and @alexanderbez

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 5, 2019

Codecov Report

Merging #3503 into develop will decrease coverage by 0.43%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##           develop    #3503      +/-   ##
===========================================
- Coverage    52.99%   52.56%   -0.44%     
===========================================
  Files          142      142              
  Lines        10363    10391      +28     
===========================================
- Hits          5492     5462      -30     
- Misses        4548     4600      +52     
- Partials       323      329       +6

@jackzampolin jackzampolin changed the title WIP: CLI flags to args R4R: CLI flags to args Feb 6, 2019
@alessio alessio requested a review from alexanderbez February 6, 2019 23:03
Read a transaction from [file_path] and broadcast it to a node. If you supply a dash (-) argument
in place of an input filename, the command reads from standard input.

$ gaiacli tx broadcast ./mytxn.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prepend with Example or e.g. here.

Short: "Query distribution validator commission",
Long: strings.TrimSpace(`Query validator commission rewards from delegators to that validator:

$ gaiacli query distr commission cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Short: "Query distribution validator slashes",
Long: strings.TrimSpace(`Query all slashes of a validator for a given block range:

$ gaiacli query distr slashes cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 0 100
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Short: "Query all distribution delegator rewards or rewards from a particular validator",
Long: strings.TrimSpace(`Query all rewards earned by a delegator, optionally restrict to rewards from a single validator:

$ gaiacli query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

var (
flagOnlyFromValidator = "only-from-validator"
flagIsValidator = "is-validator"
flagComission = "comission"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commission*

Args: cobra.NoArgs,
Long: strings.TrimSpace(`Withdraw all rewards for a single delegator:

$ gaiacli tx distr withdraw-all-rewards --from mykey
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Args: cobra.ExactArgs(1),
Long: strings.TrimSpace(`Set the withdraw address for rewards assoicated with a delegator address:

$ gaiacli tx set-withdraw-addr cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p --from mykey
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@jackzampolin jackzampolin merged commit 408484e into develop Feb 7, 2019
@jackzampolin jackzampolin deleted the jack/cli-args branch February 7, 2019 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants