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

x/staking: cli migration to use gRPC query client #6728

Merged
merged 22 commits into from
Jul 17, 2020

Conversation

atheeshp
Copy link
Contributor

@atheeshp atheeshp commented Jul 15, 2020

ref: #5921
closes: #6617

Description


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@atheeshp atheeshp changed the title Atheesh/5921 grpc cli migration staking x/staking: cli migration to use gRPC query client Jul 15, 2020
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #6728 into master will increase coverage by 2.80%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #6728      +/-   ##
==========================================
+ Coverage   59.94%   62.74%   +2.80%     
==========================================
  Files         513      386     -127     
  Lines       31434    23889    -7545     
==========================================
- Hits        18842    14989    -3853     
+ Misses      11156     7810    -3346     
+ Partials     1436     1090     -346     

This was referenced Jul 15, 2020
@atheeshp atheeshp marked this pull request as ready for review July 15, 2020 17:40
Copy link
Contributor

@blushi blushi left a comment

Choose a reason for hiding this comment

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

LGTM overall.
Just a small comment, shouldn't we remove

cmd.Flags().Int(flags.FlagPage, 1, "pagination page of unbonding delegations to query for")
cmd.Flags().Int(flags.FlagLimit, 100, "pagination limit of unbonding delegations to query for")
since they're not used anymore? Same for the other commands using those flags.

@fedekunze
Copy link
Collaborator

@blushi I had the same question. I created #6617 because my guess is that we would need to pass in those flags

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

LGTM. I also have the question about the missing pagination fields

x/staking/client/cli/query.go Outdated Show resolved Hide resolved
@fedekunze fedekunze added A:automerge Automatically merge PR once all prerequisites pass. C:x/staking labels Jul 16, 2020
Copy link
Collaborator

@anilcse anilcse left a comment

Choose a reason for hiding this comment

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

LGTM @atheeshp can you introduce pagination flags and refactor pagination queries accordingly? Let's address them in this PR so future PRs can make use of that

@atheeshp atheeshp requested a review from anilcse July 17, 2020 07:03
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

lgtm 👍, proposing to DRY the pagination flags

x/staking/client/cli/query.go Outdated Show resolved Hide resolved
@@ -61,6 +61,9 @@ const (
FlagPage = "page"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we remove this one?

Copy link
Contributor Author

@atheeshp atheeshp Jul 17, 2020

Choose a reason for hiding this comment

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

May be yes after all module migrations done.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, agreed with @atheeshp: auth,ibc,evidence,gov etc are all using FlagPage, probably should wait for those modules to switch to using gRPC & query.PageRequest first, or else this PR will become too big.

client/utils.go Outdated Show resolved Hide resolved
client/flags/flags.go Outdated Show resolved Hide resolved
client/flags/flags.go Outdated Show resolved Hide resolved
@atheeshp atheeshp requested a review from anilcse July 17, 2020 14:11
@atheeshp atheeshp requested a review from blushi July 17, 2020 15:20
Copy link
Collaborator

@anilcse anilcse left a comment

Choose a reason for hiding this comment

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

lgtm, just a small doc change.

client/flags/flags.go Show resolved Hide resolved
@mergify mergify bot merged commit c37f683 into master Jul 17, 2020
@mergify mergify bot deleted the atheesh/5921-grpc-cli-migration-staking branch July 17, 2020 15:23
chengwenxi pushed a commit to irisnet/cosmos-sdk that referenced this pull request Jul 22, 2020
* migrated to use gRPC query client

* removed codecs usage

* review change

* added read command flags

* added pagination flags

* fixed limit issue

* added helper function for default pagination flags

* review changes

* review change

* review changes

Co-authored-by: Federico Kunze <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:x/staking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing pagination flags
6 participants