-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Ensure all CLI queries respect output flags #3320
Changes from all commits
ad4764d
0c783e3
4d3f199
f961a70
562e57b
fbcd835
69fe4ce
8262553
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,7 +380,7 @@ func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool { | |
|
||
// QueryStakingParameters is gaiacli query staking parameters | ||
func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params { | ||
cmd := fmt.Sprintf("gaiacli query staking parameters %v", f.Flags()) | ||
cmd := fmt.Sprintf("gaiacli query staking params %v", f.Flags()) | ||
out, _ := tests.ExecuteT(f.T, addFlags(cmd, flags), "") | ||
var params staking.Params | ||
cdc := app.MakeCodec() | ||
|
@@ -426,11 +426,18 @@ func (f *Fixtures) QueryGovParamTallying() gov.TallyParams { | |
} | ||
|
||
// QueryGovProposals is gaiacli query gov proposals | ||
func (f *Fixtures) QueryGovProposals(flags ...string) string { | ||
func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals { | ||
cmd := fmt.Sprintf("gaiacli query gov proposals %v", f.Flags()) | ||
stdout, stderr := tests.ExecuteT(f.T, addFlags(cmd, flags), "") | ||
if strings.Contains(stderr, "No matching proposals found") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @jackzampolin -- we should use error variables in the future (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely. There is a bunch more that needs to be done to standardize errors across the various client software. |
||
return gov.Proposals{} | ||
} | ||
require.Empty(f.T, stderr) | ||
return stdout | ||
var out gov.Proposals | ||
cdc := app.MakeCodec() | ||
err := cdc.UnmarshalJSON([]byte(stdout), &out) | ||
require.NoError(f.T, err) | ||
return out | ||
} | ||
|
||
// QueryGovProposal is gaiacli query gov proposal | ||
|
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.
@jackzampolin this doesn't look intentional - merge artifact?
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.
can we take care of this in the release PR? 😬 sorry about this