-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2062 +/- ##
========================================
Coverage 63.83% 63.83%
========================================
Files 113 113
Lines 6684 6684
========================================
Hits 4267 4267
Misses 2133 2133
Partials 284 284 |
There was a problem hiding this 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" |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proposal.json
*
x/gov/client/cli/tx.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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)
x/gov/client/cli/tx.go
Outdated
) | ||
|
||
type proposal struct { | ||
Title string `json:"title"` |
There was a problem hiding this comment.
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(` |
There was a problem hiding this comment.
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:
x/gov/client/cli/tx.go
Outdated
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" |
There was a problem hiding this comment.
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
👍
64f0d27
to
1cc45cf
Compare
Closes cosmos#1852. Closes cosmos#1776.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Closes #1852.
Closes #1776.
docs/
)PENDING.md
that include links to the relevant issue or PR that most accurately describes the change.cmd/gaia
andexamples/
For Admin Use: