Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Support a proposal JSON file in submit-proposal #2062

Merged
merged 1 commit into from
Aug 22, 2018

Conversation

mslipper
Copy link
Contributor

@mslipper mslipper commented Aug 16, 2018

Closes #1852.
Closes #1776.

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Updated all relevant documentation (docs/)
  • Updated all relevant code comments
  • Wrote tests
  • Added entries in PENDING.md that include links to the relevant issue or PR that most accurately describes the change.
  • Updated cmd/gaia and examples/

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)

@codecov
Copy link

codecov bot commented Aug 16, 2018

Codecov Report

Merging #2062 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #2062   +/-   ##
========================================
  Coverage    63.83%   63.83%           
========================================
  Files          113      113           
  Lines         6684     6684           
========================================
  Hits          4267     4267           
  Misses        2133     2133           
  Partials       284      284

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

@mslipper thanks for the contribution! I left some feedback, but otherwise, great work.

Or, via a json file:

```bash
simplegovcli propose --proposal="test.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest changing this to: $ simplegovcli propose --proposal=path/to/proposal.json

simplegovcli propose --proposal="test.json"
```

Where test.json contains:
Copy link
Contributor

Choose a reason for hiding this comment

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

proposal.json*

@@ -80,10 +117,42 @@ func GetCmdSubmitProposal(cdc *wire.Codec) *cobra.Command {
cmd.Flags().String(flagDescription, "", "description of proposal")
cmd.Flags().String(flagProposalType, "", "proposalType of proposal")
cmd.Flags().String(flagDeposit, "", "deposit of proposal")
cmd.Flags().String(flagProposal, "", "proposal file path")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe update this to say:

Proposal file path (if this path is given, other proposal flags are ignored)

)

type proposal struct {
Title string `json:"title"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need JSON tags for this, do we?

// GetCmdSubmitProposal implements submitting a proposal transaction command.
func GetCmdSubmitProposal(cdc *wire.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: "submit-proposal",
Short: "Submit a proposal along with an initial deposit",
Long: strings.TrimSpace(`
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest changing this to something along the lines of:

Submit a proposal along with an initial deposit. Proposal title, description, type and deposit can be given directly or through a proposal JSON file. For example:

Submit a proposal along with an initial deposit. Takes four flags: --title, --description, --type, and --deposit.
Alternatively, you may pass a path to a .json file containing your proposal via the --proposal flag. For example:

$ gaiacli gov submit-proposal --proposal="proposal.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

--proposal=path/to/proposal.json 👍

@mslipper mslipper force-pushed the issue-1776 branch 2 times, most recently from 64f0d27 to 1cc45cf Compare August 21, 2018 18:02
@jackzampolin jackzampolin changed the title Support a proposal JSON file in submit-proposal R4R: Support a proposal JSON file in submit-proposal Aug 21, 2018
@jaekwon
Copy link
Contributor

jaekwon commented Aug 21, 2018

LGTM

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

utACK

@cwgoes cwgoes dismissed alexanderbez’s stale review August 22, 2018 10:31

Addressed, I think

@cwgoes cwgoes merged commit 4b5bb45 into cosmos:develop Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants