-
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
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3320 +/- ##
===========================================
- Coverage 55.64% 54.92% -0.72%
===========================================
Files 132 132
Lines 9559 9680 +121
===========================================
- Hits 5319 5317 -2
- Misses 3903 4026 +123
Partials 337 337 |
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.
some minor comments
872893c
to
f2ea39c
Compare
f2ea39c
to
b6bea2b
Compare
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.
Comments addressed, thus nihil obstat from me.
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.
Looks great @jackzampolin! I left some initial feedback, but have not manually tested yet. I will be doing that shortly.
|
||
func (vs ValidatorSlashEvents) String() string { | ||
out := "Validator Slash Events:\n" | ||
for i, sl := range vs { |
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.
Should these have newlines appended?
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.
They are actually multiline strings and the newlines are added properly. Are you seeing issues when using that function?
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.
Im just thinking how will multiple slashes be separated?
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 also noticed some decimal values are stringified and others are not (e.g. gov vs distr)
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jackzampolin -- we should use error variables in the future (e.g. strings.Contains(stderr, gov.ErrNoMatchingProposals)
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.
Absolutely. There is a bunch more that needs to be done to standardize errors across the various client software.
x/gov/client/utils/query.go
Outdated
} | ||
|
||
func (p Proposer) String() string { | ||
return fmt.Sprintf("Proposal w/ ID %d was proposed by %s", p.ProposalID, p.Proposer) |
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.
return fmt.Sprintf("Proposal w/ ID %d was proposed by %s", p.ProposalID, p.Proposer) | |
return fmt.Sprintf("Proposal with ID %d was proposed by %s", p.ProposalID, p.Proposer) |
x/gov/client/utils/query.go
Outdated
|
||
// QueryProposalByID takes a proposalID and returns a proposal | ||
func QueryProposalByID(proposalID uint64, cliCtx context.CLIContext, cdc *codec.Codec, queryRoute string) ([]byte, error) { | ||
// Construct query |
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.
// Construct query |
a73ba9b
to
fbcd835
Compare
@@ -37,10 +33,18 @@ BREAKING CHANGES | |||
* [\#3064](https://github.com/cosmos/cosmos-sdk/issues/3064) Sanitize `sdk.Coin` denom. Coins denoms are now case insensitive, i.e. 100fooToken equals to 100FOOTOKEN. | |||
* [\#3195](https://github.com/cosmos/cosmos-sdk/issues/3195) Allows custom configuration for syncable strategy | |||
* [\#3242](https://github.com/cosmos/cosmos-sdk/issues/3242) Fix infinite gas | |||
<<<<<<< HEAD |
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
Closes #3268
Fixes #3255
Closes #2607
There were also some small changes to 3 staking commands to remove excessive flags and replace them with arguments. Each of these commands were the singular version (redelegation vs redelegations) where the plural took no flags, and the singular took 2-3. This PR results in a much cleaner and consistent UX for queries on the command line.
I've also added some comments here to help reviewers.
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: